/// specified register is killed after being used by the specified
/// instruction.
///
- void addVirtualRegisterKilled(unsigned IncomingReg,
- MachineBasicBlock *MBB,
- MachineInstr *MI) {
+ void addVirtualRegisterKilled(unsigned IncomingReg, MachineInstr *MI) {
RegistersKilled.insert(std::make_pair(MI, IncomingReg));
- getVarInfo(IncomingReg).Kills.push_back(std::make_pair(MBB, MI));
+ getVarInfo(IncomingReg).Kills.push_back(std::make_pair(MI->getParent(),MI));
}
/// removeVirtualRegisterKilled - Remove the specified virtual
/// addVirtualRegisterDead - Add information about the fact that the specified
/// register is dead after being used by the specified instruction.
///
- void addVirtualRegisterDead(unsigned IncomingReg,
- MachineBasicBlock *MBB,
- MachineInstr *MI) {
+ void addVirtualRegisterDead(unsigned IncomingReg, MachineInstr *MI) {
RegistersDead.insert(std::make_pair(MI, IncomingReg));
- getVarInfo(IncomingReg).Kills.push_back(std::make_pair(MBB, MI));
+ getVarInfo(IncomingReg).Kills.push_back(std::make_pair(MI->getParent(),MI));
}
/// removeVirtualRegisterDead - Remove the specified virtual
nI.addRange(start, end);
added.push_back(&nI);
// update live variables
- lv_->addVirtualRegisterKilled(nReg, mi->getParent(),mi);
+ lv_->addVirtualRegisterKilled(nReg, mi);
DEBUG(std::cerr << "\t\t\t\tadded new interval: "
<< nI << '\n');
}
"Should have kill for defblock!");
// Add a new kill entry for this basic block.
- VRInfo.Kills.push_back(std::make_pair(MBB, MI));
+ VRInfo.Kills.push_back(std::make_pair(MI->getParent(), MI));
// Update all dominating blocks to mark them known live.
const BasicBlock *BB = MBB->getBasicBlock();
assert(VRInfo.DefInst == 0 && "Variable multiply defined!");
VRInfo.DefInst = MI;
- VRInfo.Kills.push_back(std::make_pair(MBB, MI)); // Defaults to dead
+ // Defaults to dead
+ VRInfo.Kills.push_back(std::make_pair(MI->getParent(), MI));
} else if (MRegisterInfo::isPhysicalRegister(MO.getReg()) &&
AllocatablePhysicalRegisters[MO.getReg()]) {
HandlePhysRegDef(MO.getReg(), MI);
// each for each incoming block), the "def" block and instruction fields
// for the VarInfo is not filled in.
//
- LV->addVirtualRegisterKilled(IncomingReg, &MBB, PHICopy);
+ LV->addVirtualRegisterKilled(IncomingReg, PHICopy);
// Since we are going to be deleting the PHI node, if it is the last use
// of any registers, or if the value itself is dead, we need to move this
// Add all of the kills back, which will update the appropriate info...
for (unsigned i = 0, e = Range.size(); i != e; ++i)
- LV->addVirtualRegisterKilled(Range[i].second, &MBB, PHICopy);
+ LV->addVirtualRegisterKilled(Range[i].second, PHICopy);
}
RKs = LV->dead_range(MI);
Range.assign(RKs.first, RKs.second);
LV->removeVirtualRegistersDead(RKs.first, RKs.second);
for (unsigned i = 0, e = Range.size(); i != e; ++i)
- LV->addVirtualRegisterDead(Range[i].second, &MBB, PHICopy);
+ LV->addVirtualRegisterDead(Range[i].second, PHICopy);
}
}
//
if (!ValueIsLive) {
MachineBasicBlock::iterator Prev = prior(I);
- LV->addVirtualRegisterKilled(SrcReg, &opBlock, Prev);
+ LV->addVirtualRegisterKilled(SrcReg, Prev);
}
}
}
// update live variables for regB
if (LV->removeVirtualRegisterKilled(regB, &*mbbi, mi))
- LV->addVirtualRegisterKilled(regB, &*mbbi, prevMi);
+ LV->addVirtualRegisterKilled(regB, prevMi);
if (LV->removeVirtualRegisterDead(regB, &*mbbi, mi))
- LV->addVirtualRegisterDead(regB, &*mbbi, prevMi);
+ LV->addVirtualRegisterDead(regB, prevMi);
}
// replace all occurences of regB with regA