[all-commits] [llvm/llvm-project] e9ea7a: [WebAssembly] Use LiveDebugValues analysis

Heejin Ahn via All-commits all-commits at lists.llvm.org
Tue Jan 10 09:55:52 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e9ea7a0e20c27dc080dc16dc4b7c5c104801fe69
      https://github.com/llvm/llvm-project/commit/e9ea7a0e20c27dc080dc16dc4b7c5c104801fe69
  Author: Heejin Ahn <aheejin at gmail.com>
  Date:   2023-01-10 (Tue, 10 Jan 2023)

  Changed paths:
    M llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp
    M llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp
    A llvm/test/DebugInfo/WebAssembly/live-debug-values.mir

  Log Message:
  -----------
  [WebAssembly] Use LiveDebugValues analysis

This enables `LiveDebugValues` analysis for Wasm. `DBG_VALUE`s expire at
the end of a BB, and this is the analysis extends their lifetime when
possible, greatly increasing the coverage of variable debug info.

Specifically, this removes the current constraint that this analysis is
only used with physical registers, which was first introduced in D18421,
because Wasm uses only virtual registers. I don't think there's anything
inherent in this analysis that only applies to physical registers; it
was just because all targets using this analysis ran this at the end of
their compiliation pipeline, at which point all their vregs had been
allocated, and Wasm's debug info infrastructure was not really set up
yet, so it was not using it.

This adds supports to Wasm-specific target-index operands, defined in
https://github.com/llvm/llvm-project/blob/2166d9529a60d1cdedb733d2e4134c971f0969ec/llvm/lib/Target/WebAssembly/WebAssembly.h#L87-L100.
Among these, `TI_LOCAL`, `TI_LOCAL_INDIRECT`, and `TI_OPERAND_STACK` are
used by Wasm `DBG_VALUE` instructions.

This does not yet handle mutable target indices, i.e., this does not
terminate a `DBG_VALUE` for a local index when we encounter a new
`local.set` or `local.tee`. It will be implemented as a follow-up.

Reviewed By: dschuff, jmorse

Differential Revision: https://reviews.llvm.org/D138943




More information about the All-commits mailing list