mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-20 16:17:38 +00:00
Add SplitEditor::overlapIntv() to create small ranges where both registers are live.
If a live range is used by a terminator instruction, and that live range needs to leave the block on the stack or in a different register, it can be necessary to have both sides of the split live at the terminator instruction. Example: %vreg2 = COPY %vreg1 JMP %vreg1 Becomes after spilling %vreg2: SPILL %vreg1 JMP %vreg1 The spill doesn't kill the register as is normally the case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125102 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -882,6 +882,22 @@ SlotIndex SplitEditor::leaveIntvAtTop(MachineBasicBlock &MBB) {
|
||||
return VNI->def;
|
||||
}
|
||||
|
||||
void SplitEditor::overlapIntv(SlotIndex Start, SlotIndex End) {
|
||||
assert(OpenIdx && "openIntv not called before overlapIntv");
|
||||
assert(Edit.getParent().getVNInfoAt(Start) ==
|
||||
Edit.getParent().getVNInfoAt(End.getPrevSlot()) &&
|
||||
"Parent changes value in extended range");
|
||||
assert(Edit.get(0)->getVNInfoAt(Start) && "Start must come from leaveIntv*");
|
||||
assert(LIS.getMBBFromIndex(Start) == LIS.getMBBFromIndex(End) &&
|
||||
"Range cannot span basic blocks");
|
||||
|
||||
// Treat this as useIntv() for now. The complement interval will be extended
|
||||
// as needed by mapValue().
|
||||
DEBUG(dbgs() << " overlapIntv [" << Start << ';' << End << "):");
|
||||
RegAssign.insert(Start, End, OpenIdx);
|
||||
DEBUG(dump());
|
||||
}
|
||||
|
||||
/// closeIntv - Indicate that we are done editing the currently open
|
||||
/// LiveInterval, and ranges can be trimmed.
|
||||
void SplitEditor::closeIntv() {
|
||||
|
||||
Reference in New Issue
Block a user