[all-commits] [llvm/llvm-project] bbd61c: Fix llvm bdce debug salvage (#220900)

MrEven132 via All-commits all-commits at lists.llvm.org
Thu Sep 17 06:10:58 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bbd61cb2e932bb7734cbf034dc50a6f5835e7d77
      https://github.com/llvm/llvm-project/commit/bbd61cb2e932bb7734cbf034dc50a6f5835e7d77
  Author: MrEven132 <13554966229 at 163.com>
  Date:   2026-09-17 (Thu, 17 Sep 2026)

  Changed paths:
    M llvm/lib/Transforms/Scalar/BDCE.cpp
    A llvm/test/Transforms/BDCE/dbg-binops-multiuse.ll
    A llvm/test/Transforms/BDCE/dbg-sext-to-zext.ll

  Log Message:
  -----------
  Fix llvm bdce debug salvage (#220900)

BDCE simplifies constant-mask `and`, `or`, and `xor` instructions when
the changed bits are not demanded by program uses. It can similarly
replace a `sext` with a `zext` when none of the sign bits are demanded.
Both transformations used ordinary RAUW, which also redirected direct
debug uses to values with different meanings.

Replace only non-metadata uses when applying these optimizations. This
leaves direct debug users for BDCE's existing reverse-order salvage
pass, which reconstructs supported operations in a `DIExpression` and
makes unsupported locations unavailable.

Add regression tests covering salvage of `and`, `or`, and `xor`, the
unavailable fallback for an unrepresentable wide constant, and
preservation of signed-extension semantics when program uses receive a
`zext`.

Fixes #218890
Fixes #46640



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list