llvm.org GIT mirror llvm / ddb1420
MachineBasicBlock::SplitCriticalEdge() should follow LLVM IR variant and refuse to break edge to EH landing pad. rdar://11300144 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155470 91177308-0d34-0410-b5e6-96231b3b80d8 Evan Cheng 7 years ago
2 changed file(s) with 76 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
595595
596596 MachineBasicBlock *
597597 MachineBasicBlock::SplitCriticalEdge(MachineBasicBlock *Succ, Pass *P) {
598 // Splitting the critical edge to a landing pad block is non-trivial. Don't do
599 // it in this generic function.
600 if (Succ->isLandingPad())
601 return NULL;
602
598603 MachineFunction *MF = getParent();
599604 DebugLoc dl; // FIXME: this is nowhere
600605
0 ; RUN: llc -mtriple=thumbv7-apple-ios -relocation-model=pic -disable-fp-elim -mcpu=cortex-a8 < %s
1
2 ; CodeGen SplitCriticalEdge() shouldn't try to break edge to a landing pad.
3 ; rdar://11300144
4
5 %0 = type opaque
6 %class.FunctionInterpreter.3.15.31 = type { %class.Parser.1.13.29, %class.Parser.1.13.29*, %struct.ParserVariable.2.14.30*, i32 }
7 %class.Parser.1.13.29 = type { i32 (...)**, %class.Parser.1.13.29* }
8 %struct.ParserVariable.2.14.30 = type opaque
9 %struct.ParseErrorMsg.0.12.28 = type { i32, i32, i32 }
10
11 @_ZTI13ParseErrorMsg = external hidden unnamed_addr constant { i8*, i8* }
12 @"OBJC_IVAR_$_MUMathExpressionDoubleBased.mInterpreter" = external hidden global i32, section "__DATA, __objc_ivar", align 4
13 @"\01L_OBJC_SELECTOR_REFERENCES_14" = external hidden global i8*, section "__DATA, __objc_selrefs, literal_pointers, no_dead_strip"
14
15 declare i8* @objc_msgSend(i8*, i8*, ...)
16
17 declare i32 @llvm.eh.typeid.for(i8*) nounwind readnone
18
19 declare i8* @__cxa_begin_catch(i8*)
20
21 declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
22
23 declare void @__cxa_end_catch()
24
25 declare void @_ZSt9terminatev()
26
27 define hidden double @t(%0* %self, i8* nocapture %_cmd) optsize ssp {
28 entry:
29 %call = invoke double undef(%class.FunctionInterpreter.3.15.31* undef) optsize
30 to label %try.cont unwind label %lpad
31
32 lpad: ; preds = %entry
33 %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
34 catch i8* bitcast ({ i8*, i8* }* @_ZTI13ParseErrorMsg to i8*)
35 br i1 undef, label %catch, label %eh.resume
36
37 catch: ; preds = %lpad
38 invoke void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, %struct.ParseErrorMsg.0.12.28*)*)(i8* undef, i8* undef, %struct.ParseErrorMsg.0.12.28* undef) optsize
39 to label %invoke.cont2 unwind label %lpad1
40
41 invoke.cont2: ; preds = %catch
42 br label %try.cont
43
44 try.cont: ; preds = %invoke.cont2, %entry
45 %value.0 = phi double [ 0x7FF8000000000000, %invoke.cont2 ], [ %call, %entry ]
46 ret double %value.0
47
48 lpad1: ; preds = %catch
49 %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
50 cleanup
51 invoke void @__cxa_end_catch()
52 to label %eh.resume unwind label %terminate.lpad
53
54 eh.resume: ; preds = %lpad1, %lpad
55 resume { i8*, i32 } undef
56
57 terminate.lpad: ; preds = %lpad1
58 %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
59 catch i8* null
60 unreachable
61 }
62
63 declare i32 @__gxx_personality_sj0(...)
64
65 !llvm.module.flags = !{!0, !1, !2, !3}
66
67 !0 = metadata !{i32 1, metadata !"Objective-C Version", i32 2}
68 !1 = metadata !{i32 1, metadata !"Objective-C Image Info Version", i32 0}
69 !2 = metadata !{i32 1, metadata !"Objective-C Image Info Section", metadata !"__DATA, __objc_imageinfo, regular, no_dead_strip"}
70 !3 = metadata !{i32 4, metadata !"Objective-C Garbage Collection", i32 0}