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

Kolya Panchenko via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 29 12:23:40 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);
----------------
nikolaypanchenko wrote:

We had couple of reasons to duplicate code and extend IRBuilder:
* Less changes in vectorizer and less painful to do pulldown. If VectorBuilder will be used during in VPReductionRecipe, that's not important reason anymore.
* More concrete expectations and not need to handle all variations:
** EVL != nullptr && Mask != nullptr
** EVL != nulltptr && Mask == nullptr
** EVL == nullptr && Mask == nullptr
** EVL == nullptr && Mask != nullptr
Unless there is a plan to support latter, it doesn't look good to pretend that scenario is supported.
BTW, we should really have `&EVL`

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


More information about the llvm-commits mailing list