[llvm] [VectorCombine] Fold vector.reduce.OP(F(X)) == 0 -> OP(X) == 0 (PR #173069)
Yingwei Zheng via llvm-commits
llvm-commits at lists.llvm.org
Sun Jan 11 03:35:51 PST 2026
================
@@ -3806,6 +3807,192 @@ bool VectorCombine::foldCastFromReductions(Instruction &I) {
return true;
}
+/// Match a non-zero and non-poison integer or a vector with all non-zero and
+/// non-poison elements.
+static cst_pred_ty<is_non_zero_int, /*AllowPoison=*/false>
+m_NonZeroNonPoisonInt() {
+ return cst_pred_ty<is_non_zero_int, /*AllowPoison=*/false>();
+}
+
+bool VectorCombine::foldICmpEqZeroVectorReduce(Instruction &I) {
+ // vector.reduce.OP f(X_i) == 0 -> vector.reduce.OP X_i == 0
----------------
dtcxzyw wrote:
Move these comments above the function.
https://github.com/llvm/llvm-project/pull/173069
More information about the llvm-commits
mailing list