[llvm] [DebugInfo] Fix crash in declare-to-assign when memcpy writes to scalable-vector alloca (PR #194107)

via llvm-commits llvm-commits at lists.llvm.org
Sat May 2 08:35:11 PDT 2026


================
@@ -16,26 +15,17 @@
 ;;   }
 ;; Compiled with: clang -target riscv64-unknown-linux-gnu -march=rv64gcv -O1 -g
 
+;; The scalable-vector alloca must not receive a DIAssignID (i.e. declare-to-assign
+;; must leave it alone), and its dbg.declare must be preserved as-is.
+; CHECK-LABEL: @get_i32x4(
+; CHECK:         = alloca <vscale x 2 x i32>, align 4
+; CHECK-SAME:    {{$}}
----------------
Michael-Chen-NJU wrote:

You're right that we should keep the #dbg_declare for %2. We verified experimentally: removing it causes the test to pass even on an unpatched build. The #dbg_declare for %r alone is not sufficient to trigger the crash.

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


More information about the llvm-commits mailing list