[llvm] Use DIExpression::foldConstantMath() at the result of an appendOpsToArg() (PR #71721)

Stephen Tozer via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 22 08:27:15 PDT 2024


SLTozer wrote:

> I am unsure about what to do for DebugInfo/salvage-limit-expr-size.ll, because of this patch, there is no longer a limit of 128 salvageable instructions, because they get folded down to one instruction

In some ways, this is quite a good problem to have! I'm not well-acquainted with this patch, but if there's any kind of legal DIExpression that won't get constant-folded then you could substitute that; it looks like you've not covered all the logical operators (not, xor, etc), there are some operators that might be effectively repeatable no-ops (DW_OP_rot), and if all else fails then it should be possible to repeat `DW_OP_LLVM_arg, 0` in the expression, so that you're effectively performing `x + x + x + x + x + x +...` until you have a DIExpression of the right length.


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


More information about the llvm-commits mailing list