}
void BlockGenerator::copyBB(ValueMapT &GlobalMap, LoopToScevMapT <S) {
+ auto *DTWP = P->getAnalysisIfAvailable<DominatorTreeWrapperPass>();
+ auto *DT = DTWP ? &DTWP->getDomTree() : nullptr;
+ auto *LIWP = P->getAnalysisIfAvailable<LoopInfoWrapperPass>();
+ auto *LI = LIWP ? &LIWP->getLoopInfo() : nullptr;;
+
BasicBlock *BB = Statement.getBasicBlock();
BasicBlock *CopyBB =
- SplitBlock(Builder.GetInsertBlock(), Builder.GetInsertPoint(), P);
+ SplitBlock(Builder.GetInsertBlock(), Builder.GetInsertPoint(), DT, LI);
CopyBB->setName("polly.stmt." + BB->getName());
Builder.SetInsertPoint(CopyBB->begin());
}
void VectorBlockGenerator::copyBB() {
+ auto *DTWP = P->getAnalysisIfAvailable<DominatorTreeWrapperPass>();
+ auto *DT = DTWP ? &DTWP->getDomTree() : nullptr;
+ auto *LIWP = P->getAnalysisIfAvailable<LoopInfoWrapperPass>();
+ auto *LI = LIWP ? &LIWP->getLoopInfo() : nullptr;;
+
BasicBlock *BB = Statement.getBasicBlock();
BasicBlock *CopyBB =
- SplitBlock(Builder.GetInsertBlock(), Builder.GetInsertPoint(), P);
+ SplitBlock(Builder.GetInsertBlock(), Builder.GetInsertPoint(), DT, LI);
CopyBB->setName("polly.stmt." + BB->getName());
Builder.SetInsertPoint(CopyBB->begin());
LLVMContext &Context = F->getContext();
BasicBlock *CondBB =
- SplitBlock(Builder.GetInsertBlock(), Builder.GetInsertPoint(), P);
+ SplitBlock(Builder.GetInsertBlock(), Builder.GetInsertPoint(), &DT, &LI);
CondBB->setName("polly.cond");
- BasicBlock *MergeBB = SplitBlock(CondBB, CondBB->begin(), P);
+ BasicBlock *MergeBB = SplitBlock(CondBB, CondBB->begin(), &DT, &LI);
MergeBB->setName("polly.merge");
BasicBlock *ThenBB = BasicBlock::Create(Context, "polly.then", F);
BasicBlock *ElseBB = BasicBlock::Create(Context, "polly.else", F);
Annotator->pushLoop(NewLoop, Parallel);
// ExitBB
- ExitBB = SplitBlock(BeforeBB, Builder.GetInsertPoint()++, P);
+ ExitBB = SplitBlock(BeforeBB, Builder.GetInsertPoint()++, &DT, &LI);
ExitBB->setName("polly.loop_exit");
// BeforeBB
#include "polly/Support/ScopHelper.h"
#include "polly/ScopInfo.h"
+#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/RegionInfo.h"
#include "llvm/Analysis/ScalarEvolution.h"
if (R->contains(*PI))
Preds.push_back(*PI);
- return SplitBlockPredecessors(BB, Preds, ".region", P);
+ auto *AA = P->getAnalysisIfAvailable<AliasAnalysis>();
+ auto *DTWP = P->getAnalysisIfAvailable<DominatorTreeWrapperPass>();
+ auto *DT = DTWP ? &DTWP->getDomTree() : nullptr;
+ auto *LIWP = P->getAnalysisIfAvailable<LoopInfoWrapperPass>();
+ auto *LI = LIWP ? &LIWP->getLoopInfo() : nullptr;
+
+ return SplitBlockPredecessors(BB, Preds, ".region", AA, DT, LI);
}
static void replaceScopAndRegionEntry(polly::Scop *S, BasicBlock *OldEntry,
// Create single entry edge if the region has multiple entry edges.
if (!EnteringBB) {
- NewEntry = SplitBlock(OldEntry, OldEntry->begin(), P);
+ auto *DTWP = P->getAnalysisIfAvailable<DominatorTreeWrapperPass>();
+ auto *DT = DTWP ? &DTWP->getDomTree() : nullptr;
+ auto *LIWP = P->getAnalysisIfAvailable<LoopInfoWrapperPass>();
+ auto *LI = LIWP ? &LIWP->getLoopInfo() : nullptr;
+
+ NewEntry = SplitBlock(OldEntry, OldEntry->begin(), DT, LI);
EnteringBB = OldEntry;
}
while (isa<AllocaInst>(I))
++I;
+ auto *DTWP = P->getAnalysisIfAvailable<DominatorTreeWrapperPass>();
+ auto *DT = DTWP ? &DTWP->getDomTree() : nullptr;
+ auto *LIWP = P->getAnalysisIfAvailable<LoopInfoWrapperPass>();
+ auto *LI = LIWP ? &LIWP->getLoopInfo() : nullptr;
+
// SplitBlock updates DT, DF and LI.
- BasicBlock *NewEntry = SplitBlock(EntryBlock, I, P);
+ BasicBlock *NewEntry = SplitBlock(EntryBlock, I, DT, LI);
if (RegionInfoPass *RIP = P->getAnalysisIfAvailable<RegionInfoPass>())
RIP->getRegionInfo().splitBlock(NewEntry, EntryBlock);
}