[polly] r252357 - polly/ADT: Remove implicit ilist iterator conversions, NFC

Duncan P. N. Exon Smith via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 6 15:00:53 PST 2015


> On 2015-Nov-06, at 14:56, Duncan P. N. Exon Smith via llvm-commits <llvm-commits at lists.llvm.org> wrote:
> 
> Author: dexonsmith
> Date: Fri Nov  6 16:56:54 2015
> New Revision: 252357
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=252357&view=rev
> Log:
> polly/ADT: Remove implicit ilist iterator conversions, NFC
> 
> Remove all the implicit ilist iterator conversions from polly, in
> preparation for making them illegal in ADT.  There was one oddity I came
> across: at line 95 of lib/CodeGen/LoopGenerators.cpp, there was a
> post-increment `Builder.GetInsertPoint()++`.
> 
> Since it was a no-op, I removed it, but I admit I wonder if it might be
> a bug (both before and after this change)?  Perhaps it should be a
> pre-increment?

Tobias, you may want to check this:

> 
> Modified:
>    polly/trunk/lib/Analysis/ScopInfo.cpp
>    polly/trunk/lib/CodeGen/BlockGenerators.cpp
>    polly/trunk/lib/CodeGen/CodeGeneration.cpp
>    polly/trunk/lib/CodeGen/IslExprBuilder.cpp
>    polly/trunk/lib/CodeGen/IslNodeBuilder.cpp
>    polly/trunk/lib/CodeGen/LoopGenerators.cpp
>    polly/trunk/lib/CodeGen/RuntimeDebugBuilder.cpp
>    polly/trunk/lib/Support/ScopHelper.cpp
> 
> Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=252357&r1=252356&r2=252357&view=diff
> ==============================================================================
> --- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
> +++ polly/trunk/lib/Analysis/ScopInfo.cpp Fri Nov  6 16:56:54 2015
> @@ -3593,7 +3593,7 @@ void ScopInfo::buildAccessFunctions(Regi
>   auto &ScopRIL = *SD->getRequiredInvariantLoads(&R);
> 
>   for (BasicBlock::iterator I = BB.begin(), E = --BB.end(); I != E; ++I) {
> -    Instruction *Inst = I;
> +    Instruction *Inst = &*I;
> 
>     PHINode *PHI = dyn_cast<PHINode>(Inst);
>     if (PHI)
> 
> Modified: polly/trunk/lib/CodeGen/BlockGenerators.cpp
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/BlockGenerators.cpp?rev=252357&r1=252356&r2=252357&view=diff
> ==============================================================================
> --- polly/trunk/lib/CodeGen/BlockGenerators.cpp (original)
> +++ polly/trunk/lib/CodeGen/BlockGenerators.cpp Fri Nov  6 16:56:54 2015
> @@ -79,7 +79,7 @@ Value *BlockGenerator::trySynthesizeNewV
>         assert(IP != Builder.GetInsertBlock()->end() &&
>                "Only instructions can be insert points for SCEVExpander");
>         Value *Expanded = expandCodeFor(S, SE, DL, "polly", NewScev,
> -                                        Old->getType(), IP, &VTV);
> +                                        Old->getType(), &*IP, &VTV);
> 
>         BBMap[Old] = Expanded;
>         return Expanded;
> @@ -281,8 +281,8 @@ void BlockGenerator::copyStmt(ScopStmt &
> }
> 
> BasicBlock *BlockGenerator::splitBB(BasicBlock *BB) {
> -  BasicBlock *CopyBB =
> -      SplitBlock(Builder.GetInsertBlock(), Builder.GetInsertPoint(), &DT, &LI);
> +  BasicBlock *CopyBB = SplitBlock(Builder.GetInsertBlock(),
> +                                  &*Builder.GetInsertPoint(), &DT, &LI);
>   CopyBB->setName("polly.stmt." + BB->getName());
>   return CopyBB;
> }
> @@ -291,7 +291,7 @@ BasicBlock *BlockGenerator::copyBB(ScopS
>                                    ValueMapT &BBMap, LoopToScevMapT &LTS,
>                                    isl_id_to_ast_expr *NewAccesses) {
>   BasicBlock *CopyBB = splitBB(BB);
> -  Builder.SetInsertPoint(CopyBB->begin());
> +  Builder.SetInsertPoint(&CopyBB->front());
>   generateScalarLoads(Stmt, BBMap);
> 
>   copyBB(Stmt, BB, CopyBB, BBMap, LTS, NewAccesses);
> @@ -319,7 +319,7 @@ Value *BlockGenerator::getOrCreateAlloca
>     auto *Ty = ScalarBase->getType();
>     auto NewAddr = new AllocaInst(Ty, ScalarBase->getName() + NameExt);
>     EntryBB = &Builder.GetInsertBlock()->getParent()->getEntryBlock();
> -    NewAddr->insertBefore(EntryBB->getFirstInsertionPt());
> +    NewAddr->insertBefore(&*EntryBB->getFirstInsertionPt());
>     Map[ScalarBase] = NewAddr;
>   }
> 
> @@ -549,7 +549,7 @@ void BlockGenerator::createScalarFinaliz
>     // Create the merge PHI that merges the optimized and unoptimized version.
>     PHINode *MergePHI = PHINode::Create(EscapeInst->getType(), 2,
>                                         EscapeInst->getName() + ".merge");
> -    MergePHI->insertBefore(MergeBB->getFirstInsertionPt());
> +    MergePHI->insertBefore(&*MergeBB->getFirstInsertionPt());
> 
>     // Add the respective values to the merge PHI.
>     MergePHI->addIncoming(EscapeInstReload, OptExitBB);
> @@ -624,7 +624,7 @@ void BlockGenerator::createExitPHINodeMe
>     Reload = Builder.CreateBitOrPointerCast(Reload, PHI->getType());
>     Value *OriginalValue = PHI->getIncomingValueForBlock(MergeBB);
>     auto *MergePHI = PHINode::Create(PHI->getType(), 2, Name + ".ph.merge");
> -    MergePHI->insertBefore(MergeBB->getFirstInsertionPt());
> +    MergePHI->insertBefore(&*MergeBB->getFirstInsertionPt());
>     MergePHI->addIncoming(Reload, OptExitBB);
>     MergePHI->addIncoming(OriginalValue, ExitBB);
>     int Idx = PHI->getBasicBlockIndex(MergeBB);
> @@ -965,10 +965,10 @@ void VectorBlockGenerator::copyStmt(
>                                "the vector block generator");
> 
>   BasicBlock *BB = Stmt.getBasicBlock();
> -  BasicBlock *CopyBB =
> -      SplitBlock(Builder.GetInsertBlock(), Builder.GetInsertPoint(), &DT, &LI);
> +  BasicBlock *CopyBB = SplitBlock(Builder.GetInsertBlock(),
> +                                  &*Builder.GetInsertPoint(), &DT, &LI);
>   CopyBB->setName("polly.stmt." + BB->getName());
> -  Builder.SetInsertPoint(CopyBB->begin());
> +  Builder.SetInsertPoint(&CopyBB->front());
> 
>   // Create two maps that store the mapping from the original instructions of
>   // the old basic block to their copies in the new basic block. Those maps
> @@ -1022,10 +1022,10 @@ void RegionGenerator::copyStmt(ScopStmt
>   // Create a dedicated entry for the region where we can reload all demoted
>   // inputs.
>   BasicBlock *EntryBB = R->getEntry();
> -  BasicBlock *EntryBBCopy =
> -      SplitBlock(Builder.GetInsertBlock(), Builder.GetInsertPoint(), &DT, &LI);
> +  BasicBlock *EntryBBCopy = SplitBlock(Builder.GetInsertBlock(),
> +                                       &*Builder.GetInsertPoint(), &DT, &LI);
>   EntryBBCopy->setName("polly.stmt." + EntryBB->getName() + ".entry");
> -  Builder.SetInsertPoint(EntryBBCopy->begin());
> +  Builder.SetInsertPoint(&EntryBBCopy->front());
> 
>   generateScalarLoads(Stmt, RegionMaps[EntryBBCopy]);
> 
> @@ -1057,7 +1057,7 @@ void RegionGenerator::copyStmt(ScopStmt
>       RegionMap = RegionMaps[BBCopyIDom];
> 
>     // Copy the block with the BlockGenerator.
> -    Builder.SetInsertPoint(BBCopy->begin());
> +    Builder.SetInsertPoint(&BBCopy->front());
>     copyBB(Stmt, BB, BBCopy, RegionMap, LTS, IdToAstExp);
> 
>     // In order to remap PHI nodes we store also basic block mappings.
> @@ -1079,8 +1079,8 @@ void RegionGenerator::copyStmt(ScopStmt
>   }
> 
>   // Now create a new dedicated region exit block and add it to the region map.
> -  BasicBlock *ExitBBCopy =
> -      SplitBlock(Builder.GetInsertBlock(), Builder.GetInsertPoint(), &DT, &LI);
> +  BasicBlock *ExitBBCopy = SplitBlock(Builder.GetInsertBlock(),
> +                                      &*Builder.GetInsertPoint(), &DT, &LI);
>   ExitBBCopy->setName("polly.stmt." + R->getExit()->getName() + ".exit");
>   BlockMap[R->getExit()] = ExitBBCopy;
> 
> @@ -1122,7 +1122,7 @@ void RegionGenerator::copyStmt(ScopStmt
>         PHINode::Create(Builder.getInt32Ty(), 2, "polly.subregion.iv");
>     Instruction *LoopPHIInc = BinaryOperator::CreateAdd(
>         LoopPHI, Builder.getInt32(1), "polly.subregion.iv.inc");
> -    LoopPHI->insertBefore(BBCopy->begin());
> +    LoopPHI->insertBefore(&BBCopy->front());
>     LoopPHIInc->insertBefore(BBCopy->getTerminator());
> 
>     for (auto *PredBB : make_range(pred_begin(BB), pred_end(BB))) {
> @@ -1142,7 +1142,7 @@ void RegionGenerator::copyStmt(ScopStmt
>   }
> 
>   // Continue generating code in the exit block.
> -  Builder.SetInsertPoint(ExitBBCopy->getFirstInsertionPt());
> +  Builder.SetInsertPoint(&*ExitBBCopy->getFirstInsertionPt());
> 
>   // Write values visible to other statements.
>   generateScalarStores(Stmt, LTS, ValueMap);
> @@ -1168,6 +1168,7 @@ void RegionGenerator::generateScalarStor
> 
>     // In case we add the store into an exiting block, we need to restore the
>     // position for stores in the exit node.
> +    BasicBlock *SavedInsertBB = Builder.GetInsertBlock();
>     auto SavedInsertionPoint = Builder.GetInsertPoint();
>     ValueMapT *LocalBBMap = &BBMap;
> 
> @@ -1189,7 +1190,7 @@ void RegionGenerator::generateScalarStor
> 
>     // Restore the insertion point if necessary.
>     if (isa<TerminatorInst>(ScalarInst))
> -      Builder.SetInsertPoint(SavedInsertionPoint);
> +      Builder.SetInsertPoint(SavedInsertBB, SavedInsertionPoint);
>   }
> }
> 
> @@ -1216,10 +1217,11 @@ void RegionGenerator::addOperandToPHI(Sc
> 
>     Value *Op = PHI->getIncomingValueForBlock(IncomingBB);
> 
> +    BasicBlock *OldBlock = Builder.GetInsertBlock();
>     auto OldIP = Builder.GetInsertPoint();
>     Builder.SetInsertPoint(BBCopy->getTerminator());
>     OpCopy = getNewValue(Stmt, Op, BBCopyMap, LTS, getLoopForInst(PHI));
> -    Builder.SetInsertPoint(OldIP);
> +    Builder.SetInsertPoint(OldBlock, OldIP);
>   } else {
> 
>     if (PHICopy->getBasicBlockIndex(BBCopy) >= 0)
> 
> Modified: polly/trunk/lib/CodeGen/CodeGeneration.cpp
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/CodeGeneration.cpp?rev=252357&r1=252356&r2=252357&view=diff
> ==============================================================================
> --- polly/trunk/lib/CodeGen/CodeGeneration.cpp (original)
> +++ polly/trunk/lib/CodeGen/CodeGeneration.cpp Fri Nov  6 16:56:54 2015
> @@ -153,7 +153,7 @@ public:
> 
>     Value *RTC = buildRTC(Builder, NodeBuilder.getExprBuilder());
>     Builder.GetInsertBlock()->getTerminator()->setOperand(0, RTC);
> -    Builder.SetInsertPoint(StartBlock->begin());
> +    Builder.SetInsertPoint(&StartBlock->front());
> 
>     NodeBuilder.create(AstRoot);
> 
> 
> Modified: polly/trunk/lib/CodeGen/IslExprBuilder.cpp
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/IslExprBuilder.cpp?rev=252357&r1=252356&r2=252357&view=diff
> ==============================================================================
> --- polly/trunk/lib/CodeGen/IslExprBuilder.cpp (original)
> +++ polly/trunk/lib/CodeGen/IslExprBuilder.cpp Fri Nov  6 16:56:54 2015
> @@ -157,7 +157,7 @@ Value *IslExprBuilder::createAccessAddre
>     DimSCEV = SCEVParameterRewriter::rewrite(DimSCEV, SE, Map);
>     Value *DimSize =
>         expandCodeFor(S, SE, DL, "polly", DimSCEV, DimSCEV->getType(),
> -                      Builder.GetInsertPoint());
> +                      &*Builder.GetInsertPoint());
> 
>     Type *Ty = getWidestType(DimSize->getType(), IndexOp->getType());
> 
> @@ -495,7 +495,7 @@ IslExprBuilder::createOpBooleanCondition
> 
>   auto InsertBB = Builder.GetInsertBlock();
>   auto InsertPoint = Builder.GetInsertPoint();
> -  auto NextBB = SplitBlock(InsertBB, InsertPoint, &DT, &LI);
> +  auto NextBB = SplitBlock(InsertBB, &*InsertPoint, &DT, &LI);
>   BasicBlock *CondBB = BasicBlock::Create(Context, "polly.cond", F);
>   LI.changeLoopFor(CondBB, LI.getLoopFor(InsertBB));
>   DT.addNewBlock(CondBB, InsertBB);
> 
> Modified: polly/trunk/lib/CodeGen/IslNodeBuilder.cpp
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/IslNodeBuilder.cpp?rev=252357&r1=252356&r2=252357&view=diff
> ==============================================================================
> --- polly/trunk/lib/CodeGen/IslNodeBuilder.cpp (original)
> +++ polly/trunk/lib/CodeGen/IslNodeBuilder.cpp Fri Nov  6 16:56:54 2015
> @@ -475,7 +475,7 @@ void IslNodeBuilder::createForSequential
> 
>   IDToValue.erase(IDToValue.find(IteratorID));
> 
> -  Builder.SetInsertPoint(ExitBlock->begin());
> +  Builder.SetInsertPoint(&ExitBlock->front());
> 
>   isl_ast_node_free(For);
>   isl_ast_expr_free(Iterator);
> @@ -538,10 +538,10 @@ void IslNodeBuilder::createForParallel(_
>   // The preamble of parallel code interacts different than normal code with
>   // e.g., scalar initialization. Therefore, we ensure the parallel code is
>   // separated from the last basic block.
> -  BasicBlock *ParBB =
> -      SplitBlock(Builder.GetInsertBlock(), Builder.GetInsertPoint(), &DT, &LI);
> +  BasicBlock *ParBB = SplitBlock(Builder.GetInsertBlock(),
> +                                 &*Builder.GetInsertPoint(), &DT, &LI);
>   ParBB->setName("polly.parallel.for");
> -  Builder.SetInsertPoint(ParBB->begin());
> +  Builder.SetInsertPoint(&ParBB->front());
> 
>   Body = isl_ast_node_for_get_body(For);
>   Init = isl_ast_node_for_get_init(For);
> @@ -597,7 +597,7 @@ void IslNodeBuilder::createForParallel(_
>   IV = ParallelLoopGen.createParallelLoop(ValueLB, ValueUB, ValueInc,
>                                           SubtreeValues, NewValues, &LoopBody);
>   BasicBlock::iterator AfterLoop = Builder.GetInsertPoint();
> -  Builder.SetInsertPoint(LoopBody);
> +  Builder.SetInsertPoint(&*LoopBody);
> 
>   // Save the current values.
>   auto ValueMapCopy = ValueMap;
> @@ -620,7 +620,7 @@ void IslNodeBuilder::createForParallel(_
>   ValueMap = ValueMapCopy;
>   IDToValue = IDToValueCopy;
> 
> -  Builder.SetInsertPoint(AfterLoop);
> +  Builder.SetInsertPoint(&*AfterLoop);
>   removeSubFuncFromDomTree((*LoopBody).getParent()->getParent(), DT);
> 
>   for (const Loop *L : Loops)
> @@ -656,10 +656,10 @@ void IslNodeBuilder::createIf(__isl_take
>   Function *F = Builder.GetInsertBlock()->getParent();
>   LLVMContext &Context = F->getContext();
> 
> -  BasicBlock *CondBB =
> -      SplitBlock(Builder.GetInsertBlock(), Builder.GetInsertPoint(), &DT, &LI);
> +  BasicBlock *CondBB = SplitBlock(Builder.GetInsertBlock(),
> +                                  &*Builder.GetInsertPoint(), &DT, &LI);
>   CondBB->setName("polly.cond");
> -  BasicBlock *MergeBB = SplitBlock(CondBB, CondBB->begin(), &DT, &LI);
> +  BasicBlock *MergeBB = SplitBlock(CondBB, &CondBB->front(), &DT, &LI);
>   MergeBB->setName("polly.merge");
>   BasicBlock *ThenBB = BasicBlock::Create(Context, "polly.then", F);
>   BasicBlock *ElseBB = BasicBlock::Create(Context, "polly.else", F);
> @@ -683,16 +683,16 @@ void IslNodeBuilder::createIf(__isl_take
>   Builder.CreateBr(MergeBB);
>   Builder.SetInsertPoint(ElseBB);
>   Builder.CreateBr(MergeBB);
> -  Builder.SetInsertPoint(ThenBB->begin());
> +  Builder.SetInsertPoint(&ThenBB->front());
> 
>   create(isl_ast_node_if_get_then(If));
> 
> -  Builder.SetInsertPoint(ElseBB->begin());
> +  Builder.SetInsertPoint(&ElseBB->front());
> 
>   if (isl_ast_node_if_has_else(If))
>     create(isl_ast_node_if_get_else(If));
> 
> -  Builder.SetInsertPoint(MergeBB->begin());
> +  Builder.SetInsertPoint(&MergeBB->front());
> 
>   isl_ast_node_free(If);
> }
> @@ -885,10 +885,10 @@ Value *IslNodeBuilder::preloadInvariantL
>       Cond = Builder.CreateIsNotNull(Cond);
> 
>     BasicBlock *CondBB = SplitBlock(Builder.GetInsertBlock(),
> -                                    Builder.GetInsertPoint(), &DT, &LI);
> +                                    &*Builder.GetInsertPoint(), &DT, &LI);
>     CondBB->setName("polly.preload.cond");
> 
> -    BasicBlock *MergeBB = SplitBlock(CondBB, CondBB->begin(), &DT, &LI);
> +    BasicBlock *MergeBB = SplitBlock(CondBB, &CondBB->front(), &DT, &LI);
>     MergeBB->setName("polly.preload.merge");
> 
>     Function *F = Builder.GetInsertBlock()->getParent();
> @@ -979,7 +979,7 @@ void IslNodeBuilder::preloadInvariantEqu
> 
>   BasicBlock *EntryBB = &Builder.GetInsertBlock()->getParent()->getEntryBlock();
>   auto *Alloca = new AllocaInst(AccInstTy, AccInst->getName() + ".preload.s2a");
> -  Alloca->insertBefore(EntryBB->getFirstInsertionPt());
> +  Alloca->insertBefore(&*EntryBB->getFirstInsertionPt());
>   Builder.CreateStore(PreloadVal, Alloca);
> 
>   const Region &R = S.getRegion();
> @@ -1007,10 +1007,10 @@ void IslNodeBuilder::preloadInvariantLoa
>   if (InvariantEquivClasses.empty())
>     return;
> 
> -  BasicBlock *PreLoadBB =
> -      SplitBlock(Builder.GetInsertBlock(), Builder.GetInsertPoint(), &DT, &LI);
> +  BasicBlock *PreLoadBB = SplitBlock(Builder.GetInsertBlock(),
> +                                     &*Builder.GetInsertPoint(), &DT, &LI);
>   PreLoadBB->setName("polly.preload.begin");
> -  Builder.SetInsertPoint(PreLoadBB->begin());
> +  Builder.SetInsertPoint(&PreLoadBB->front());
> 
>   for (const auto &IAClass : InvariantEquivClasses)
>     preloadInvariantEquivClass(IAClass);
> @@ -1046,7 +1046,7 @@ void IslNodeBuilder::addParameters(__isl
> }
> 
> Value *IslNodeBuilder::generateSCEV(const SCEV *Expr) {
> -  Instruction *InsertLocation = --(Builder.GetInsertBlock()->end());
> +  Instruction *InsertLocation = &*--(Builder.GetInsertBlock()->end());
>   return expandCodeFor(S, SE, DL, "polly", Expr, Expr->getType(),
>                        InsertLocation, &ValueMap);
> }
> 
> Modified: polly/trunk/lib/CodeGen/LoopGenerators.cpp
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/LoopGenerators.cpp?rev=252357&r1=252356&r2=252357&view=diff
> ==============================================================================
> --- polly/trunk/lib/CodeGen/LoopGenerators.cpp (original)
> +++ polly/trunk/lib/CodeGen/LoopGenerators.cpp Fri Nov  6 16:56:54 2015
> @@ -92,7 +92,7 @@ Value *polly::createLoop(Value *LB, Valu
>     Annotator->pushLoop(NewLoop, Parallel);
> 
>   // ExitBB
> -  ExitBB = SplitBlock(BeforeBB, Builder.GetInsertPoint()++, &DT, &LI);
> +  ExitBB = SplitBlock(BeforeBB, &*Builder.GetInsertPoint(), &DT, &LI);

Should this be `&*++Builder.GetInsertPoint()`?  The change I made here is
NFC, but I wonder if there was a bug in the code already.

>   ExitBB->setName("polly.loop_exit");
> 
>   // BeforeBB
> @@ -153,7 +153,7 @@ Value *ParallelLoopGenerator::createPara
>   BasicBlock::iterator BeforeLoop = Builder.GetInsertPoint();
>   Value *IV = createSubFn(Stride, Struct, UsedValues, Map, &SubFn);
>   *LoopBody = Builder.GetInsertPoint();
> -  Builder.SetInsertPoint(BeforeLoop);
> +  Builder.SetInsertPoint(&*BeforeLoop);
> 
>   Value *SubFnParam = Builder.CreateBitCast(Struct, Builder.getInt8PtrTy(),
>                                             "polly.par.userContext");
> @@ -287,7 +287,7 @@ ParallelLoopGenerator::storeValuesIntoSt
>   // in the entry block of the function and use annotations to denote the actual
>   // live span (similar to clang).
>   BasicBlock &EntryBB = Builder.GetInsertBlock()->getParent()->getEntryBlock();
> -  Instruction *IP = EntryBB.getFirstInsertionPt();
> +  Instruction *IP = &*EntryBB.getFirstInsertionPt();
>   StructType *Ty = StructType::get(Builder.getContext(), Members);
>   AllocaInst *Struct = new AllocaInst(Ty, 0, "polly.par.userContext", IP);
> 
> @@ -340,8 +340,8 @@ Value *ParallelLoopGenerator::createSubF
>   Builder.SetInsertPoint(HeaderBB);
>   LBPtr = Builder.CreateAlloca(LongType, 0, "polly.par.LBPtr");
>   UBPtr = Builder.CreateAlloca(LongType, 0, "polly.par.UBPtr");
> -  UserContext = Builder.CreateBitCast(SubFn->arg_begin(), StructData->getType(),
> -                                      "polly.par.userContext");
> +  UserContext = Builder.CreateBitCast(
> +      &*SubFn->arg_begin(), StructData->getType(), "polly.par.userContext");
> 
>   extractValuesFromStruct(Data, StructData->getAllocatedType(), UserContext,
>                           Map);
> @@ -365,7 +365,7 @@ Value *ParallelLoopGenerator::createSubF
>                          "polly.par.UBAdjusted");
> 
>   Builder.CreateBr(CheckNextBB);
> -  Builder.SetInsertPoint(--Builder.GetInsertPoint());
> +  Builder.SetInsertPoint(&*--Builder.GetInsertPoint());
>   IV = createLoop(LB, UB, Stride, Builder, P, LI, DT, AfterBB,
>                   ICmpInst::ICMP_SLE, nullptr, true, /* UseGuard */ false);
> 
> @@ -376,7 +376,7 @@ Value *ParallelLoopGenerator::createSubF
>   createCallCleanupThread();
>   Builder.CreateRetVoid();
> 
> -  Builder.SetInsertPoint(LoopBody);
> +  Builder.SetInsertPoint(&*LoopBody);
>   *SubFnPtr = SubFn;
> 
>   return IV;
> 
> Modified: polly/trunk/lib/CodeGen/RuntimeDebugBuilder.cpp
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/RuntimeDebugBuilder.cpp?rev=252357&r1=252356&r2=252357&view=diff
> ==============================================================================
> --- polly/trunk/lib/CodeGen/RuntimeDebugBuilder.cpp (original)
> +++ polly/trunk/lib/CodeGen/RuntimeDebugBuilder.cpp Fri Nov  6 16:56:54 2015
> @@ -174,7 +174,7 @@ void RuntimeDebugBuilder::createGPUPrint
>   auto T = ArrayType::get(Builder.getInt32Ty(), ToPrint.size() * 2);
>   Value *Data = new AllocaInst(
>       T, "polly.vprint.buffer",
> -      Builder.GetInsertBlock()->getParent()->getEntryBlock().begin());
> +      &Builder.GetInsertBlock()->getParent()->getEntryBlock().front());
>   auto *DataPtr = Builder.CreateGEP(Data, {Zero, Zero});
> 
>   int Offset = 0;
> 
> Modified: polly/trunk/lib/Support/ScopHelper.cpp
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Support/ScopHelper.cpp?rev=252357&r1=252356&r2=252357&view=diff
> ==============================================================================
> --- polly/trunk/lib/Support/ScopHelper.cpp (original)
> +++ polly/trunk/lib/Support/ScopHelper.cpp Fri Nov  6 16:56:54 2015
> @@ -224,7 +224,7 @@ void polly::splitEntryBlockForAlloca(Bas
>   RegionInfo *RI = RIP ? &RIP->getRegionInfo() : nullptr;
> 
>   // splitBlock updates DT, LI and RI.
> -  splitBlock(EntryBlock, I, DT, LI, RI);
> +  splitBlock(EntryBlock, &*I, DT, LI, RI);
> }
> 
> /// The SCEVExpander will __not__ generate any code for an existing SDiv/SRem
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list