diff options
author | Evan Cheng <evan.cheng@apple.com> | 2007-08-07 23:49:57 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2007-08-07 23:49:57 +0000 |
commit | a8d94f1315f722de056af03763664b77a5baac26 (patch) | |
tree | 0d6df32277e39c84a3e18c7c0bfdb8a46da98258 /lib/CodeGen/LiveIntervalAnalysis.cpp | |
parent | 002fe25dd7ae240369eae70195ccf17b8921585f (diff) | |
download | external_llvm-a8d94f1315f722de056af03763664b77a5baac26.zip external_llvm-a8d94f1315f722de056af03763664b77a5baac26.tar.gz external_llvm-a8d94f1315f722de056af03763664b77a5baac26.tar.bz2 |
- LiveInterval value#'s now have 3 components: def instruction #,
kill instruction #, and source register number (iff the value# is defined by a
copy).
- Now def instruction # is set for every value#, not just for copy defined ones.
- Update some outdated code related inactive live ranges.
- Kill info not yet set. That's next patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40913 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r-- | lib/CodeGen/LiveIntervalAnalysis.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index 369493f..c17f2ac 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -351,7 +351,7 @@ void LiveIntervals::handleVirtualRegisterDef(MachineBasicBlock *mbb, unsigned ValNum; unsigned SrcReg, DstReg; if (!tii_->isMoveInstr(*mi, SrcReg, DstReg)) - ValNum = interval.getNextValue(~0U, 0); + ValNum = interval.getNextValue(defIndex, 0); else ValNum = interval.getNextValue(defIndex, SrcReg); @@ -450,7 +450,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, std::make_pair(~0U, 0U)); + interval.setValueNumberInfo(0, LiveInterval::VNInfo(DefIndex, ~0U, 0U)); // Add the new live interval which replaces the range for the input copy. LiveRange LR(DefIndex, RedefIndex, ValNo); @@ -484,7 +484,7 @@ void LiveIntervals::handleVirtualRegisterDef(MachineBasicBlock *mbb, // Replace the interval with one of a NEW value number. Note that this // value number isn't actually defined by an instruction, weird huh? :) - LiveRange LR(Start, End, interval.getNextValue(~0U, 0)); + LiveRange LR(Start, End, interval.getNextValue(~0, 0)); DOUT << " replace range with " << LR; interval.addRange(LR); DOUT << " RESULT: "; interval.print(DOUT, mri_); @@ -498,7 +498,7 @@ void LiveIntervals::handleVirtualRegisterDef(MachineBasicBlock *mbb, unsigned ValNum; unsigned SrcReg, DstReg; if (!tii_->isMoveInstr(*mi, SrcReg, DstReg)) - ValNum = interval.getNextValue(~0U, 0); + ValNum = interval.getNextValue(defIndex, 0); else ValNum = interval.getNextValue(defIndex, SrcReg); @@ -566,8 +566,7 @@ exit: // Already exists? Extend old live interval. LiveInterval::iterator OldLR = interval.FindLiveRangeContaining(start); unsigned Id = (OldLR != interval.end()) - ? OldLR->ValId - : interval.getNextValue(SrcReg != 0 ? start : ~0U, SrcReg); + ? OldLR->ValId : interval.getNextValue(start, SrcReg); LiveRange LR(start, end, Id); interval.addRange(LR); DOUT << " +" << LR << '\n'; @@ -634,7 +633,7 @@ exit: } } - LiveRange LR(start, end, interval.getNextValue(~0U, 0)); + LiveRange LR(start, end, interval.getNextValue(start, 0)); DOUT << " +" << LR << '\n'; interval.addRange(LR); } |