[llvm] Use DIExpression::foldConstantMath at the result of a Salvaged expression (PR #71721)

Stephen Tozer via llvm-commits llvm-commits at lists.llvm.org
Thu May 23 04:36:53 PDT 2024


https://github.com/SLTozer commented:

> Maybe that tree can be stored in linear fashion and even produced at compile time by tablegen? Maybe this is also over-engineering the problem ;-)

Maybe just the tiniest bit 😄! But I do agree that we should have a more extensible approach to this, which could be tablegen, or any other simple declarative style.
With regards to the current design, it seems suitable for a first pass. In fact, if I were to suggest a further (non-arithmetic) pattern, I think that replacing patterns of consecutive `DW_OP_LLVM_convert` would be a very effective way to reduce expression sizes during compilation - off the top of my head I don't believe the "types" mean anything, we just emit them as truncations (e.g. `DW_OP_constu 0x0000ffff, DW_OP_and`) at the end of compilation, and we sometimes end up with a lot of converts after salvaging, which results in slower expression processing and some debug values being dropped.

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


More information about the llvm-commits mailing list