1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00

Incorporated feedback: Check that the implicitly defined operands aren't used

before deleting the instruction.

llvm-svn: 51609
This commit is contained in:
Bill Wendling 2008-05-27 20:40:52 +00:00
parent 92d5dff525
commit e5d738e779

View File

@ -373,6 +373,8 @@ bool TwoAddressInstructionPass::runOnMachineFunction(MachineFunction &MF) {
}
if (EnableReMat) {
// Check to see if the instructions that we rematerialized are now dead. If
// they are, expunge them here.
SmallPtrSet<MachineInstr*, 8>::iterator I = ReMattedInstrs.begin();
SmallPtrSet<MachineInstr*, 8>::iterator E = ReMattedInstrs.end();
@ -385,10 +387,8 @@ bool TwoAddressInstructionPass::runOnMachineFunction(MachineFunction &MF) {
if (!MO.isRegister())
continue;
unsigned MOReg = MO.getReg();
if (!MOReg)
continue;
if (MO.isDef()) {
if (MO.isImplicit())
if (!MOReg || !MO.isDef() || (MO.isImplicit() && MO.isDead()))
continue;
if (MRI->use_begin(MOReg) != MRI->use_end()) {
@ -396,9 +396,8 @@ bool TwoAddressInstructionPass::runOnMachineFunction(MachineFunction &MF) {
break;
}
}
}
if (InstrDead && MI->getNumOperands() > 0)
if (InstrDead)
MI->eraseFromParent();
}
}