diff options
author | Jeremy Morse <jeremy.morse@sony.com> | 2025-01-27 16:27:54 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-27 16:27:54 +0000 |
commit | 81d18ad86419fc612c7071e888d11aa923eaeb8a (patch) | |
tree | 4628b92d0dfbcd9f68d90b2b030202492f5d8469 /llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp | |
parent | 5f5cdf40382f06a8c417c42ec591f97aa76eeb67 (diff) | |
download | llvm-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/Transforms/Scalar/SimpleLoopUnswitch.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp b/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp index c2f7c5d..bcc5620 100644 --- a/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp +++ b/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp @@ -770,7 +770,7 @@ static bool unswitchTrivialSwitch(Loop &L, SwitchInst &SI, DominatorTree &DT, // instruction in the block. auto *TI = BBToCheck.getTerminator(); bool isUnreachable = isa<UnreachableInst>(TI); - return !isUnreachable || BBToCheck.getFirstNonPHIOrDbg() != TI; + return !isUnreachable || &*BBToCheck.getFirstNonPHIOrDbg() != TI; }; SmallVector<int, 4> ExitCaseIndices; |