[PATCH] D102978: [WebAssembly] Add TargetInstrInfo::getCalleeOperand

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 24 15:21:56 PDT 2021


aheejin added inline comments.


================
Comment at: llvm/test/CodeGen/WebAssembly/stackified-debug.ll:2
 ; RUN: llc -verify-machineinstrs < %s | FileCheck %s
+; RUN: llc --debug < %s
 ; RUN: llc -filetype=obj %s -o - | llvm-dwarfdump - | FileCheck %s --check-prefix DWARF
----------------
djtodoro wrote:
> aheejin wrote:
> > Without this patch this fails, because 
> > ```
> > %5:i32 = CALL @input, ...
> > ```
> > In this wasm MIR instruction, the callee is the 1th operand, but the current code will incorrectly [[ https://github.com/llvm/llvm-project/blob/887dda5dcdcf4a273f9c2885d147066343efd5b0/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp#L941 | assume ]] the 0th operand, which is the dest register (`%5` here), as a callee, and will try to [[ https://github.com/llvm/llvm-project/blob/887dda5dcdcf4a273f9c2885d147066343efd5b0/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp#L997-L1001 | print its register name ]], when `--debug` is given. This crashes because wasm does not use physical registers.
> I'd prefer a dedicated (standalone) test for this.
I added test/DebugInfo/WebAssembly/call-site.ll and deleted this `--debug` line. PTAL.


================
Comment at: llvm/test/DebugInfo/WebAssembly/dbg-value-list.ll:36
 !5 = !{i32 1, !"wchar_size", i32 4}
-!6 = distinct !DISubprogram(name: "", scope: !1, file: !1, line: 3, type: !7, scopeLine: 3, flags: DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0)
+!6 = distinct !DISubprogram(name: "dbg_value_list_test", scope: !1, file: !1, line: 3, type: !7, scopeLine: 3, flags: DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0)
 !7 = !DISubroutineType(types: !{null})
----------------
This is just a drive-by name fix and unrelated to this CL


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102978/new/

https://reviews.llvm.org/D102978



More information about the llvm-commits mailing list