diff options
author | Evan Cheng <evan.cheng@apple.com> | 2007-08-08 03:00:28 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2007-08-08 03:00:28 +0000 |
commit | 8df786012dc6b875f31ba4152e09c6e0098082ee (patch) | |
tree | 3d88de0b43d1ef6287f9273c4b54c5aeee429d0b /lib/CodeGen/LiveIntervalAnalysis.cpp | |
parent | 6a2bfdaab62db8737bf54a8429da3cb8fbdfff62 (diff) | |
download | external_llvm-8df786012dc6b875f31ba4152e09c6e0098082ee.zip external_llvm-8df786012dc6b875f31ba4152e09c6e0098082ee.tar.gz external_llvm-8df786012dc6b875f31ba4152e09c6e0098082ee.tar.bz2 |
- Each val# can have multiple kills.
- Fix some minor bugs related to special markers on val# def. ~0U means
undefined, ~1U means dead val#.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40916 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r-- | lib/CodeGen/LiveIntervalAnalysis.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index c17f2ac..c286a1a 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -347,7 +347,6 @@ void LiveIntervals::handleVirtualRegisterDef(MachineBasicBlock *mbb, // Get the Idx of the defining instructions. unsigned defIndex = getDefIndex(MIIdx); - unsigned ValNum; unsigned SrcReg, DstReg; if (!tii_->isMoveInstr(*mi, SrcReg, DstReg)) @@ -378,6 +377,7 @@ void LiveIntervals::handleVirtualRegisterDef(MachineBasicBlock *mbb, LiveRange LR(defIndex, killIdx, ValNum); interval.addRange(LR); DOUT << " +" << LR << "\n"; + interval.addKillForValNum(ValNum, killIdx); return; } } @@ -412,10 +412,11 @@ void LiveIntervals::handleVirtualRegisterDef(MachineBasicBlock *mbb, // block to the 'use' slot of the killing instruction. for (unsigned i = 0, e = vi.Kills.size(); i != e; ++i) { MachineInstr *Kill = vi.Kills[i]; + unsigned killIdx = getUseIndex(getInstructionIndex(Kill))+1; LiveRange LR(getMBBStartIdx(Kill->getParent()), - getUseIndex(getInstructionIndex(Kill))+1, - ValNum); + killIdx, ValNum); interval.addRange(LR); + interval.addKillForValNum(ValNum, killIdx); DOUT << " +" << LR; } @@ -450,7 +451,7 @@ void LiveIntervals::handleVirtualRegisterDef(MachineBasicBlock *mbb, interval.setValueNumberInfo(1, interval.getValNumInfo(0)); // Value#0 is now defined by the 2-addr instruction. - interval.setValueNumberInfo(0, LiveInterval::VNInfo(DefIndex, ~0U, 0U)); + interval.setValueNumberInfo(0, LiveInterval::VNInfo(DefIndex, 0U)); // Add the new live interval which replaces the range for the input copy. LiveRange LR(DefIndex, RedefIndex, ValNo); |