mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-23 17:28:54 +00:00
Enable improved spilling costs by default. This speeds up viterbi on x86
by 40%, FreeBench/fourinarow by 20%, and many other programs 10-25%. On PPC, this speeds up fourinarow by 18%, and probably other things as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31504 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -59,9 +59,6 @@ namespace {
|
|||||||
EnableJoining("join-liveintervals",
|
EnableJoining("join-liveintervals",
|
||||||
cl::desc("Coallesce copies (default=true)"),
|
cl::desc("Coallesce copies (default=true)"),
|
||||||
cl::init(true));
|
cl::init(true));
|
||||||
static cl::opt<bool>
|
|
||||||
EnableReweight("enable-majik-f00");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LiveIntervals::getAnalysisUsage(AnalysisUsage &AU) const {
|
void LiveIntervals::getAnalysisUsage(AnalysisUsage &AU) const {
|
||||||
@@ -221,16 +218,14 @@ bool LiveIntervals::runOnMachineFunction(MachineFunction &fn) {
|
|||||||
if (isZeroLengthInterval(&LI))
|
if (isZeroLengthInterval(&LI))
|
||||||
LI.weight = HUGE_VALF;
|
LI.weight = HUGE_VALF;
|
||||||
|
|
||||||
if (EnableReweight) {
|
// Divide the weight of the interval by its size. This encourages
|
||||||
// Divide the weight of the interval by its size. This encourages
|
// spilling of intervals that are large and have few uses, and
|
||||||
// spilling of intervals that are large and have few uses, and
|
// discourages spilling of small intervals with many uses.
|
||||||
// discourages spilling of small intervals with many uses.
|
unsigned Size = 0;
|
||||||
unsigned Size = 0;
|
for (LiveInterval::iterator II = LI.begin(), E = LI.end(); II != E;++II)
|
||||||
for (LiveInterval::iterator II = LI.begin(), E = LI.end(); II != E;++II)
|
Size += II->end - II->start;
|
||||||
Size += II->end - II->start;
|
|
||||||
|
|
||||||
LI.weight /= Size;
|
LI.weight /= Size;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user