mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
Run proper recursive dead code elimination during coalescing.
Dead copies cause problems because they are trivial to coalesce, but removing them gived the live range a dangling end point. This patch enables full dead code elimination which trims live ranges to their uses so end points don't dangle. DCE may erase multiple instructions. Put the pointers in an ErasedInstrs set so we never risk visiting erased instructions in the work list. There isn't supposed to be any dead copies entering RegisterCoalescer, but they do slip by as evidenced by test/CodeGen/X86/coalescer-dce.ll. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157101 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -681,7 +681,10 @@ void ConnectedVNInfoEqClasses::Distribute(LiveInterval *LIV[],
|
||||
SlotIndex Idx = LIS.getInstructionIndex(MI);
|
||||
Idx = Idx.getRegSlot(MO.isUse());
|
||||
const VNInfo *VNI = LI.getVNInfoAt(Idx);
|
||||
assert(VNI && "Interval not live at use.");
|
||||
// FIXME: We should be able to assert(VNI) here, but the coalescer leaves
|
||||
// dangling defs around.
|
||||
if (!VNI)
|
||||
continue;
|
||||
MO.setReg(LIV[getEqClass(VNI)]->reg);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user