mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-13 23:26:25 +00:00
Add blocks to the LiveIntervalAnalysis RegMaskBlocks array when splitting
a critical edge. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174936 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -214,6 +214,13 @@ namespace llvm {
|
|||||||
return Indexes->getMBBFromIndex(index);
|
return Indexes->getMBBFromIndex(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void insertMBBInMaps(MachineBasicBlock *MBB) {
|
||||||
|
Indexes->insertMBBInMaps(MBB);
|
||||||
|
assert(unsigned(MBB->getNumber()) == RegMaskBlocks.size() &&
|
||||||
|
"Blocks must be added in order.");
|
||||||
|
RegMaskBlocks.push_back(std::make_pair(MBB->getNumber(), 0));
|
||||||
|
}
|
||||||
|
|
||||||
SlotIndex InsertMachineInstrInMaps(MachineInstr *MI) {
|
SlotIndex InsertMachineInstrInMaps(MachineInstr *MI) {
|
||||||
return Indexes->insertMachineInstrInMaps(MI);
|
return Indexes->insertMachineInstrInMaps(MI);
|
||||||
}
|
}
|
||||||
|
@@ -664,8 +664,12 @@ MachineBasicBlock::SplitCriticalEdge(MachineBasicBlock *Succ, Pass *P) {
|
|||||||
" BB#" << getNumber()
|
" BB#" << getNumber()
|
||||||
<< " -- BB#" << NMBB->getNumber()
|
<< " -- BB#" << NMBB->getNumber()
|
||||||
<< " -- BB#" << Succ->getNumber() << '\n');
|
<< " -- BB#" << Succ->getNumber() << '\n');
|
||||||
|
|
||||||
|
LiveIntervals *LIS = P->getAnalysisIfAvailable<LiveIntervals>();
|
||||||
SlotIndexes *Indexes = P->getAnalysisIfAvailable<SlotIndexes>();
|
SlotIndexes *Indexes = P->getAnalysisIfAvailable<SlotIndexes>();
|
||||||
if (Indexes)
|
if (LIS)
|
||||||
|
LIS->insertMBBInMaps(NMBB);
|
||||||
|
else if (Indexes)
|
||||||
Indexes->insertMBBInMaps(NMBB);
|
Indexes->insertMBBInMaps(NMBB);
|
||||||
|
|
||||||
// On some targets like Mips, branches may kill virtual registers. Make sure
|
// On some targets like Mips, branches may kill virtual registers. Make sure
|
||||||
@@ -771,7 +775,7 @@ MachineBasicBlock::SplitCriticalEdge(MachineBasicBlock *Succ, Pass *P) {
|
|||||||
LV->addNewBlock(NMBB, this, Succ);
|
LV->addNewBlock(NMBB, this, Succ);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LiveIntervals *LIS = P->getAnalysisIfAvailable<LiveIntervals>()) {
|
if (LIS) {
|
||||||
// After splitting the edge and updating SlotIndexes, live intervals may be
|
// After splitting the edge and updating SlotIndexes, live intervals may be
|
||||||
// in one of two situations, depending on whether this block was the last in
|
// in one of two situations, depending on whether this block was the last in
|
||||||
// the function. If the original block was the last in the function, all live
|
// the function. If the original block was the last in the function, all live
|
||||||
|
Reference in New Issue
Block a user