diff options
author | Jeremy Morse <jeremy.morse@sony.com> | 2025-01-24 13:27:56 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-24 13:27:56 +0000 |
commit | 6292a808b3524d9ba6f4ce55bc5b9e547b088dd8 (patch) | |
tree | 75d8253ec7b5085328930a26daf1f20c39682f80 /llvm/lib/Transforms/Utils/LoopSimplify.cpp | |
parent | a5cc897cdedfdca018a83fac5734ebe086acb817 (diff) | |
download | llvm-6292a808b3524d9ba6f4ce55bc5b9e547b088dd8.zip llvm-6292a808b3524d9ba6f4ce55bc5b9e547b088dd8.tar.gz llvm-6292a808b3524d9ba6f4ce55bc5b9e547b088dd8.tar.bz2 |
[NFC][DebugInfo] Use iterator-flavour getFirstNonPHI at many call-sites (#123737)
As part of the "RemoveDIs" project, BasicBlock::iterator now carries a
debug-info bit that's needed when getFirstNonPHI and similar feed into
instruction insertion positions. Call-sites where that's necessary were
updated a year ago; but to ensure some type safety however, we'd like to
have all calls to getFirstNonPHI use the iterator-returning version.
This patch changes a bunch of call-sites calling getFirstNonPHI to use
getFirstNonPHIIt, which returns an iterator. All these call sites are
where it's obviously safe to fetch the iterator then dereference it. A
follow-up patch will contain less-obviously-safe changes.
We'll eventually deprecate and remove the instruction-pointer
getFirstNonPHI, but not before adding concise documentation of what
considerations are needed (very few).
---------
Co-authored-by: Stephen Tozer <Melamoto@gmail.com>
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopSimplify.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopSimplify.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopSimplify.cpp b/llvm/lib/Transforms/Utils/LoopSimplify.cpp index b3f9f76..61ffb49 100644 --- a/llvm/lib/Transforms/Utils/LoopSimplify.cpp +++ b/llvm/lib/Transforms/Utils/LoopSimplify.cpp @@ -382,7 +382,7 @@ static BasicBlock *insertUniqueBackedgeBlock(Loop *L, BasicBlock *Preheader, BasicBlock *BEBlock = BasicBlock::Create(Header->getContext(), Header->getName() + ".backedge", F); BranchInst *BETerminator = BranchInst::Create(Header, BEBlock); - BETerminator->setDebugLoc(Header->getFirstNonPHI()->getDebugLoc()); + BETerminator->setDebugLoc(Header->getFirstNonPHIIt()->getDebugLoc()); LLVM_DEBUG(dbgs() << "LoopSimplify: Inserting unique backedge block " << BEBlock->getName() << "\n"); |