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 | a8c2f38617ab560d72b4c8536359f3a4b62d5b5c (patch) | |
tree | 1b0a554213285558b074b942ad21233e25913ae1 /llvm/lib/CodeGen/LiveIntervalAnalysis.cpp | |
parent | 68de1ae8164b97e839741cbb95aebc30b0e3bb85 (diff) | |
download | bcm5719-llvm-a8c2f38617ab560d72b4c8536359f3a4b62d5b5c.tar.gz bcm5719-llvm-a8c2f38617ab560d72b4c8536359f3a4b62d5b5c.zip |
- Each val# can have multiple kills.
- Fix some minor bugs related to special markers on val# def. ~0U means
undefined, ~1U means dead val#.
llvm-svn: 40916
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveIntervalAnalysis.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp index c17f2ac90b9..c286a1a09db 100644 --- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/llvm/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); |