[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 May 3 06:31:46 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:

> More concrete expectations and not need to handle all variations:

Even with the general builder, not all combinations would need to be handled (at least initially).

But wouldn't it be sufficient to handle the case where VP intrinsics are generated and the one where regular intrinsics are generated? When !EVL && Mask, `EVL = VF `could be used, similarly if EVL && !Mask, `Mask = splat true`? (At least the latter is done now manually I think in the LV code)



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


More information about the llvm-commits mailing list