Invert these branches by default, it makes assembly comparisons a little
authorEric Christopher <echristo@apple.com>
Wed, 3 Nov 2010 04:29:11 +0000 (04:29 +0000)
committerEric Christopher <echristo@apple.com>
Wed, 3 Nov 2010 04:29:11 +0000 (04:29 +0000)
easier to read.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118148 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMFastISel.cpp

index d46ed95b1af8776917ce137a9fa6080f608679d4..110aa9804cdab2a9eeb421bd53ce05e19e189cb3 100644 (file)
@@ -1014,11 +1014,11 @@ bool ARMFastISel::SelectBranch(const Instruction *I) {
   // Re-set the flags just in case.
   unsigned CmpOpc = isThumb ? ARM::t2CMPri : ARM::CMPri;
   AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(CmpOpc))
-                  .addReg(CmpReg).addImm(1));
+                  .addReg(CmpReg).addImm(0));
 
   unsigned BrOpc = isThumb ? ARM::t2Bcc : ARM::Bcc;
   BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(BrOpc))
-                  .addMBB(TBB).addImm(ARMCC::EQ).addReg(ARM::CPSR);
+                  .addMBB(TBB).addImm(ARMCC::NE).addReg(ARM::CPSR);
   FastEmitBranch(FBB, DL);
   FuncInfo.MBB->addSuccessor(TBB);
   return true;