diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-01-10 08:22:10 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-01-10 08:22:10 +0000 |
commit | 06701fc8dde2dade519a998975f91cb9abc55dd6 (patch) | |
tree | 179af9ac4ff6041dfb24fe0603347183552715b6 /lib/CodeGen/LiveIntervalAnalysis.cpp | |
parent | c90ee9cfaee8873af5c8d28566c7e699a2cdb242 (diff) | |
download | external_llvm-06701fc8dde2dade519a998975f91cb9abc55dd6.zip external_llvm-06701fc8dde2dade519a998975f91cb9abc55dd6.tar.gz external_llvm-06701fc8dde2dade519a998975f91cb9abc55dd6.tar.bz2 |
Simplify some code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45830 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r-- | lib/CodeGen/LiveIntervalAnalysis.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index b4f50e1..8092040 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -309,14 +309,8 @@ 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. - 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); + assert(interval.containsOneValue()); + unsigned DefIndex = getDefIndex(interval.getValNumInfo(0)->def); unsigned RedefIndex = getDefIndex(MIIdx); const LiveRange *OldLR = interval.getLiveRangeContaining(RedefIndex-1); |