aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Scalar/LICM.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-11-19 19:00:10 +0000
committerDan Gohman <gohman@apple.com>2009-11-19 19:00:10 +0000
commitdab249b3b762cff0ff16069b3233e4c885e75347 (patch)
tree03861743b53beec3c6cacf798f7bbfb46c0ddb78 /lib/Transforms/Scalar/LICM.cpp
parent58ce7acb4f87c3caf0f473f89220950919fba7bc (diff)
downloadexternal_llvm-dab249b3b762cff0ff16069b3233e4c885e75347.zip
external_llvm-dab249b3b762cff0ff16069b3233e4c885e75347.tar.gz
external_llvm-dab249b3b762cff0ff16069b3233e4c885e75347.tar.bz2
Enable hoisting of loads from constant memory by default. In cases where
they are lowered to instruction sequences more complex than a simple load, such that CodeGen cannot rematerialize them, a reload from a spill slot is likely to be cheaper than the complex sequence. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89374 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/LICM.cpp')
-rw-r--r--lib/Transforms/Scalar/LICM.cpp12
1 files changed, 1 insertions, 11 deletions
diff --git a/lib/Transforms/Scalar/LICM.cpp b/lib/Transforms/Scalar/LICM.cpp
index 104c873..a71b3e3 100644
--- a/lib/Transforms/Scalar/LICM.cpp
+++ b/lib/Transforms/Scalar/LICM.cpp
@@ -63,15 +63,6 @@ static cl::opt<bool>
DisablePromotion("disable-licm-promotion", cl::Hidden,
cl::desc("Disable memory promotion in LICM pass"));
-// This feature is currently disabled by default because CodeGen is not yet
-// capable of rematerializing these constants in PIC mode, so it can lead to
-// degraded performance. Compile test/CodeGen/X86/remat-constant.ll with
-// -relocation-model=pic to see an example of this.
-static cl::opt<bool>
-EnableLICMConstantMotion("enable-licm-constant-variables", cl::Hidden,
- cl::desc("Enable hoisting/sinking of constant "
- "global variables"));
-
namespace {
struct LICM : public LoopPass {
static char ID; // Pass identification, replacement for typeid
@@ -383,8 +374,7 @@ bool LICM::canSinkOrHoistInst(Instruction &I) {
// Loads from constant memory are always safe to move, even if they end up
// in the same alias set as something that ends up being modified.
- if (EnableLICMConstantMotion &&
- AA->pointsToConstantMemory(LI->getOperand(0)))
+ if (AA->pointsToConstantMemory(LI->getOperand(0)))
return true;
// Don't hoist loads which have may-aliased stores in loop.