[llvm] Add new llvm.dbg.declare_value intrinsic. (PR #168132)

Jeremy Morse via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 21 02:32:16 PST 2025


================
@@ -0,0 +1,39 @@
+; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
+
+; CHECK: #dbg_declare_value(double %{{[0-9]+}}, !{{[0-9]+}}, !DIExpression(), !{{[0-9]+}})
+
+; ModuleID = '/tmp/test.c'
+source_filename = "/tmp/test.c"
+target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32"
+target triple = "arm64-apple-macosx26.0.0"
+
+; Function Attrs: noinline nounwind optnone ssp uwtable(sync)
+define void @foo(double noundef %0) #0 !dbg !9 {
+    #dbg_declare_value(double %0, !15, !DIExpression(), !16)
+  ret void, !dbg !21
+}
+
+attributes #0 = { noinline nounwind optnone ssp uwtable(sync) "frame-pointer"="non-leaf-no-reserve" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="apple-m1" "target-features"="+aes,+altnzcv,+ccdp,+ccidx,+ccpp,+complxnum,+crc,+dit,+dotprod,+flagm,+fp-armv8,+fp16fml,+fptoint,+fullfp16,+jsconv,+lse,+neon,+pauth,+perfmon,+predres,+ras,+rcpc,+rdm,+sb,+sha2,+sha3,+specrestrict,+ssbs,+v8.1a,+v8.2a,+v8.3a,+v8.4a,+v8a" }
----------------
jmorse wrote:

Typically we don't want to keep attributes around as they're a needless maintenance burden, unless they have an effect here.

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


More information about the llvm-commits mailing list