From 27ef2c905af1136e5f75e4308e7c6121a96e4f4f Mon Sep 17 00:00:00 2001 From: Alexander Root Date: Thu, 28 Jul 2022 22:42:12 -0400 Subject: [PATCH] don't fold saturating_sub of VectorReduce --- src/CodeGen_LLVM.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CodeGen_LLVM.cpp b/src/CodeGen_LLVM.cpp index 0b4460cb234b..84992179ff97 100644 --- a/src/CodeGen_LLVM.cpp +++ b/src/CodeGen_LLVM.cpp @@ -2832,7 +2832,7 @@ void CodeGen_LLVM::visit(const Call *op) { internal_assert(op->args.size() == 2); // Try to fold the vector reduce for a call to saturating_add - const bool folded = try_to_fold_vector_reduce(op->args[0], op->args[1]); + const bool folded = op->is_intrinsic(Call::saturating_add) && try_to_fold_vector_reduce(op->args[0], op->args[1]); if (!folded) { std::string intrin;