[SystemZ] Minor fixes in SystemZElimCompare.cpp
authorJonas Paulsson <jonas.paulsson@ericsson.com>
Thu, 8 Oct 2015 07:39:55 +0000 (07:39 +0000)
committerJonas Paulsson <jonas.paulsson@ericsson.com>
Thu, 8 Oct 2015 07:39:55 +0000 (07:39 +0000)
Reviewed by Ulrich Weigand.

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

lib/Target/SystemZ/SystemZElimCompare.cpp

index 16f9adc79f1763b649933c857015978ac0dfad88..d26e40b4791f7a3e503a16da68258c1d356d5c29 100644 (file)
@@ -205,7 +205,7 @@ SystemZElimCompare::convertToBRCT(MachineInstr *MI, MachineInstr *Compare,
     .addOperand(MI->getOperand(1))
     .addOperand(Target)
     .addReg(SystemZ::CC, RegState::ImplicitDefine);
-  MI->removeFromParent();
+  MI->eraseFromParent();
   return true;
 }
 
@@ -439,17 +439,16 @@ bool SystemZElimCompare::processBlock(MachineBasicBlock &MBB) {
         (optimizeCompareZero(MI, CCUsers) ||
          fuseCompareAndBranch(MI, CCUsers))) {
       ++MBBI;
-      MI->removeFromParent();
+      MI->eraseFromParent();
       Changed = true;
       CCUsers.clear();
-      CompleteCCUsers = true;
       continue;
     }
 
     Reference CCRefs(getRegReferences(MI, SystemZ::CC));
     if (CCRefs.Def) {
       CCUsers.clear();
-      CompleteCCUsers = !CCRefs.IndirectDef;
+      CompleteCCUsers = true;
     }
     if (CompleteCCUsers && CCRefs.Use)
       CCUsers.push_back(MI);