aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/CodeGenPrepare.cpp
diff options
context:
space:
mode:
authorJeremy Morse <jeremy.morse@sony.com>2025-01-27 16:27:54 +0000
committerGitHub <noreply@github.com>2025-01-27 16:27:54 +0000
commit81d18ad86419fc612c7071e888d11aa923eaeb8a (patch)
tree4628b92d0dfbcd9f68d90b2b030202492f5d8469 /llvm/lib/CodeGen/CodeGenPrepare.cpp
parent5f5cdf40382f06a8c417c42ec591f97aa76eeb67 (diff)
downloadllvm-81d18ad86419fc612c7071e888d11aa923eaeb8a.zip
llvm-81d18ad86419fc612c7071e888d11aa923eaeb8a.tar.gz
llvm-81d18ad86419fc612c7071e888d11aa923eaeb8a.tar.bz2
[NFC][DebugInfo] Make some block-start-position methods return iterators (#124287)
As part of the "RemoveDIs" work to eliminate debug intrinsics, we're replacing methods that use Instruction*'s as positions with iterators. A number of these (such as getFirstNonPHIOrDbg) are sufficiently infrequently used that we can just replace the pointer-returning version with an iterator-returning version, hopefully without much/any disruption. Thus this patch has getFirstNonPHIOrDbg and getFirstNonPHIOrDbgOrLifetime return an iterator, and updates all call-sites. There are no concerns about the iterators returned being converted to Instruction*'s and losing the debug-info bit: because the methods skip debug intrinsics, the iterator head bit is always false anyway.
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r--llvm/lib/CodeGen/CodeGenPrepare.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index 94101cc..47486a3 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -990,7 +990,7 @@ bool CodeGenPrepare::isMergingEmptyBlockProfitable(BasicBlock *BB,
isa<IndirectBrInst>(Pred->getTerminator())))
return true;
- if (BB->getTerminator() != BB->getFirstNonPHIOrDbg())
+ if (BB->getTerminator() != &*BB->getFirstNonPHIOrDbg())
return true;
// We use a simple cost heuristic which determine skipping merging is