Don't use LiveVariables::VarInfo::DefInst.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45815 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Owen Anderson 2008-01-10 03:12:54 +00:00
parent 9c9cec4372
commit c95f075c43

View File

@ -309,7 +309,14 @@ void LiveIntervals::handleVirtualRegisterDef(MachineBasicBlock *mbb,
// are actually two values in the live interval. Because of this we
// need to take the LiveRegion that defines this register and split it
// into two values.
unsigned DefIndex = getDefIndex(getInstructionIndex(vi.DefInst));
MachineRegisterInfo& MRI = mbb->getParent()->getRegInfo();
unsigned lowIndex = ~0U;
for (MachineRegisterInfo::def_iterator DI = MRI.def_begin(interval.reg),
DE = MRI.def_end(); DI != DE; ++DI)
if (getInstructionIndex(&*DI) < lowIndex)
lowIndex = getInstructionIndex(&*DI);
unsigned DefIndex = getDefIndex(lowIndex);
unsigned RedefIndex = getDefIndex(MIIdx);
const LiveRange *OldLR = interval.getLiveRangeContaining(RedefIndex-1);