From 2ef3f4fd2378c6b1f6acbb18a9332d58f3d8b2cc Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Thu, 7 Aug 2014 17:14:54 +0000 Subject: 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 --- polly/lib/CodeGen/LoopGenerators.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'polly/lib/CodeGen/LoopGenerators.cpp') diff --git a/polly/lib/CodeGen/LoopGenerators.cpp b/polly/lib/CodeGen/LoopGenerators.cpp index 432960d2b85..4eaaac0bc6d 100644 --- a/polly/lib/CodeGen/LoopGenerators.cpp +++ b/polly/lib/CodeGen/LoopGenerators.cpp @@ -47,11 +47,10 @@ using namespace polly; // 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().getDomTree(); - LoopInfo &LI = P->getAnalysis(); Function *F = Builder.GetInsertBlock()->getParent(); LLVMContext &Context = F->getContext(); @@ -321,7 +320,8 @@ Value *OMPGenerator::createSubfunction(Value *Stride, Value *StructData, Builder.CreateBr(CheckNextBB); Builder.SetInsertPoint(--Builder.GetInsertPoint()); - IV = createLoop(LowerBound, UpperBound, Stride, Builder, P, AfterBB, + LoopInfo &LI = P->getAnalysis(); + IV = createLoop(LowerBound, UpperBound, Stride, Builder, P, LI, DT, AfterBB, ICmpInst::ICMP_SLE); BasicBlock::iterator LoopBody = Builder.GetInsertPoint(); -- cgit v1.2.3