mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Fix bug in SplitEditor::splitLiveThroughBlock when switching registers.
If there is no interference and no last split point, we cannot enterIntvBefore(Stop) - that function needs a real instruction. Use enterIntvAtEnd instead for that very easy case. This code doesn't currently run, it is needed by multi-way splitting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135846 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1149,6 +1149,12 @@ void SplitEditor::splitLiveThroughBlock(unsigned MBBNum,
|
|||||||
|
|
||||||
assert((IntvIn || IntvOut) && "Use splitSingleBlock for isolated blocks");
|
assert((IntvIn || IntvOut) && "Use splitSingleBlock for isolated blocks");
|
||||||
|
|
||||||
|
assert((!LeaveBefore || LeaveBefore < Stop) && "Interference after block");
|
||||||
|
assert((!IntvIn || !LeaveBefore || LeaveBefore > Start) && "Impossible intf");
|
||||||
|
assert((!EnterAfter || EnterAfter >= Start) && "Interference before block");
|
||||||
|
|
||||||
|
MachineBasicBlock *MBB = VRM.getMachineFunction().getBlockNumbered(MBBNum);
|
||||||
|
|
||||||
if (!IntvOut) {
|
if (!IntvOut) {
|
||||||
DEBUG(dbgs() << ", spill on entry.\n");
|
DEBUG(dbgs() << ", spill on entry.\n");
|
||||||
//
|
//
|
||||||
@@ -1157,7 +1163,6 @@ void SplitEditor::splitLiveThroughBlock(unsigned MBBNum,
|
|||||||
// -____________ Spill on entry.
|
// -____________ Spill on entry.
|
||||||
//
|
//
|
||||||
selectIntv(IntvIn);
|
selectIntv(IntvIn);
|
||||||
MachineBasicBlock *MBB = VRM.getMachineFunction().getBlockNumbered(MBBNum);
|
|
||||||
SlotIndex Idx = leaveIntvAtTop(*MBB);
|
SlotIndex Idx = leaveIntvAtTop(*MBB);
|
||||||
assert((!LeaveBefore || Idx <= LeaveBefore) && "Interference");
|
assert((!LeaveBefore || Idx <= LeaveBefore) && "Interference");
|
||||||
(void)Idx;
|
(void)Idx;
|
||||||
@@ -1172,7 +1177,6 @@ void SplitEditor::splitLiveThroughBlock(unsigned MBBNum,
|
|||||||
// ___________-- Reload on exit.
|
// ___________-- Reload on exit.
|
||||||
//
|
//
|
||||||
selectIntv(IntvOut);
|
selectIntv(IntvOut);
|
||||||
MachineBasicBlock *MBB = VRM.getMachineFunction().getBlockNumbered(MBBNum);
|
|
||||||
SlotIndex Idx = enterIntvAtEnd(*MBB);
|
SlotIndex Idx = enterIntvAtEnd(*MBB);
|
||||||
assert((!EnterAfter || Idx >= EnterAfter) && "Interference");
|
assert((!EnterAfter || Idx >= EnterAfter) && "Interference");
|
||||||
(void)Idx;
|
(void)Idx;
|
||||||
@@ -1192,6 +1196,7 @@ void SplitEditor::splitLiveThroughBlock(unsigned MBBNum,
|
|||||||
|
|
||||||
// We cannot legally insert splits after LSP.
|
// We cannot legally insert splits after LSP.
|
||||||
SlotIndex LSP = SA.getLastSplitPoint(MBBNum);
|
SlotIndex LSP = SA.getLastSplitPoint(MBBNum);
|
||||||
|
assert((!IntvOut || !EnterAfter || EnterAfter < LSP) && "Impossible intf");
|
||||||
|
|
||||||
if (IntvIn != IntvOut && (!LeaveBefore || !EnterAfter ||
|
if (IntvIn != IntvOut && (!LeaveBefore || !EnterAfter ||
|
||||||
LeaveBefore.getBaseIndex() > EnterAfter.getBoundaryIndex())) {
|
LeaveBefore.getBaseIndex() > EnterAfter.getBoundaryIndex())) {
|
||||||
@@ -1201,10 +1206,14 @@ void SplitEditor::splitLiveThroughBlock(unsigned MBBNum,
|
|||||||
// |-----------| Live through.
|
// |-----------| Live through.
|
||||||
// ------======= Switch intervals between interference.
|
// ------======= Switch intervals between interference.
|
||||||
//
|
//
|
||||||
SlotIndex Cut = (LeaveBefore && LeaveBefore < LSP) ? LeaveBefore : LSP;
|
|
||||||
selectIntv(IntvOut);
|
selectIntv(IntvOut);
|
||||||
SlotIndex Idx = enterIntvBefore(Cut);
|
SlotIndex Idx;
|
||||||
useIntv(Idx, Stop);
|
if (LeaveBefore && LeaveBefore < LSP) {
|
||||||
|
Idx = enterIntvBefore(LeaveBefore);
|
||||||
|
useIntv(Idx, Stop);
|
||||||
|
} else {
|
||||||
|
Idx = enterIntvAtEnd(*MBB);
|
||||||
|
}
|
||||||
selectIntv(IntvIn);
|
selectIntv(IntvIn);
|
||||||
useIntv(Start, Idx);
|
useIntv(Start, Idx);
|
||||||
assert((!LeaveBefore || Idx <= LeaveBefore) && "Interference");
|
assert((!LeaveBefore || Idx <= LeaveBefore) && "Interference");
|
||||||
|
Reference in New Issue
Block a user