[llvm] [InstCombine] Generalize `(A + 1) + ~B` fold to any constant (PR #188271)
Ricardo Jesus via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 8 10:01:11 PDT 2026
================
----------------
rj-jesus wrote:
Could you please also add one-use tests for `(A + C) + ~B` (assuming I didn't miss them somewhere)?
Also, the previous implementation didn't have one-use restrictions when C == 1 as the fold is always profitable in that case. Computing A - B directly in such cases is likely preferable to the more indirect (A + 1) + ~B.
https://github.com/llvm/llvm-project/pull/188271
More information about the llvm-commits
mailing list