mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-14 14:24:05 +00:00
Separate SplitAnalysis::getSplitLoops().
This method returns the set of loops with uses that are candidates for splitting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121870 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -257,12 +257,11 @@ void SplitAnalysis::analyze(const LiveInterval *li) {
|
|||||||
analyzeUses();
|
analyzeUses();
|
||||||
}
|
}
|
||||||
|
|
||||||
const MachineLoop *SplitAnalysis::getBestSplitLoop() {
|
void SplitAnalysis::getSplitLoops(LoopPtrSet &Loops) {
|
||||||
assert(curli_ && "Call analyze() before getBestSplitLoop");
|
assert(curli_ && "Call analyze() before getSplitLoops");
|
||||||
if (usingLoops_.empty())
|
if (usingLoops_.empty())
|
||||||
return 0;
|
return;
|
||||||
|
|
||||||
LoopPtrSet Loops;
|
|
||||||
LoopBlocks Blocks;
|
LoopBlocks Blocks;
|
||||||
BlockPtrSet CriticalExits;
|
BlockPtrSet CriticalExits;
|
||||||
|
|
||||||
@ -280,11 +279,11 @@ const MachineLoop *SplitAnalysis::getBestSplitLoop() {
|
|||||||
// FIXME: We could split a live range with multiple uses in a peripheral
|
// FIXME: We could split a live range with multiple uses in a peripheral
|
||||||
// block and still make progress. However, it is possible that splitting
|
// block and still make progress. However, it is possible that splitting
|
||||||
// another live range will insert copies into a peripheral block, and
|
// another live range will insert copies into a peripheral block, and
|
||||||
// there is a small chance we can enter an infinity loop, inserting copies
|
// there is a small chance we can enter an infinite loop, inserting copies
|
||||||
// forever.
|
// forever.
|
||||||
// For safety, stick to splitting live ranges with uses outside the
|
// For safety, stick to splitting live ranges with uses outside the
|
||||||
// periphery.
|
// periphery.
|
||||||
DEBUG(dbgs() << ": multiple peripheral uses\n");
|
DEBUG(dbgs() << ": multiple peripheral uses");
|
||||||
break;
|
break;
|
||||||
case ContainedInLoop:
|
case ContainedInLoop:
|
||||||
DEBUG(dbgs() << ": fully contained\n");
|
DEBUG(dbgs() << ": fully contained\n");
|
||||||
@ -302,9 +301,13 @@ const MachineLoop *SplitAnalysis::getBestSplitLoop() {
|
|||||||
Loops.insert(Loop);
|
Loops.insert(Loop);
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG(dbgs() << " getBestSplitLoop found " << Loops.size()
|
DEBUG(dbgs() << " getSplitLoops found " << Loops.size()
|
||||||
<< " candidate loops.\n");
|
<< " candidate loops.\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
const MachineLoop *SplitAnalysis::getBestSplitLoop() {
|
||||||
|
LoopPtrSet Loops;
|
||||||
|
getSplitLoops(Loops);
|
||||||
if (Loops.empty())
|
if (Loops.empty())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -133,6 +133,10 @@ public:
|
|||||||
/// these edges, but they do require special treatment.
|
/// these edges, but they do require special treatment.
|
||||||
void getCriticalPreds(const LoopBlocks &Blocks, BlockPtrSet &CriticalPreds);
|
void getCriticalPreds(const LoopBlocks &Blocks, BlockPtrSet &CriticalPreds);
|
||||||
|
|
||||||
|
/// getSplitLoops - Get the set of loops that have curli uses and would be
|
||||||
|
/// profitable to split.
|
||||||
|
void getSplitLoops(LoopPtrSet&);
|
||||||
|
|
||||||
/// getBestSplitLoop - Return the loop where curli may best be split to a
|
/// getBestSplitLoop - Return the loop where curli may best be split to a
|
||||||
/// separate register, or NULL.
|
/// separate register, or NULL.
|
||||||
const MachineLoop *getBestSplitLoop();
|
const MachineLoop *getBestSplitLoop();
|
||||||
|
Reference in New Issue
Block a user