aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2010-09-23 19:42:03 +0000
committerEvan Cheng <evan.cheng@apple.com>2010-09-23 19:42:03 +0000
commit676e258366dd17a0b4ee6ac66914237ce181202e (patch)
treecc18b192a5087cc2a881acab6eb719148e6661f1 /lib/Target
parent24e6f2f802e43af0e3c72ed17fa73e3bc101dc9e (diff)
downloadexternal_llvm-676e258366dd17a0b4ee6ac66914237ce181202e.zip
external_llvm-676e258366dd17a0b4ee6ac66914237ce181202e.tar.gz
external_llvm-676e258366dd17a0b4ee6ac66914237ce181202e.tar.bz2
Fix r114632. Return if the only terminator is an unconditional branch after the redundant ones are deleted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114688 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r--lib/Target/ARM/ARMBaseInstrInfo.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Target/ARM/ARMBaseInstrInfo.cpp b/lib/Target/ARM/ARMBaseInstrInfo.cpp
index 7786de2..a0f0c39 100644
--- a/lib/Target/ARM/ARMBaseInstrInfo.cpp
+++ b/lib/Target/ARM/ARMBaseInstrInfo.cpp
@@ -284,9 +284,11 @@ ARMBaseInstrInfo::AnalyzeBranch(MachineBasicBlock &MBB,MachineBasicBlock *&TBB,
LastInst->eraseFromParent();
LastInst = SecondLastInst;
LastOpc = LastInst->getOpcode();
- if (I == MBB.begin() || !isUnpredicatedTerminator(--I))
- break;
- else {
+ if (I == MBB.begin() || !isUnpredicatedTerminator(--I)) {
+ // Return now the only terminator is an unconditional branch.
+ TBB = LastInst->getOperand(0).getMBB();
+ return false;
+ } else {
SecondLastInst = I;
SecondLastOpc = SecondLastInst->getOpcode();
}