summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2010-10-09 00:03:48 +0000
committerBill Wendling <isanbard@gmail.com>2010-10-09 00:03:48 +0000
commit59ebe44049076dcdc4f764ed12d7531f07fcacbf (patch)
tree7deb2c711d85403a52d89c9b7b81983fb9acce12 /llvm/lib
parentc951cfe6a00ca35cb3e62aeceafcf890dc752058 (diff)
downloadbcm5719-llvm-59ebe44049076dcdc4f764ed12d7531f07fcacbf.tar.gz
bcm5719-llvm-59ebe44049076dcdc4f764ed12d7531f07fcacbf.zip
Check to make sure that the iterator isn't at the beginning of the basic block
before decrementing. <rdar://problem/8529919> llvm-svn: 116126
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp b/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
index a2baf3b9e2c..26b4f0e54c1 100644
--- a/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
+++ b/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
@@ -1528,6 +1528,10 @@ OptimizeCompareInstr(MachineInstr *CmpInstr, unsigned SrcReg, int CmpMask,
// want to change.
MachineBasicBlock::const_iterator I = CmpInstr, E = MI,
B = MI->getParent()->begin();
+
+ // Early exit if CmpInstr is at the beginning of the BB.
+ if (I == B) return false;
+
--I;
for (; I != E; --I) {
const MachineInstr &Instr = *I;
OpenPOWER on IntegriCloud