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/LiveInterval.cpp | |
parent | 002fe25dd7ae240369eae70195ccf17b8921585f (diff) |
- 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/LiveInterval.cpp')
-rw-r--r-- | lib/CodeGen/LiveInterval.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/lib/CodeGen/LiveInterval.cpp b/lib/CodeGen/LiveInterval.cpp index 45c1dd03da..1aa02f0070 100644 --- a/lib/CodeGen/LiveInterval.cpp +++ b/lib/CodeGen/LiveInterval.cpp @@ -281,8 +281,7 @@ LiveInterval::FindLiveRangeContaining(unsigned Idx) { /// the intervals are not joinable, this aborts. void LiveInterval::join(LiveInterval &Other, int *LHSValNoAssignments, int *RHSValNoAssignments, - SmallVector<std::pair<unsigned, - unsigned>, 16> &NewValueNumberInfo) { + SmallVector<VNInfo, 16> &NewValueNumberInfo) { // Try to do the least amount of work possible. In particular, if there are // more liverange chunks in the other set than there are in the 'this' set, @@ -301,7 +300,8 @@ void LiveInterval::join(LiveInterval &Other, int *LHSValNoAssignments, // we want to avoid the interval scan if not. bool MustMapCurValNos = false; for (unsigned i = 0, e = getNumValNums(); i != e; ++i) { - if (ValueNumberInfo[i].first == ~2U) continue; // tombstone value # + assert(ValueNumberInfo[i].def != ~2U); + if (ValueNumberInfo[i].def == ~1U) continue; // tombstone value # if (i != (unsigned)LHSValNoAssignments[i]) { MustMapCurValNos = true; break; @@ -463,9 +463,9 @@ void LiveInterval::MergeValueNumberInto(unsigned V1, unsigned V2) { if (V1 == getNumValNums()-1) { do { ValueNumberInfo.pop_back(); - } while (ValueNumberInfo.back().first == ~1U); + } while (ValueNumberInfo.back().def == ~1U); } else { - ValueNumberInfo[V1].first = ~1U; + ValueNumberInfo[V1].def = ~1U; } } @@ -507,10 +507,15 @@ void LiveInterval::print(std::ostream &OS, const MRegisterInfo *MRI) const { for (unsigned i = 0; i != getNumValNums(); ++i) { if (i) OS << " "; OS << i << "@"; - if (ValueNumberInfo[i].first == ~0U) { + if (ValueNumberInfo[i].def == ~0U) { OS << "?"; } else { - OS << ValueNumberInfo[i].first; + OS << ValueNumberInfo[i].def; + } + if (ValueNumberInfo[i].kill == ~0U) { + OS << ",?"; + } else { + OS << "," << ValueNumberInfo[i].kill; } } } |