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/LoopGenerators.cpp b/polly/lib/CodeGen/LoopGenerators.cpp
index 432960d..4eaaac0 100644
--- a/polly/lib/CodeGen/LoopGenerators.cpp
+++ b/polly/lib/CodeGen/LoopGenerators.cpp
@@ -47,11 +47,10 @@
// TODO: We currently always create the GuardBB. If we can prove the loop is
// always executed at least once, we can get rid of this branch.
Value *polly::createLoop(Value *LB, Value *UB, Value *Stride,
- PollyIRBuilder &Builder, Pass *P, BasicBlock *&ExitBB,
+ PollyIRBuilder &Builder, Pass *P, LoopInfo &LI,
+ DominatorTree &DT, BasicBlock *&ExitBB,
ICmpInst::Predicate Predicate,
LoopAnnotator *Annotator, bool Parallel) {
- DominatorTree &DT = P->getAnalysis<DominatorTreeWrapperPass>().getDomTree();
- LoopInfo &LI = P->getAnalysis<LoopInfo>();
Function *F = Builder.GetInsertBlock()->getParent();
LLVMContext &Context = F->getContext();
@@ -321,7 +320,8 @@
Builder.CreateBr(CheckNextBB);
Builder.SetInsertPoint(--Builder.GetInsertPoint());
- IV = createLoop(LowerBound, UpperBound, Stride, Builder, P, AfterBB,
+ LoopInfo &LI = P->getAnalysis<LoopInfo>();
+ IV = createLoop(LowerBound, UpperBound, Stride, Builder, P, LI, DT, AfterBB,
ICmpInst::ICMP_SLE);
BasicBlock::iterator LoopBody = Builder.GetInsertPoint();