mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-19 02:25:01 +00:00
Add an option to control this heuristic tweak so I can test it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44671 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -52,6 +52,11 @@ namespace {
|
|||||||
cl::desc("Use new coalescer heuristic"),
|
cl::desc("Use new coalescer heuristic"),
|
||||||
cl::init(false));
|
cl::init(false));
|
||||||
|
|
||||||
|
static cl::opt<bool>
|
||||||
|
ReMatSpillWeight("tweak-remat-spill-weight",
|
||||||
|
cl::desc("Tweak spill weight of re-materializable intervals"),
|
||||||
|
cl::init(true));
|
||||||
|
|
||||||
RegisterPass<SimpleRegisterCoalescing>
|
RegisterPass<SimpleRegisterCoalescing>
|
||||||
X("simple-register-coalescing", "Simple Register Coalescing");
|
X("simple-register-coalescing", "Simple Register Coalescing");
|
||||||
|
|
||||||
@@ -1487,7 +1492,7 @@ bool SimpleRegisterCoalescing::runOnMachineFunction(MachineFunction &fn) {
|
|||||||
LI.weight = HUGE_VALF;
|
LI.weight = HUGE_VALF;
|
||||||
else {
|
else {
|
||||||
bool isLoad = false;
|
bool isLoad = false;
|
||||||
if (li_->isReMaterializable(LI, isLoad)) {
|
if (ReMatSpillWeight && li_->isReMaterializable(LI, isLoad)) {
|
||||||
// If all of the definitions of the interval are re-materializable,
|
// If all of the definitions of the interval are re-materializable,
|
||||||
// it is a preferred candidate for spilling. If non of the defs are
|
// it is a preferred candidate for spilling. If non of the defs are
|
||||||
// loads, then it's potentially very cheap to re-materialize.
|
// loads, then it's potentially very cheap to re-materialize.
|
||||||
|
Reference in New Issue
Block a user