From: Evan Cheng Date: Fri, 7 Dec 2007 00:28:32 +0000 (+0000) Subject: Add an option to control this heuristic tweak so I can test it. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=dfb156143489e7d16e6b034d6e535fe97eafbb9c;p=oota-llvm.git 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 --- diff --git a/lib/CodeGen/SimpleRegisterCoalescing.cpp b/lib/CodeGen/SimpleRegisterCoalescing.cpp index 6eec5ab885c..7252f66ba04 100644 --- a/lib/CodeGen/SimpleRegisterCoalescing.cpp +++ b/lib/CodeGen/SimpleRegisterCoalescing.cpp @@ -52,6 +52,11 @@ namespace { cl::desc("Use new coalescer heuristic"), cl::init(false)); + static cl::opt + ReMatSpillWeight("tweak-remat-spill-weight", + cl::desc("Tweak spill weight of re-materializable intervals"), + cl::init(true)); + RegisterPass X("simple-register-coalescing", "Simple Register Coalescing"); @@ -1487,7 +1492,7 @@ bool SimpleRegisterCoalescing::runOnMachineFunction(MachineFunction &fn) { LI.weight = HUGE_VALF; else { 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, // it is a preferred candidate for spilling. If non of the defs are // loads, then it's potentially very cheap to re-materialize.