diff options
author | Owen Anderson <resistor@mac.com> | 2008-01-10 03:12:54 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2008-01-10 03:12:54 +0000 |
commit | d445b8813fb8bf13d0aad890dfa1cb867400c68c (patch) | |
tree | 2ebfb996ba77746b1b72af110a85fd73f39f568c /llvm/lib/CodeGen/LiveIntervalAnalysis.cpp | |
parent | 0f8c7c4a73a0582a2393c6b21e6f7849442ee286 (diff) | |
download | bcm5719-llvm-d445b8813fb8bf13d0aad890dfa1cb867400c68c.tar.gz bcm5719-llvm-d445b8813fb8bf13d0aad890dfa1cb867400c68c.zip |
Don't use LiveVariables::VarInfo::DefInst.
llvm-svn: 45815
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveIntervalAnalysis.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp index 80d3547e4b4..b4f50e19291 100644 --- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -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); |