[llvm] [AMDGPU] Avoid dangling SSAUpdater reference in PromoteAlloca full-vector store (PR #215686)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 18 13:46:42 PDT 2026


================
@@ -27,3 +27,29 @@ define void @alloca_value_cross_reference() {
   store float 0.000000e+00, ptr addrspace(5) %p, align 4
   ret void
 }
+
+; The full-vector store in %bb2 forwards %v (a load from the same alloca in a
+; dominating block) as bb2's live-out value. If the pass visits bb2 before
+; entry, it hands the not-yet-replaced load to the SSAUpdater; the load is
+; later deleted while the SSAUpdater still references it, causing a crash.
+; The full-vector store now always creates a fresh value so the SSAUpdater
+; never holds a pointer to a worklist instruction.
+define half @forwarded_load_across_blocks() {
+; CHECK-LABEL: define half @forwarded_load_across_blocks()
+; CHECK-NOT: alloca
----------------
arsenm wrote:

Use positive checks 

https://github.com/llvm/llvm-project/pull/215686


More information about the llvm-commits mailing list