[llvm] [DebugInfo][Reassociate] Preserve `fmul`/`fdiv` debug info by wrapping with `DW_OP_neg` when the constant is sign-flipped (PR #224898)

via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 21 04:57:56 PDT 2026


MrEven132 wrote:

I have updated the PR to fix https://github.com/cuhk-s3/Archer/issues/29.

Reassociate now checks whether each matching `DIArgList` operand is actually referenced by a corresponding `DW_OP_LLVM_arg` before calling `DIExpression::appendOpsToArg`. Unreferenced operands are left unchanged, so the pass neither triggers the assertion nor invents semantics for malformed debug information.

I do not expect a `DIArgList` with one or more location operands lacking corresponding `DW_OP_LLVM_arg` references to occur in a real-world compilation, so I did not add a regression test for that malformed case. I did add coverage for the valid case where the same location operand is referenced multiple times.

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


More information about the llvm-commits mailing list