[llvm-commits] [llvm] r45815 - /llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
Owen Anderson
resistor at mac.com
Wed Jan 9 19:12:56 PST 2008
Author: resistor
Date: Wed Jan 9 21:12:54 2008
New Revision: 45815
URL: http://llvm.org/viewvc/llvm-project?rev=45815&view=rev
Log:
Don't use LiveVariables::VarInfo::DefInst.
Modified:
llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=45815&r1=45814&r2=45815&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Wed Jan 9 21:12:54 2008
@@ -309,7 +309,14 @@
// 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);
More information about the llvm-commits
mailing list