summaryrefslogtreecommitdiff
path: root/lib/Target/Alpha/AlphaInstrInfo.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2007-06-13 17:59:52 +0000
committerDale Johannesen <dalej@apple.com>2007-06-13 17:59:52 +0000
commit13e8b51e3ec014c5d7ae83afdf3b8fd29c3a461d (patch)
tree99ad4ddf2f16711868c116de69c6e1240f0560ef /lib/Target/Alpha/AlphaInstrInfo.cpp
parentea632439d4259254670dc4a27b13d6f9370216a8 (diff)
downloadllvm-13e8b51e3ec014c5d7ae83afdf3b8fd29c3a461d.tar.gz
llvm-13e8b51e3ec014c5d7ae83afdf3b8fd29c3a461d.tar.bz2
llvm-13e8b51e3ec014c5d7ae83afdf3b8fd29c3a461d.tar.xz
Handle blocks with 2 unconditional branches in AnalyzeBranch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37571 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Alpha/AlphaInstrInfo.cpp')
-rw-r--r--lib/Target/Alpha/AlphaInstrInfo.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Target/Alpha/AlphaInstrInfo.cpp b/lib/Target/Alpha/AlphaInstrInfo.cpp
index 15f5f841bc..718587dd29 100644
--- a/lib/Target/Alpha/AlphaInstrInfo.cpp
+++ b/lib/Target/Alpha/AlphaInstrInfo.cpp
@@ -200,6 +200,16 @@ bool AlphaInstrInfo::AnalyzeBranch(MachineBasicBlock &MBB,MachineBasicBlock *&TB
return false;
}
+ // If the block ends with two Alpha::BRs, handle it. The second one is not
+ // executed, so remove it.
+ if (SecondLastInst->getOpcode() == Alpha::BR &&
+ LastInst->getOpcode() == Alpha::BR) {
+ TBB = SecondLastInst->getOperand(0).getMachineBasicBlock();
+ I = LastInst;
+ I->eraseFromParent();
+ return false;
+ }
+
// Otherwise, can't handle this.
return true;
}