summaryrefslogtreecommitdiff
path: root/llvm/lib/Target/AMDGPU/SIAnnotateControlFlow.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/Target/AMDGPU/SIAnnotateControlFlow.cpp
parent5f5cdf40382f06a8c417c42ec591f97aa76eeb67 (diff)
[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/Target/AMDGPU/SIAnnotateControlFlow.cpp')
-rw-r--r--llvm/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp b/llvm/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp
index 4ff6fc32b642..df0c2080e079 100644
--- a/llvm/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp
+++ b/llvm/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp
@@ -232,7 +232,7 @@ Value *SIAnnotateControlFlow::handleLoopCondition(
} else if (L->contains(Inst)) {
Insert = Term;
} else {
- Insert = L->getHeader()->getFirstNonPHIOrDbgOrLifetime();
+ Insert = &*L->getHeader()->getFirstNonPHIOrDbgOrLifetime();
}
return CreateBreak(Insert);
@@ -247,7 +247,7 @@ Value *SIAnnotateControlFlow::handleLoopCondition(
}
if (isa<Argument>(Cond)) {
- Instruction *Insert = L->getHeader()->getFirstNonPHIOrDbgOrLifetime();
+ Instruction *Insert = &*L->getHeader()->getFirstNonPHIOrDbgOrLifetime();
return CreateBreak(Insert);
}