diff options
| author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-02-03 20:29:36 +0000 |
|---|---|---|
| committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-02-03 20:29:36 +0000 |
| commit | 8c0254870b646dc55a57e7c9a49beeb5ecdfba2b (patch) | |
| tree | 49811807dba4b401f5fe9ce4a434b24120e74aba /llvm/lib | |
| parent | eb5cfe4f2b721392eae83914a28bbafbda25e49b (diff) | |
| download | bcm5719-llvm-8c0254870b646dc55a57e7c9a49beeb5ecdfba2b.tar.gz bcm5719-llvm-8c0254870b646dc55a57e7c9a49beeb5ecdfba2b.zip | |
Fix coloring bug when mapping values in the middle of a live-through block.
If the found value is not live-through the block, we should only add liveness up
to the requested slot index. When the value is live-through, the whole block
should be colored.
Bug found by SSA verification in the machine code verifier.
llvm-svn: 124812
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/SplitKit.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/SplitKit.cpp b/llvm/lib/CodeGen/SplitKit.cpp index a1c9ced332c..8bd62800e02 100644 --- a/llvm/lib/CodeGen/SplitKit.cpp +++ b/llvm/lib/CodeGen/SplitKit.cpp @@ -607,14 +607,14 @@ VNInfo *LiveIntervalMap::mapValue(const VNInfo *ParentVNI, SlotIndex Idx, for (unsigned i = 0, e = LiveIn.size(); i != e; ++i) { MachineBasicBlock *MBB = LiveIn[i]->getBlock(); SlotIndex Start = LIS.getMBBStartIdx(MBB); - if (MBB == IdxMBB) { - LI->addRange(LiveRange(Start, Idx.getNextSlot(), IdxVNI)); - continue; - } - // Anything in LiveIn other than IdxMBB is live-through. VNInfo *VNI = LiveOutCache.lookup(MBB).first; - assert(VNI && "Missing block value"); - LI->addRange(LiveRange(Start, LIS.getMBBEndIdx(MBB), VNI)); + + // Anything in LiveIn other than IdxMBB is live-through. + // In IdxMBB, we should stop at Idx unless the same value is live-out. + if (MBB == IdxMBB && IdxVNI != VNI) + LI->addRange(LiveRange(Start, Idx.getNextSlot(), IdxVNI)); + else + LI->addRange(LiveRange(Start, LIS.getMBBEndIdx(MBB), VNI)); } return IdxVNI; |

