diff options
Diffstat (limited to 'llvm/lib/Transforms/Scalar/DFAJumpThreading.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/DFAJumpThreading.cpp | 50 | 
1 files changed, 2 insertions, 48 deletions
diff --git a/llvm/lib/Transforms/Scalar/DFAJumpThreading.cpp b/llvm/lib/Transforms/Scalar/DFAJumpThreading.cpp index 658d0fcb53fa..f2efe60bdf88 100644 --- a/llvm/lib/Transforms/Scalar/DFAJumpThreading.cpp +++ b/llvm/lib/Transforms/Scalar/DFAJumpThreading.cpp @@ -70,11 +70,8 @@  #include "llvm/IR/CFG.h"  #include "llvm/IR/Constants.h"  #include "llvm/IR/IntrinsicInst.h" -#include "llvm/InitializePasses.h" -#include "llvm/Pass.h"  #include "llvm/Support/CommandLine.h"  #include "llvm/Support/Debug.h" -#include "llvm/Transforms/Scalar.h"  #include "llvm/Transforms/Utils/Cloning.h"  #include "llvm/Transforms/Utils/SSAUpdaterBulk.h"  #include "llvm/Transforms/Utils/ValueMapper.h" @@ -168,51 +165,8 @@ private:    OptimizationRemarkEmitter *ORE;  }; -class DFAJumpThreadingLegacyPass : public FunctionPass { -public: -  static char ID; // Pass identification -  DFAJumpThreadingLegacyPass() : FunctionPass(ID) {} - -  void getAnalysisUsage(AnalysisUsage &AU) const override { -    AU.addRequired<AssumptionCacheTracker>(); -    AU.addRequired<DominatorTreeWrapperPass>(); -    AU.addPreserved<DominatorTreeWrapperPass>(); -    AU.addRequired<TargetTransformInfoWrapperPass>(); -    AU.addRequired<OptimizationRemarkEmitterWrapperPass>(); -  } - -  bool runOnFunction(Function &F) override { -    if (skipFunction(F)) -      return false; - -    AssumptionCache *AC = -        &getAnalysis<AssumptionCacheTracker>().getAssumptionCache(F); -    DominatorTree *DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree(); -    TargetTransformInfo *TTI = -        &getAnalysis<TargetTransformInfoWrapperPass>().getTTI(F); -    OptimizationRemarkEmitter *ORE = -        &getAnalysis<OptimizationRemarkEmitterWrapperPass>().getORE(); - -    return DFAJumpThreading(AC, DT, TTI, ORE).run(F); -  } -};  } // end anonymous namespace -char DFAJumpThreadingLegacyPass::ID = 0; -INITIALIZE_PASS_BEGIN(DFAJumpThreadingLegacyPass, "dfa-jump-threading", -                      "DFA Jump Threading", false, false) -INITIALIZE_PASS_DEPENDENCY(AssumptionCacheTracker) -INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass) -INITIALIZE_PASS_DEPENDENCY(TargetTransformInfoWrapperPass) -INITIALIZE_PASS_DEPENDENCY(OptimizationRemarkEmitterWrapperPass) -INITIALIZE_PASS_END(DFAJumpThreadingLegacyPass, "dfa-jump-threading", -                    "DFA Jump Threading", false, false) - -// Public interface to the DFA Jump Threading pass -FunctionPass *llvm::createDFAJumpThreadingPass() { -  return new DFAJumpThreadingLegacyPass(); -} -  namespace {  /// Create a new basic block and sink \p SIToSink into it. @@ -625,7 +579,7 @@ private:          continue;        PathsType SuccPaths = paths(Succ, Visited, PathDepth + 1); -      for (PathType Path : SuccPaths) { +      for (const PathType &Path : SuccPaths) {          PathType NewPath(Path);          NewPath.push_front(BB);          Res.push_back(NewPath); @@ -978,7 +932,7 @@ private:      SSAUpdaterBulk SSAUpdate;      SmallVector<Use *, 16> UsesToRename; -    for (auto KV : NewDefs) { +    for (const auto &KV : NewDefs) {        Instruction *I = KV.first;        BasicBlock *BB = I->getParent();        std::vector<Instruction *> Cloned = KV.second;  | 
