|
21 | 21 | #include "llvm/Analysis/ValueTracking.h" |
22 | 22 | #include "llvm/IR/IRBuilder.h" |
23 | 23 | #include "llvm/IR/PatternMatch.h" |
24 | | -#include "llvm/InitializePasses.h" |
25 | | -#include "llvm/Pass.h" |
26 | 24 | #include "llvm/Support/CommandLine.h" |
27 | 25 | #include "llvm/Support/Debug.h" |
28 | 26 | #include "llvm/Support/MathExtras.h" |
@@ -54,21 +52,6 @@ struct EVLIndVarSimplifyImpl { |
54 | 52 | // Returns true if modify the loop. |
55 | 53 | bool run(Loop &L); |
56 | 54 | }; |
57 | | - |
58 | | -struct EVLIndVarSimplify : public LoopPass { |
59 | | - static char ID; |
60 | | - |
61 | | - EVLIndVarSimplify() : LoopPass(ID) { |
62 | | - initializeEVLIndVarSimplifyPass(*PassRegistry::getPassRegistry()); |
63 | | - } |
64 | | - |
65 | | - bool runOnLoop(Loop *L, LPPassManager &LPM) override; |
66 | | - |
67 | | - void getAnalysisUsage(AnalysisUsage &AU) const override { |
68 | | - AU.addRequired<ScalarEvolutionWrapperPass>(); |
69 | | - AU.setPreservesCFG(); |
70 | | - } |
71 | | -}; |
72 | 55 | } // anonymous namespace |
73 | 56 |
|
74 | 57 | static uint32_t getVFFromIndVar(const SCEV *Step, const Function &F) { |
@@ -251,21 +234,3 @@ PreservedAnalyses EVLIndVarSimplifyPass::run(Loop &L, LoopAnalysisManager &LAM, |
251 | 234 | return PreservedAnalyses::allInSet<CFGAnalyses>(); |
252 | 235 | return PreservedAnalyses::all(); |
253 | 236 | } |
254 | | - |
255 | | -char EVLIndVarSimplify::ID = 0; |
256 | | - |
257 | | -INITIALIZE_PASS_BEGIN(EVLIndVarSimplify, DEBUG_TYPE, |
258 | | - "EVL-based Induction Variables Simplify", false, false) |
259 | | -INITIALIZE_PASS_DEPENDENCY(ScalarEvolutionWrapperPass) |
260 | | -INITIALIZE_PASS_END(EVLIndVarSimplify, DEBUG_TYPE, |
261 | | - "EVL-based Induction Variables Simplify", false, false) |
262 | | - |
263 | | -bool EVLIndVarSimplify::runOnLoop(Loop *L, LPPassManager &LPM) { |
264 | | - if (skipLoop(L)) |
265 | | - return false; |
266 | | - |
267 | | - auto &SE = getAnalysis<ScalarEvolutionWrapperPass>().getSE(); |
268 | | - return EVLIndVarSimplifyImpl(SE).run(*L); |
269 | | -} |
270 | | - |
271 | | -Pass *llvm::createEVLIndVarSimplifyPass() { return new EVLIndVarSimplify(); } |
0 commit comments