diff options
| author | Owen Anderson <resistor@mac.com> | 2008-07-02 23:41:07 +0000 |
|---|---|---|
| committer | Owen Anderson <resistor@mac.com> | 2008-07-02 23:41:07 +0000 |
| commit | 30cc028e4a7dad0d34634b5a9fdf6c3b4ce5d00d (patch) | |
| tree | ea52a03276f01978a50655a9743c816a8343b519 /llvm/lib/CodeGen | |
| parent | 22e9707480f1cf56e65559b8d4d8d0374f03c5e9 (diff) | |
| download | bcm5719-llvm-30cc028e4a7dad0d34634b5a9fdf6c3b4ce5d00d.tar.gz bcm5719-llvm-30cc028e4a7dad0d34634b5a9fdf6c3b4ce5d00d.zip | |
Make LiveVariables even more optional, by making it optional in the call to TargetInstrInfo::convertToThreeAddressInstruction
Also, if LV isn't around, then TwoAddr doesn't need to be updating flags, since they won't have been set in the first place.
llvm-svn: 53058
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/TwoAddressInstructionPass.cpp | 47 |
1 files changed, 1 insertions, 46 deletions
diff --git a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp index f6e2f55b306..d2e5288d34b 100644 --- a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp +++ b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp @@ -378,27 +378,6 @@ bool TwoAddressInstructionPass::runOnMachineFunction(MachineFunction &MF) { if (LV) { // Update live variables LV->instructionChanged(mi, NewMI); - } else { - // Update flags manually - for (unsigned i = 0, e = mi->getNumOperands(); - i != e; ++i) { - MachineOperand &MO = mi->getOperand(i); - if (MO.isRegister() && MO.getReg() && - TargetRegisterInfo::isVirtualRegister(MO.getReg())) { - unsigned Reg = MO.getReg(); - if (MO.isDef()) { - if (MO.isDead()) { - MO.setIsDead(false); - NewMI->addRegisterDead(Reg, TRI); - } - } - - if (MO.isKill()) { - MO.setIsKill(false); - NewMI->addRegisterKilled(Reg, TRI); - } - } - } } mbbi->insert(mi, NewMI); // Insert the new inst @@ -424,7 +403,7 @@ bool TwoAddressInstructionPass::runOnMachineFunction(MachineFunction &MF) { assert(TID.getOperandConstraint(i, TOI::TIED_TO) == -1); #endif - MachineInstr *NewMI = TII->convertToThreeAddress(mbbi, mi, *LV); + MachineInstr *NewMI = TII->convertToThreeAddress(mbbi, mi, LV); if (NewMI) { DOUT << "2addr: CONVERTING 2-ADDR: " << *mi; DOUT << "2addr: TO 3-ADDR: " << *NewMI; @@ -481,30 +460,6 @@ bool TwoAddressInstructionPass::runOnMachineFunction(MachineFunction &MF) { if (LV->removeVirtualRegisterDead(regB, mbbi, mi)) LV->addVirtualRegisterDead(regB, prevMi); - } else { - // Manually update kill/dead flags. - bool RemovedKill = false; - bool RemovedDead = false; - for (unsigned i = 0, e = mi->getNumOperands(); i != e; ++i) { - MachineOperand &MO = mi->getOperand(i); - if (MO.isRegister() && MO.isKill() && MO.getReg() == regB) { - MO.setIsKill(false); - RemovedKill = true; - break; - } - - if (MO.isRegister() && MO.isDef() && MO.getReg() == regB) { - MO.setIsDead(false); - RemovedDead = true; - } - - if (RemovedKill && RemovedDead) break; - } - - if (RemovedKill) - prevMi->addRegisterKilled(regB, TRI); - if (RemovedDead) - prevMi->addRegisterDead(regB, TRI); } // Replace all occurences of regB with regA. |

