[llvm] [WebAssembly] Enable a limited amount of stackification for debug code (PR #136510)

Heejin Ahn via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 23 02:31:28 PDT 2025


================
@@ -0,0 +1,89 @@
+; RUN: llc < %s -O0 --filetype=obj -o - | llvm-dwarfdump - | FileCheck %s --check-prefixes DBG_USE
+
+target triple = "wasm32-unknown-unknown"
+
+declare i32 @extern_func(i32, i32)
+
+; We want to produce local DW_OP_WASM_locations in debug code instead
+; of operand stack locations since local locations are more widely
+; supported and can cover the entirety of the method.
+; DBG_USE: DW_TAG_subprogram
+; DBG_USE:   DW_AT_name ("single_non_dbg_use")
+; DBG_USE:   DW_TAG_variable
+; DBG_USE:     DW_AT_location
+; DBG_USE:       DW_OP_WASM_location 0x0
+; DBG_USE:     DW_AT_name    ("call_value")
+; DBG_USE:   DW_TAG_variable
+; DBG_USE:     DW_AT_location
+; DBG_USE:       DW_OP_WASM_location 0x0
+; DBG_USE:     DW_AT_name    ("sub_value")
----------------
aheejin wrote:

I see. Can you comment somewhere that `0x0` means a local (and not a stack (0x2)?) Some people (myself included) don't remember those numbers, so..

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


More information about the llvm-commits mailing list