summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2012-04-10 18:18:10 +0000
committerEric Christopher <echristo@apple.com>2012-04-10 18:18:10 +0000
commite9abba71fe084db1699dceabd4d2ae1b75af61c9 (patch)
tree2f1f6737852823d8c7feea99266d8129214cfd6c /llvm/lib/CodeGen
parent6153c518b91061fc001ffb754e13233bf11c4aa2 (diff)
downloadbcm5719-llvm-e9abba71fe084db1699dceabd4d2ae1b75af61c9.tar.gz
bcm5719-llvm-e9abba71fe084db1699dceabd4d2ae1b75af61c9.zip
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 llvm-svn: 154417
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/FastISel.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
index 5de66670b2f..0c1ac6982d2 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -821,8 +821,11 @@ FastISel::SelectInstruction(const Instruction *I) {
/// the CFG.
void
FastISel::FastEmitBranch(MachineBasicBlock *MSucc, DebugLoc DL) {
- if (FuncInfo.MBB->isLayoutSuccessor(MSucc)) {
- // The unconditional fall-through case, which needs no instructions.
+
+ if (FuncInfo.MBB->getBasicBlock()->size() > 1 && FuncInfo.MBB->isLayoutSuccessor(MSucc)) {
+ // For more accurate line information if this is the only instruction
+ // in the block then emit it, otherwise we have the unconditional
+ // fall-through case, which needs no instructions.
} else {
// The unconditional branch case.
TII.InsertBranch(*FuncInfo.MBB, MSucc, NULL,
OpenPOWER on IntegriCloud