summaryrefslogtreecommitdiff
path: root/llvm/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp
diff options
context:
space:
mode:
authorValery Pykhtin <valery.pykhtin@gmail.com>2024-05-02 12:59:31 +0200
committerGitHub <noreply@github.com>2024-05-02 12:59:31 +0200
commit981aa6fcf68ffda877f19c8d59003c067cc6ef4b (patch)
treef058875e2e6adf111f7e7ffc7ad14493170217e6 /llvm/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp
parent2252c5c42b95dd12dda0c7fb1b2811f943b21949 (diff)
[AMDGPU] Fix incorrect stepping in gdb for amdgcn.end.cf intrinsic. (#83010)
After #73958 gdb.rocm/lane-execution.exp test started to fail due to incorrect debug location. This is kind of a revert patch.
Diffstat (limited to 'llvm/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp')
-rw-r--r--llvm/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp b/llvm/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp
index 58214f30bb8d..08e1d6b87b0d 100644
--- a/llvm/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp
+++ b/llvm/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp
@@ -336,8 +336,12 @@ bool SIAnnotateControlFlow::closeControlFlow(BasicBlock *BB) {
// Split edge to make Def dominate Use
FirstInsertionPt = SplitEdge(DefBB, BB, DT, LI)->getFirstInsertionPt();
}
- IRBuilder<>(FirstInsertionPt->getParent(), FirstInsertionPt)
- .CreateCall(EndCf, {Exec});
+ IRBuilder<> IRB(FirstInsertionPt->getParent(), FirstInsertionPt);
+ // TODO: StructurizeCFG 'Flow' blocks have debug locations from the
+ // condition, for now just avoid copying these DebugLocs so that stepping
+ // out of the then/else block in a debugger doesn't step to the condition.
+ IRB.SetCurrentDebugLocation(DebugLoc());
+ IRB.CreateCall(EndCf, {Exec});
}
return true;