[llvm] [VectorCombine] Fold (icmp eq/ne (reduce.add X), 0) to reduce.umax (PR #180001)
Valeriy Savchenko via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 11 07:49:05 PST 2026
SavchenkoValeriy wrote:
The code looks more or less good for me now, but the proofs are not actually checking the logic of the transformation. We are not checking only the cases when the input is either 0 or 1, we have a more sophisticated logic. Essentially if you can write assertions that `reduce_add` doesn't wrap, that would be ideal. Plus we need to check negative cases as well since you support them.
About the matrix, `eq` implies `ne`, so that is not really necessary. And we have proofs about or/umax equivalence for some other changes. The core thing to check ALL cases for the transformation that we care about.
I'm also curious about signed comparisons, I guess they are true due to the fact that we either look at all positive or all negative values. So I would actually split the proofs on that precondition.
https://github.com/llvm/llvm-project/pull/180001
More information about the llvm-commits
mailing list