llvm.org GIT mirror llvm / 8b6af8a
LSR wants to split the landing pad's critical edge. Let it do it, but use the proper function to do it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138550 91177308-0d34-0410-b5e6-96231b3b80d8 Bill Wendling 9 years ago
2 changed file(s) with 37 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
36243624 Loop *PNLoop = LI.getLoopFor(Parent);
36253625 if (!PNLoop || Parent != PNLoop->getHeader()) {
36263626 // Split the critical edge.
3627 BasicBlock *NewBB = SplitCriticalEdge(BB, Parent, P);
3627 BasicBlock *NewBB = 0;
3628 if (!Parent->isLandingPad()) {
3629 NewBB = SplitCriticalEdge(BB, Parent, P);
3630 } else {
3631 SmallVector NewBBs;
3632 SplitLandingPadPredecessors(Parent, BB, "", "", P, NewBBs);
3633 NewBB = NewBBs[0];
3634 }
36283635
36293636 // If PN is outside of the loop and BB is in the loop, we want to
36303637 // move the block to be immediately before the PHI block, not
0 ; RUN: llc < %s
1 ; PR10733
2 declare void @_Znam()
3
4 define void @_ZNK14gIndexOdometer15AfterExcisionOfERi() uwtable align 2 {
5 _ZN6Gambit5ArrayIiEC2Ej.exit36:
6 br label %"9"
7
8 "9": ; preds = %"10", %_ZN6Gambit5ArrayIiEC2Ej.exit36
9 %indvar82 = phi i64 [ 0, %_ZN6Gambit5ArrayIiEC2Ej.exit36 ], [ %tmp85, %"10" ]
10 %tmp85 = add i64 %indvar82, 1
11 %tmp = trunc i64 %tmp85 to i32
12 invoke void @_ZNK14gIndexOdometer9NoIndicesEv()
13 to label %"10" unwind label %lpad27
14
15 "10": ; preds = %"9"
16 invoke void @_Znam()
17 to label %"9" unwind label %lpad27
18
19 lpad27: ; preds = %"10", %"9"
20 %0 = phi i32 [ undef, %"9" ], [ %tmp, %"10" ]
21 %1 = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @__gxx_personality_v0
22 cleanup
23 resume { i8*, i32 } zeroinitializer
24 }
25
26 declare void @_ZNK14gIndexOdometer9NoIndicesEv()
27
28 declare i32 @__gxx_personality_v0(i32, i64, i8*, i8*)