@@ -165,10 +165,10 @@ void polly::simplifyRegion(Region *R, DominatorTree *DT, LoopInfo *LI,
165165// Split the block into two successive blocks.
166166//
167167// Like llvm::SplitBlock, but also preserves RegionInfo
168- static BasicBlock *splitBlock (BasicBlock *Old, Instruction * SplitPt,
168+ static BasicBlock *splitBlock (BasicBlock *Old, BasicBlock::iterator SplitPt,
169169 DominatorTree *DT, llvm::LoopInfo *LI,
170170 RegionInfo *RI) {
171- assert (Old && SplitPt );
171+ assert (Old);
172172
173173 // Before:
174174 //
@@ -203,7 +203,7 @@ void polly::splitEntryBlockForAlloca(BasicBlock *EntryBlock, DominatorTree *DT,
203203 ++I;
204204
205205 // splitBlock updates DT, LI and RI.
206- splitBlock (EntryBlock, &* I, DT, LI, RI);
206+ splitBlock (EntryBlock, I, DT, LI, RI);
207207}
208208
209209void polly::splitEntryBlockForAlloca (BasicBlock *EntryBlock, Pass *P) {
@@ -261,8 +261,8 @@ struct ScopExpander final : SCEVVisitor<ScopExpander, const SCEV *> {
261261 VMap(VMap), LoopMap(LoopMap), RTCBB(RTCBB), GenSE(GenSE), GenFn(GenFn) {
262262 }
263263
264- Value *expandCodeFor (const SCEV *E, Type *Ty, Instruction * IP) {
265- assert (isInGenRegion (IP) &&
264+ Value *expandCodeFor (const SCEV *E, Type *Ty, BasicBlock::iterator IP) {
265+ assert (isInGenRegion (&* IP) &&
266266 " ScopExpander assumes to be applied to generated code region" );
267267 const SCEV *GenE = visit (E);
268268 return Expander.expandCodeFor (GenE, Ty, IP);
@@ -305,7 +305,7 @@ struct ScopExpander final : SCEVVisitor<ScopExpander, const SCEV *> {
305305 bool isInGenRegion (Instruction *Inst) { return !isInOrigRegion (Inst); }
306306
307307 const SCEV *visitGenericInst (const SCEVUnknown *E, Instruction *Inst,
308- Instruction * IP) {
308+ BasicBlock::iterator IP) {
309309 if (!Inst || isInGenRegion (Inst))
310310 return E;
311311
@@ -321,7 +321,7 @@ struct ScopExpander final : SCEVVisitor<ScopExpander, const SCEV *> {
321321 }
322322
323323 InstClone->setName (Name + Inst->getName ());
324- InstClone->insertBefore (IP-> getIterator () );
324+ InstClone->insertBefore (IP);
325325 return GenSE.getSCEV (InstClone);
326326 }
327327
@@ -341,19 +341,19 @@ struct ScopExpander final : SCEVVisitor<ScopExpander, const SCEV *> {
341341 }
342342
343343 Instruction *Inst = dyn_cast<Instruction>(E->getValue ());
344- Instruction * IP;
344+ BasicBlock::iterator IP;
345345 if (Inst && isInGenRegion (Inst))
346- IP = Inst;
346+ IP = Inst-> getIterator () ;
347347 else if (R.getEntry ()->getParent () != GenFn) {
348348 // RTCBB is in the original function, but we are generating for a
349349 // subfunction so we cannot emit to RTCBB. Usually, we land here only
350350 // because E->getValue() is not an instruction but a global or constant
351351 // which do not need to emit anything.
352- IP = GenFn->getEntryBlock ().getTerminator ();
352+ IP = GenFn->getEntryBlock ().getTerminator ()-> getIterator () ;
353353 } else if (Inst && RTCBB->getParent () == Inst->getFunction ())
354- IP = RTCBB->getTerminator ();
354+ IP = RTCBB->getTerminator ()-> getIterator () ;
355355 else
356- IP = RTCBB->getParent ()->getEntryBlock ().getTerminator ();
356+ IP = RTCBB->getParent ()->getEntryBlock ().getTerminator ()-> getIterator () ;
357357
358358 if (!Inst || (Inst->getOpcode () != Instruction::SRem &&
359359 Inst->getOpcode () != Instruction::SDiv))
@@ -368,9 +368,8 @@ struct ScopExpander final : SCEVVisitor<ScopExpander, const SCEV *> {
368368 Value *LHS = expandCodeFor (LHSScev, E->getType (), IP);
369369 Value *RHS = expandCodeFor (RHSScev, E->getType (), IP);
370370
371- Inst =
372- BinaryOperator::Create ((Instruction::BinaryOps)Inst->getOpcode (), LHS,
373- RHS, Inst->getName () + Name, IP->getIterator ());
371+ Inst = BinaryOperator::Create ((Instruction::BinaryOps)Inst->getOpcode (),
372+ LHS, RHS, Inst->getName () + Name, IP);
374373 return GenSE.getSCEV (Inst);
375374 }
376375
@@ -465,7 +464,7 @@ struct ScopExpander final : SCEVVisitor<ScopExpander, const SCEV *> {
465464Value *polly::expandCodeFor (Scop &S, llvm::ScalarEvolution &SE,
466465 llvm::Function *GenFn, ScalarEvolution &GenSE,
467466 const DataLayout &DL, const char *Name,
468- const SCEV *E, Type *Ty, Instruction * IP,
467+ const SCEV *E, Type *Ty, BasicBlock::iterator IP,
469468 ValueMapT *VMap, LoopToScevMapT *LoopMap,
470469 BasicBlock *RTCBB) {
471470 ScopExpander Expander (S.getRegion (), SE, GenFn, GenSE, DL, Name, VMap,
0 commit comments