diff options
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopVersioningLICM.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/LoopVersioningLICM.cpp | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopVersioningLICM.cpp b/llvm/lib/Transforms/Scalar/LoopVersioningLICM.cpp index 848be25a2fe0..13e06c79d0d7 100644 --- a/llvm/lib/Transforms/Scalar/LoopVersioningLICM.cpp +++ b/llvm/lib/Transforms/Scalar/LoopVersioningLICM.cpp @@ -77,13 +77,10 @@ #include "llvm/IR/MDBuilder.h" #include "llvm/IR/Metadata.h" #include "llvm/IR/Value.h" -#include "llvm/InitializePasses.h" -#include "llvm/Pass.h" #include "llvm/Support/Casting.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" -#include "llvm/Transforms/Scalar.h" #include "llvm/Transforms/Utils.h" #include "llvm/Transforms/Utils/LoopUtils.h" #include "llvm/Transforms/Utils/LoopVersioning.h" @@ -113,33 +110,6 @@ static cl::opt<unsigned> LVLoopDepthThreshold( namespace { -struct LoopVersioningLICMLegacyPass : public LoopPass { - static char ID; - - LoopVersioningLICMLegacyPass() : LoopPass(ID) { - initializeLoopVersioningLICMLegacyPassPass( - *PassRegistry::getPassRegistry()); - } - - bool runOnLoop(Loop *L, LPPassManager &LPM) override; - - StringRef getPassName() const override { return "Loop Versioning for LICM"; } - - void getAnalysisUsage(AnalysisUsage &AU) const override { - AU.setPreservesCFG(); - AU.addRequired<AAResultsWrapperPass>(); - AU.addRequired<DominatorTreeWrapperPass>(); - AU.addRequiredID(LCSSAID); - AU.addRequired<LoopAccessLegacyAnalysis>(); - AU.addRequired<LoopInfoWrapperPass>(); - AU.addRequiredID(LoopSimplifyID); - AU.addRequired<ScalarEvolutionWrapperPass>(); - AU.addPreserved<AAResultsWrapperPass>(); - AU.addPreserved<GlobalsAAWrapperPass>(); - AU.addRequired<OptimizationRemarkEmitterWrapperPass>(); - } -}; - struct LoopVersioningLICM { // We don't explicitly pass in LoopAccessInfo to the constructor since the // loop versioning might return early due to instructions that are not safe @@ -563,21 +533,6 @@ void LoopVersioningLICM::setNoAliasToLoop(Loop *VerLoop) { } } -bool LoopVersioningLICMLegacyPass::runOnLoop(Loop *L, LPPassManager &LPM) { - if (skipLoop(L)) - return false; - - AliasAnalysis *AA = &getAnalysis<AAResultsWrapperPass>().getAAResults(); - ScalarEvolution *SE = &getAnalysis<ScalarEvolutionWrapperPass>().getSE(); - OptimizationRemarkEmitter *ORE = - &getAnalysis<OptimizationRemarkEmitterWrapperPass>().getORE(); - LoopInfo &LI = getAnalysis<LoopInfoWrapperPass>().getLoopInfo(); - DominatorTree *DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree(); - auto &LAIs = getAnalysis<LoopAccessLegacyAnalysis>().getLAIs(); - - return LoopVersioningLICM(AA, SE, ORE, LAIs, LI, L).run(DT); -} - bool LoopVersioningLICM::run(DominatorTree *DT) { // Do not do the transformation if disabled by metadata. if (hasLICMVersioningTransformation(CurLoop) & TM_Disable) @@ -611,26 +566,6 @@ bool LoopVersioningLICM::run(DominatorTree *DT) { return Changed; } -char LoopVersioningLICMLegacyPass::ID = 0; - -INITIALIZE_PASS_BEGIN(LoopVersioningLICMLegacyPass, "loop-versioning-licm", - "Loop Versioning For LICM", false, false) -INITIALIZE_PASS_DEPENDENCY(AAResultsWrapperPass) -INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass) -INITIALIZE_PASS_DEPENDENCY(GlobalsAAWrapperPass) -INITIALIZE_PASS_DEPENDENCY(LCSSAWrapperPass) -INITIALIZE_PASS_DEPENDENCY(LoopAccessLegacyAnalysis) -INITIALIZE_PASS_DEPENDENCY(LoopInfoWrapperPass) -INITIALIZE_PASS_DEPENDENCY(LoopSimplify) -INITIALIZE_PASS_DEPENDENCY(ScalarEvolutionWrapperPass) -INITIALIZE_PASS_DEPENDENCY(OptimizationRemarkEmitterWrapperPass) -INITIALIZE_PASS_END(LoopVersioningLICMLegacyPass, "loop-versioning-licm", - "Loop Versioning For LICM", false, false) - -Pass *llvm::createLoopVersioningLICMPass() { - return new LoopVersioningLICMLegacyPass(); -} - namespace llvm { PreservedAnalyses LoopVersioningLICMPass::run(Loop &L, LoopAnalysisManager &AM, |