class LiveVariables : public MachineFunctionPass {
public:
struct VarInfo {
- /// DefBlock - The basic block which defines this value...
- MachineBasicBlock *DefBlock;
+ /// DefInst - The machine instruction that defines this register.
MachineInstr *DefInst;
/// AliveBlocks - Set of blocks of which this value is alive completely
///
std::vector<std::pair<MachineBasicBlock*, MachineInstr*> > Kills;
- VarInfo() : DefBlock(0), DefInst(0) {}
+ VarInfo() : DefInst(0) {}
/// removeKill - Delete a kill corresponding to the specified
/// machine instruction. Returns true if there was a kill
break;
}
- if (MBB == VRInfo.DefBlock) return; // Terminate recursion
+ if (MBB == VRInfo.DefInst->getParent()) return; // Terminate recursion
if (VRInfo.AliveBlocks.size() <= BBNum)
VRInfo.AliveBlocks.resize(BBNum+1); // Make space...
assert(VRInfo.Kills[i].first != MBB && "entry should be at end!");
#endif
- assert(MBB != VRInfo.DefBlock && "Should have kill for defblock!");
+ assert(MBB != VRInfo.DefInst->getParent() &&
+ "Should have kill for defblock!");
// Add a new kill entry for this basic block.
VRInfo.Kills.push_back(std::make_pair(MBB, MI));
if (MRegisterInfo::isVirtualRegister(MO.getReg())) {
VarInfo &VRInfo = getVarInfo(MO.getReg());
- assert(VRInfo.DefBlock == 0 && "Variable multiply defined!");
- VRInfo.DefBlock = MBB; // Created here...
+ assert(VRInfo.DefInst == 0 && "Variable multiply defined!");
VRInfo.DefInst = MI;
VRInfo.Kills.push_back(std::make_pair(MBB, MI)); // Defaults to dead
} else if (MRegisterInfo::isPhysicalRegister(MO.getReg()) &&