aboutsummaryrefslogtreecommitdiff
path: root/polly
diff options
context:
space:
mode:
authorJeremy Morse <jeremy.morse@sony.com>2024-03-19 16:36:29 +0000
committerGitHub <noreply@github.com>2024-03-19 16:36:29 +0000
commitb9d83eff254668385fd3d9d5ddb5af762f378d7f (patch)
treefa2871855343dcb93484267f2c9abda6561e8f7d /polly
parentc63a291c64852a086cb447c7078e5312aac1a05c (diff)
downloadllvm-b9d83eff254668385fd3d9d5ddb5af762f378d7f.zip
llvm-b9d83eff254668385fd3d9d5ddb5af762f378d7f.tar.gz
llvm-b9d83eff254668385fd3d9d5ddb5af762f378d7f.tar.bz2
[NFC][RemoveDIs] Use iterators for insertion at various call-sites (#84736)
These are the last remaining "trivial" changes to passes that use Instruction pointers for insertion. All of this should be NFC, it's just changing the spelling of how we identify a position. In one or two locations, I'm also switching uses of getNextNode etc to using std::next with iterators. This too should be NFC. --------- Merged by: Stephen Tozer <stephen.tozer@sony.com>
Diffstat (limited to 'polly')
-rw-r--r--polly/lib/CodeGen/IslNodeBuilder.cpp7
-rw-r--r--polly/lib/CodeGen/LoopGenerators.cpp2
-rw-r--r--polly/lib/Support/ScopHelper.cpp5
3 files changed, 8 insertions, 6 deletions
diff --git a/polly/lib/CodeGen/IslNodeBuilder.cpp b/polly/lib/CodeGen/IslNodeBuilder.cpp
index a226cc2..8b2207e 100644
--- a/polly/lib/CodeGen/IslNodeBuilder.cpp
+++ b/polly/lib/CodeGen/IslNodeBuilder.cpp
@@ -1212,7 +1212,7 @@ bool IslNodeBuilder::preloadInvariantEquivClass(
BasicBlock *EntryBB = &Builder.GetInsertBlock()->getParent()->getEntryBlock();
auto *Alloca = new AllocaInst(AccInstTy, DL.getAllocaAddrSpace(),
AccInst->getName() + ".preload.s2a",
- &*EntryBB->getFirstInsertionPt());
+ EntryBB->getFirstInsertionPt());
Builder.CreateStore(PreloadVal, Alloca);
ValueMapT PreloadedPointer;
PreloadedPointer[PreloadVal] = AccInst;
@@ -1308,10 +1308,11 @@ void IslNodeBuilder::allocateNewArrays(BBPair StartExitBlocks) {
auto InstIt = Builder.GetInsertBlock()
->getParent()
->getEntryBlock()
- .getTerminator();
+ .getTerminator()
+ ->getIterator();
auto *CreatedArray = new AllocaInst(NewArrayType, DL.getAllocaAddrSpace(),
- SAI->getName(), &*InstIt);
+ SAI->getName(), InstIt);
if (PollyTargetFirstLevelCacheLineSize)
CreatedArray->setAlignment(Align(PollyTargetFirstLevelCacheLineSize));
SAI->setBasePtr(CreatedArray);
diff --git a/polly/lib/CodeGen/LoopGenerators.cpp b/polly/lib/CodeGen/LoopGenerators.cpp
index 5c99515..b4f8bb8 100644
--- a/polly/lib/CodeGen/LoopGenerators.cpp
+++ b/polly/lib/CodeGen/LoopGenerators.cpp
@@ -225,7 +225,7 @@ ParallelLoopGenerator::storeValuesIntoStruct(SetVector<Value *> &Values) {
// 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();
+ BasicBlock::iterator IP = EntryBB.getFirstInsertionPt();
StructType *Ty = StructType::get(Builder.getContext(), Members);
AllocaInst *Struct = new AllocaInst(Ty, DL.getAllocaAddrSpace(), nullptr,
"polly.par.userContext", IP);
diff --git a/polly/lib/Support/ScopHelper.cpp b/polly/lib/Support/ScopHelper.cpp
index afdb61f..24c7011 100644
--- a/polly/lib/Support/ScopHelper.cpp
+++ b/polly/lib/Support/ScopHelper.cpp
@@ -328,8 +328,9 @@ private:
Value *LHS = expandCodeFor(LHSScev, E->getType(), IP);
Value *RHS = expandCodeFor(RHSScev, E->getType(), IP);
- Inst = BinaryOperator::Create((Instruction::BinaryOps)Inst->getOpcode(),
- LHS, RHS, Inst->getName() + Name, IP);
+ Inst =
+ BinaryOperator::Create((Instruction::BinaryOps)Inst->getOpcode(), LHS,
+ RHS, Inst->getName() + Name, IP->getIterator());
return SE.getSCEV(Inst);
}