Fix 403.gcc. Finally got the check for two-address-ness correct.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53389 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Owen Anderson 2008-07-10 01:53:01 +00:00
parent c007848b5a
commit ecee36ece6

View File

@ -589,20 +589,24 @@ void RALocal::ComputeLocalLiveness(MachineBasicBlock& MBB) {
std::map<unsigned, std::pair<MachineInstr*, unsigned> >::iterator std::map<unsigned, std::pair<MachineInstr*, unsigned> >::iterator
last = LastUseDef.find(MO.getReg()); last = LastUseDef.find(MO.getReg());
if (last != LastUseDef.end()) { if (last != LastUseDef.end()) {
// Check if this is a two address instruction. If so, then
// If this is a two address instr, then we don't mark the def // the def does not kill the use.
// as killing the use. if (last->second.first == I) {
if (last->second.first == I && bool isTwoAddr = false;
I->getDesc().getOperandConstraint(last->second.second, for (unsigned j = i+1, je = I->getDesc().getNumOperands();
TOI::TIED_TO) == (signed)i) { j < je; ++j) {
LastUseDef[MO.getReg()] = std::make_pair(I, i); const MachineOperand &MO2 = I->getOperand(j);
continue; if (MO2.isRegister() && MO2.isUse() &&
MO2.getReg() == MO.getReg() &&
I->getDesc().getOperandConstraint(j, TOI::TIED_TO) == (int)i)
isTwoAddr = true;
}
if (isTwoAddr) continue;
} }
MachineOperand& lastUD = MachineOperand& lastUD =
last->second.first->getOperand(last->second.second); last->second.first->getOperand(last->second.second);
if (lastUD.isDef()) if (lastUD.isDef())
lastUD.setIsDead(true); lastUD.setIsDead(true);
else if (lastUD.isUse()) else if (lastUD.isUse())