mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-20 16:17:38 +00:00
Add RAGreedy methods for splitting live ranges around regions.
Analyze the live range's behavior entering and leaving basic blocks. Compute an interference pattern for each allocation candidate, and use SpillPlacement to find an optimal region where that register can be live. This code is still not enabled. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123774 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -48,6 +48,7 @@ SplitAnalysis::SplitAnalysis(const MachineFunction &mf,
|
||||
curli_(0) {}
|
||||
|
||||
void SplitAnalysis::clear() {
|
||||
UseSlots.clear();
|
||||
usingInstrs_.clear();
|
||||
usingBlocks_.clear();
|
||||
usingLoops_.clear();
|
||||
@@ -67,6 +68,7 @@ void SplitAnalysis::analyzeUses() {
|
||||
MachineInstr *MI = I.skipInstruction();) {
|
||||
if (MI->isDebugValue() || !usingInstrs_.insert(MI))
|
||||
continue;
|
||||
UseSlots.push_back(lis_.getInstructionIndex(MI).getDefIndex());
|
||||
MachineBasicBlock *MBB = MI->getParent();
|
||||
if (usingBlocks_[MBB]++)
|
||||
continue;
|
||||
@@ -74,6 +76,7 @@ void SplitAnalysis::analyzeUses() {
|
||||
Loop = Loop->getParentLoop())
|
||||
usingLoops_[Loop]++;
|
||||
}
|
||||
array_pod_sort(UseSlots.begin(), UseSlots.end());
|
||||
DEBUG(dbgs() << " counted "
|
||||
<< usingInstrs_.size() << " instrs, "
|
||||
<< usingBlocks_.size() << " blocks, "
|
||||
|
||||
Reference in New Issue
Block a user