Make used analysis passes explicit
Use the explicit analysis if possible, only for splitBlock we will continue
to use the Pass * argument. This change allows us to remove the getAnalysis
calls from the code generation.
llvm-svn: 215121
diff --git a/polly/lib/CodeGen/BlockGenerators.cpp b/polly/lib/CodeGen/BlockGenerators.cpp
index 66d90d9..52c8ce0 100644
--- a/polly/lib/CodeGen/BlockGenerators.cpp
+++ b/polly/lib/CodeGen/BlockGenerators.cpp
@@ -67,10 +67,11 @@
}
BlockGenerator::BlockGenerator(PollyIRBuilder &B, ScopStmt &Stmt, Pass *P,
+ LoopInfo &LI, ScalarEvolution &SE,
isl_ast_build *Build,
IslExprBuilder *ExprBuilder)
- : Builder(B), Statement(Stmt), P(P), SE(P->getAnalysis<ScalarEvolution>()),
- Build(Build), ExprBuilder(ExprBuilder) {}
+ : Builder(B), Statement(Stmt), P(P), LI(LI), SE(SE), Build(Build),
+ ExprBuilder(ExprBuilder) {}
Value *BlockGenerator::lookupAvailableValue(const Value *Old, ValueMapT &BBMap,
ValueMapT &GlobalMap) const {
@@ -209,7 +210,7 @@
}
Loop *BlockGenerator::getLoopForInst(const llvm::Instruction *Inst) {
- return P->getAnalysis<LoopInfo>().getLoopFor(Inst->getParent());
+ return LI.getLoopFor(Inst->getParent());
}
Value *BlockGenerator::generateScalarLoad(const LoadInst *Load,
@@ -282,14 +283,12 @@
copyInstruction(&Inst, BBMap, GlobalMap, LTS);
}
-VectorBlockGenerator::VectorBlockGenerator(PollyIRBuilder &B,
- VectorValueMapT &GlobalMaps,
- std::vector<LoopToScevMapT> &VLTS,
- ScopStmt &Stmt,
- __isl_keep isl_map *Schedule,
- Pass *P)
- : BlockGenerator(B, Stmt, P, nullptr, nullptr), GlobalMaps(GlobalMaps),
- VLTS(VLTS), Schedule(Schedule) {
+VectorBlockGenerator::VectorBlockGenerator(
+ PollyIRBuilder &B, VectorValueMapT &GlobalMaps,
+ std::vector<LoopToScevMapT> &VLTS, ScopStmt &Stmt,
+ __isl_keep isl_map *Schedule, Pass *P, LoopInfo &LI, ScalarEvolution &SE)
+ : BlockGenerator(B, Stmt, P, LI, SE, nullptr, nullptr),
+ GlobalMaps(GlobalMaps), VLTS(VLTS), Schedule(Schedule) {
assert(GlobalMaps.size() > 1 && "Only one vector lane found");
assert(Schedule && "No statement domain provided");
}