[llvm-branch-commits] [llvm-branch] r106400 - in /llvm/branches/Apple/Troughton: lib/Target/ARM/Thumb2ITBlockPass.cpp test/CodeGen/Thumb2/2010-06-19-ITBlockCrash.ll

Evan Cheng evan.cheng at apple.com
Sat Jun 19 17:56:35 PDT 2010


Author: evancheng
Date: Sat Jun 19 19:56:35 2010
New Revision: 106400

URL: http://llvm.org/viewvc/llvm-project?rev=106400&view=rev
Log:
Merge 106399.

Added:
    llvm/branches/Apple/Troughton/test/CodeGen/Thumb2/2010-06-19-ITBlockCrash.ll
      - copied unchanged from r106399, llvm/trunk/test/CodeGen/Thumb2/2010-06-19-ITBlockCrash.ll
Modified:
    llvm/branches/Apple/Troughton/lib/Target/ARM/Thumb2ITBlockPass.cpp

Modified: llvm/branches/Apple/Troughton/lib/Target/ARM/Thumb2ITBlockPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Troughton/lib/Target/ARM/Thumb2ITBlockPass.cpp?rev=106400&r1=106399&r2=106400&view=diff
==============================================================================
--- llvm/branches/Apple/Troughton/lib/Target/ARM/Thumb2ITBlockPass.cpp (original)
+++ llvm/branches/Apple/Troughton/lib/Target/ARM/Thumb2ITBlockPass.cpp Sat Jun 19 19:56:35 2010
@@ -317,12 +317,14 @@
     // If not, then there is nothing to be gained by moving the copy.
     MachineBasicBlock::iterator I = MI; ++I;
     MachineBasicBlock::iterator E = MI->getParent()->end();
-    while (I != E && I->isDebugValue())
-      ++I;
-    unsigned NPredReg = 0;
-    ARMCC::CondCodes NCC = getPredicate(I, NPredReg);
-    if (NCC == CC || NCC == OCC)
-      return true;
+    if (I != E) {
+      while (I != E && I->isDebugValue())
+        ++I;
+      unsigned NPredReg = 0;
+      ARMCC::CondCodes NCC = getPredicate(I, NPredReg);
+      if (NCC == CC || NCC == OCC)
+        return true;
+    }
   }
   return false;
 }





More information about the llvm-branch-commits mailing list