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 | c95f075c43488234e44b1213dfd762ae0a7509ea (patch) | |
| tree | 513b3e1167c10a8e8d10c7c805eb7f76bedd4982 /lib/CodeGen | |
| parent | 9c9cec4372712a3a6be43f484d914c786a5a7dc6 (diff) | |
| download | external_llvm-c95f075c43488234e44b1213dfd762ae0a7509ea.zip external_llvm-c95f075c43488234e44b1213dfd762ae0a7509ea.tar.gz external_llvm-c95f075c43488234e44b1213dfd762ae0a7509ea.tar.bz2 | |
Don't use LiveVariables::VarInfo::DefInst.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45815 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
| -rw-r--r-- | lib/CodeGen/LiveIntervalAnalysis.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index 80d3547..b4f50e1 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/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); |
