diff options
Diffstat (limited to 'lib/Transforms/Scalar/LICM.cpp')
-rw-r--r-- | lib/Transforms/Scalar/LICM.cpp | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/lib/Transforms/Scalar/LICM.cpp b/lib/Transforms/Scalar/LICM.cpp index 104c8739c0e3..5511387c8da4 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. @@ -603,7 +593,7 @@ void LICM::sink(Instruction &I) { if (AI) { std::vector<AllocaInst*> Allocas; Allocas.push_back(AI); - PromoteMemToReg(Allocas, *DT, *DF, AI->getContext(), CurAST); + PromoteMemToReg(Allocas, *DT, *DF, CurAST); } } } @@ -779,7 +769,7 @@ void LICM::PromoteValuesInLoop() { PromotedAllocas.reserve(PromotedValues.size()); for (unsigned i = 0, e = PromotedValues.size(); i != e; ++i) PromotedAllocas.push_back(PromotedValues[i].first); - PromoteMemToReg(PromotedAllocas, *DT, *DF, Preheader->getContext(), CurAST); + PromoteMemToReg(PromotedAllocas, *DT, *DF, CurAST); } /// FindPromotableValuesInLoop - Check the current loop for stores to definite |