[PATCH] D52634: [WebAssembly] Add DBG_VALUE with local operands location in WebAssemblyExplicitLocals pass

Yury Delendik via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 13 07:00:31 PDT 2019


yurydelendik added a comment.

In D52634#1584117 <https://reviews.llvm.org/D52634#1584117>, @dschuff wrote:

> Let's work toward getting this landed!
>  @yurydelendik Your note mentioned that you reverted the breg version based on some kind of incompatibility, can you say more about that?


`breg<i> n` literally means to read register `i` content and add `n` offset (and that will be used as location address of value). What the above "breg" encoding does is it assigns reg 0 as an "virtual array" location of locals, reg 1 as a "virtual array" location of globals, etc., which makes it looks like a workaround since locals, globals or operand stack are not always stored in continues memory segments.

Incompatibilities or conflicts with the DWARF spec definitions:

1. unclear what offset `n` means - is it an index or byte offset (e.g. `8` can mean 8th local or low byte of 1th local)?
2. whole encoding scheme expresses a location address rather than a location (we can append extra DW_OP_stack_value operation thus increasing size of encoding and risking that tools might break/optimize it)

So far there no benefits to us to choose breg encoding: it is not extensible and we cannot further extend it (e.g. beyond the single `n` offset parameter). Also generic DWARF (optimization?) tools has to track that they are in a WebAssembly context to choose different logic for breg.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D52634





More information about the llvm-commits mailing list