[llvm] [VectorCombine] Fold vector.reduce.OP(F(X)) == 0 -> OP(X) == 0 (PR #173069)

Valeriy Savchenko via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 16 07:51:45 PST 2026


================

----------------
SavchenkoValeriy wrote:

`InnerOp` is essentially the instruction that we remove, ie `f(X)`. If it has other uses (unless those other uses can be folded away using this transformation as well), we don't remove it.
Which I guess is OK, we just remove this use possibly unlocking sinking and other optimizations. I actually now can't think of a case where I actually need to check for the cost here. Do you have a case for it in mind?

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


More information about the llvm-commits mailing list