mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-14 09:38:40 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124812 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
207c868c92
commit
08eb8dd616
@ -607,14 +607,14 @@ VNInfo *LiveIntervalMap::mapValue(const VNInfo *ParentVNI, SlotIndex Idx,
|
|||||||
for (unsigned i = 0, e = LiveIn.size(); i != e; ++i) {
|
for (unsigned i = 0, e = LiveIn.size(); i != e; ++i) {
|
||||||
MachineBasicBlock *MBB = LiveIn[i]->getBlock();
|
MachineBasicBlock *MBB = LiveIn[i]->getBlock();
|
||||||
SlotIndex Start = LIS.getMBBStartIdx(MBB);
|
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;
|
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;
|
return IdxVNI;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user