[SystemZ] Minor fixes in SystemZElimCompare.cpp

Reviewed by Ulrich Weigand.

llvm-svn: 249662
This commit is contained in:
Jonas Paulsson 2015-10-08 07:39:55 +00:00
parent 90c5099e8a
commit 9e1f3bd1bd
1 changed files with 3 additions and 4 deletions

View 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);