[llvm] [InstCombine] Add optimization to combine adds through zext nneg, and add testcase (PR #157723)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 12 01:20:42 PDT 2025


https://github.com/nikic requested changes to this pull request.

This is missing the precondition that the inner constant must be negative.

Can you please add a generalized proof? See https://llvm.org/docs/InstCombineContributorGuide.html#use-generic-values-in-proofs.

Also we don't need the constants to exactly cancel, something like this is also profitable: https://alive2.llvm.org/ce/z/pT89U9 (Though this one would need a one-use check.)

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


More information about the llvm-commits mailing list