[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 Jul 5 10:48:30 PDT 2024


================
@@ -57,7 +57,59 @@ Value *VectorBuilder::createVectorInstruction(unsigned Opcode, Type *ReturnTy,
   auto VPID = VPIntrinsic::getForOpcode(Opcode);
   if (VPID == Intrinsic::not_intrinsic)
     return returnWithError<Value *>("No VPIntrinsic for this opcode");
+  return createVectorInstructionImpl(VPID, ReturnTy, InstOpArray, Name);
+}
+
+Value *VectorBuilder::createSimpleTargetReduction(RecurKind Kind, Type *ValTy,
+                                                  ArrayRef<Value *> InstOpArray,
+                                                  const Twine &Name) {
+  auto GetForRecurKind = [](RecurKind Kind) {
----------------
fhahn wrote:

I guess it would reduce the level of indent and `ID = Intrinsic::vp_reduce_add` is also more compact than `return Intrinsic::vp_reduce_add`

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


More information about the llvm-commits mailing list