diff options
| author | Dan Gohman <gohman@apple.com> | 2009-11-19 19:00:10 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2009-11-19 19:00:10 +0000 |
| commit | cbc6ebb6fd4e1a218d21cdad75dc012d43be2b93 (patch) | |
| tree | 5bd4ce70e12a56448e687159f896ef4cbcb7bf52 /llvm/lib/Transforms | |
| parent | 5d26212f6bc66ffc1bec74fd053c06265f2e79aa (diff) | |
| download | bcm5719-llvm-cbc6ebb6fd4e1a218d21cdad75dc012d43be2b93.tar.gz bcm5719-llvm-cbc6ebb6fd4e1a218d21cdad75dc012d43be2b93.zip | |
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.
llvm-svn: 89374
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/LICM.cpp | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp index 104c8739c0e..a71b3e31e26 100644 --- a/llvm/lib/Transforms/Scalar/LICM.cpp +++ b/llvm/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. |

