[llvm] [LoopVectorizer] Add support for partial reductions (PR #92418)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 17 01:48:01 PST 2024


================
@@ -31,8 +31,8 @@ for.body:                                         ; preds = %entry, %for.body
   %arrayidx2 = getelementptr inbounds i8, ptr %b, i64 %i.iv
   %1 = load i8, ptr %arrayidx2, align 1
   %conv3 = zext i8 %1 to i64
-  %mul = mul nuw nsw i64 %conv3, %conv
-  %add = add i64 %mul, %sum
+  %div = udiv i64 %conv3, %conv
----------------
fhahn wrote:

Would be good to keep the original version as well (possibly as part of one of the `partial-reduce-...` tests) to make sure we have test coverage for the case where the cost models disagree?

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


More information about the llvm-commits mailing list