[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
Wed Sep 17 03:51:39 PDT 2025


nikic wrote:

> Updated proof: https://alive2.llvm.org/ce/z/T2BmZj

This proof is not correct? src and tgt are the same here.

I believe this is a translation of your preconditions: https://alive2.llvm.org/ce/z/nrK53A It shows that they are not correct. Even if the addition result is a signed i8, the fact that the original constant is larger is a problem.

This variant works: https://alive2.llvm.org/ce/z/5geVhA

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


More information about the llvm-commits mailing list