llvm.org GIT mirror llvm / 18112d8
To ensure that we have more accurate line information for a block don't elide the branch instruction if it's the only one in the block, otherwise it's ok. PR9796 and rdar://11215207 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154417 91177308-0d34-0410-b5e6-96231b3b80d8 Eric Christopher 8 years ago
2 changed file(s) with 7 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
820820 /// the CFG.
821821 void
822822 FastISel::FastEmitBranch(MachineBasicBlock *MSucc, DebugLoc DL) {
823 if (FuncInfo.MBB->isLayoutSuccessor(MSucc)) {
824 // The unconditional fall-through case, which needs no instructions.
823
824 if (FuncInfo.MBB->getBasicBlock()->size() > 1 && FuncInfo.MBB->isLayoutSuccessor(MSucc)) {
825 // For more accurate line information if this is the only instruction
826 // in the block then emit it, otherwise we have the unconditional
827 // fall-through case, which needs no instructions.
825828 } else {
826829 // The unconditional branch case.
827830 TII.InsertBranch(*FuncInfo.MBB, MSucc, NULL,
44 entry:
55 ; THUMB: t1:
66 ; ARM: t1:
7
7 %x = add i32 %a, %b
88 br i1 1, label %if.then, label %if.else
99 ; THUMB-NOT: b LBB0_1
1010 ; ARM-NOT: b LBB0_1
2323 br label %if.end6
2424
2525 if.else3: ; preds = %if.else
26 %y = sub i32 %a, %b
2627 br i1 1, label %if.then5, label %if.end
2728 ; THUMB-NOT: b LBB0_5
2829 ; ARM-NOT: b LBB0_5