diff options
author | Owen Anderson <resistor@mac.com> | 2008-07-30 17:42:47 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2008-07-30 17:42:47 +0000 |
commit | 912923925f790427a77781b8a0469fa832c7740d (patch) | |
tree | 4c1b178c81e4254596928f2d605f31e713bdd6d4 /lib/CodeGen/LiveIntervalAnalysis.cpp | |
parent | 4b877ca1c5f13f19c9b7c8142a4f7a23383b8b6a (diff) |
Value numbers whose def index is a special sentinel value should not be remapped.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54218 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r-- | lib/CodeGen/LiveIntervalAnalysis.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index b557b703cc..fba4416666 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -176,19 +176,22 @@ void LiveIntervals::computeNumbering() { // Remap the VNInfo def index, which works the same as the // start indices above. VNInfo* vni = LI->valno; - index = vni->def / InstrSlots::NUM; - offset = vni->def % InstrSlots::NUM; - if (offset == InstrSlots::LOAD) { - std::vector<IdxMBBPair>::const_iterator I = + + // VN's with special sentinel defs don't need to be remapped. + if (vni->def != ~0U && vni->def != ~1U) { + index = vni->def / InstrSlots::NUM; + offset = vni->def % InstrSlots::NUM; + if (offset == InstrSlots::LOAD) { + std::vector<IdxMBBPair>::const_iterator I = std::lower_bound(OldI2MBB.begin(), OldI2MBB.end(), vni->def); - // Take the pair containing the index - std::vector<IdxMBBPair>::const_iterator J = + // Take the pair containing the index + std::vector<IdxMBBPair>::const_iterator J = (I == OldI2MBB.end() && OldI2MBB.size()>0) ? (I-1): I; - vni->def = getMBBStartIdx(J->second); - - } else { - vni->def = mi2iMap_[OldI2MI[index]] + offset; + vni->def = getMBBStartIdx(J->second); + } else { + vni->def = mi2iMap_[OldI2MI[index]] + offset; + } } // Remap the VNInfo kill indices, which works the same as @@ -207,7 +210,6 @@ void LiveIntervals::computeNumbering() { vni->kills[i] = getMBBEndIdx(I->second) + 1; } else { unsigned idx = index; - while (!OldI2MI[index]) ++index; while (index < OldI2MI.size() && !OldI2MI[index]) ++index; if (index != OldI2MI.size()) |