From 1ef52333c55dcdf2ffad766fd12b434420013666 Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Sun, 8 Feb 2015 20:50:42 +0000 Subject: [PATCH] [Refactor] Use the LoopInfo object already present llvm-svn: 228540 --- polly/lib/CodeGen/BlockGenerators.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/polly/lib/CodeGen/BlockGenerators.cpp b/polly/lib/CodeGen/BlockGenerators.cpp index 6790b9d..a002569 100644 --- a/polly/lib/CodeGen/BlockGenerators.cpp +++ b/polly/lib/CodeGen/BlockGenerators.cpp @@ -237,8 +237,7 @@ void BlockGenerator::copyInstruction(ScopStmt &Stmt, const Instruction *Inst, if (Inst->isTerminator()) return; - if (canSynthesize(Inst, &P->getAnalysis().getLoopInfo(), - &SE, &Stmt.getParent()->getRegion())) + if (canSynthesize(Inst, &LI, &SE, &Stmt.getParent()->getRegion())) return; if (const LoadInst *Load = dyn_cast(Inst)) { @@ -288,12 +287,10 @@ void BlockGenerator::copyBB(ScopStmt &Stmt, ValueMapT &GlobalMap, LoopToScevMapT <S) { auto *DTWP = P->getAnalysisIfAvailable(); auto *DT = DTWP ? &DTWP->getDomTree() : nullptr; - auto *LIWP = P->getAnalysisIfAvailable(); - auto *LI = LIWP ? &LIWP->getLoopInfo() : nullptr; BasicBlock *BB = Stmt.getBasicBlock(); BasicBlock *CopyBB = - SplitBlock(Builder.GetInsertBlock(), Builder.GetInsertPoint(), DT, LI); + SplitBlock(Builder.GetInsertBlock(), Builder.GetInsertPoint(), DT, &LI); CopyBB->setName("polly.stmt." + BB->getName()); Builder.SetInsertPoint(CopyBB->begin()); @@ -594,8 +591,7 @@ void VectorBlockGenerator::copyInstruction(ScopStmt &Stmt, if (Inst->isTerminator()) return; - if (canSynthesize(Inst, &P->getAnalysis().getLoopInfo(), - &SE, &Stmt.getParent()->getRegion())) + if (canSynthesize(Inst, &LI, &SE, &Stmt.getParent()->getRegion())) return; if (const LoadInst *Load = dyn_cast(Inst)) { @@ -629,12 +625,10 @@ void VectorBlockGenerator::copyInstruction(ScopStmt &Stmt, void VectorBlockGenerator::copyBB(ScopStmt &Stmt) { auto *DTWP = P->getAnalysisIfAvailable(); auto *DT = DTWP ? &DTWP->getDomTree() : nullptr; - auto *LIWP = P->getAnalysisIfAvailable(); - auto *LI = LIWP ? &LIWP->getLoopInfo() : nullptr; BasicBlock *BB = Stmt.getBasicBlock(); BasicBlock *CopyBB = - SplitBlock(Builder.GetInsertBlock(), Builder.GetInsertPoint(), DT, LI); + SplitBlock(Builder.GetInsertBlock(), Builder.GetInsertPoint(), DT, &LI); CopyBB->setName("polly.stmt." + BB->getName()); Builder.SetInsertPoint(CopyBB->begin()); -- 2.7.4