[llvm] [LV][EVL] Support in-loop reduction using tail folding with EVL. (PR #90184)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 26 02:54:45 PDT 2024


================
@@ -422,6 +436,11 @@ CallInst *IRBuilderBase::CreateFAddReduce(Value *Acc, Value *Src) {
   return CreateCall(Decl, Ops);
 }
 
+CallInst *IRBuilderBase::CreateFAddReduce(Value *Acc, Value *Src, Value *EVL,
+                                          Value *Mask) {
+  return getReductionIntrinsic(Intrinsic::vp_reduce_fadd, Acc, Src, Mask, EVL);
----------------
fhahn wrote:

Can we avoid this duplication here by providing a builder that provides an API to create an fadd reduction, which either creates `vector_reduce_fadd` if no mask or EVL has been provided and `vp_reduce_fadd` if mask and EVL has been provided, e.g. by extending `VectorBuilder`?

Then at least the complexity would be unified at a single place.


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


More information about the llvm-commits mailing list