[PATCH] D111555: [LoopVectorize] Add strict reduction support for fmuladd intrinsic

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 18 02:53:24 PDT 2021


fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:9622
+      }
+      VPReductionRecipe *RedRecipe =
+          new VPReductionRecipe(&RdxDesc, R, ChainOp, VecOps, CondOp, TTI);
----------------
dmgreen wrote:
> Would it be possible to create a FMul VPInstruction and a VPReductionRecipe? That way the VPlan better represents the final instructions.
+1, that should hopefully help to remove some of the special handling for the `FMulAdd` from codegen.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:9807
         NewRed = State.Builder.CreateBinOp(
-            (Instruction::BinaryOps)getUnderlyingInstr()->getOpcode(),
-            PrevInChain, NewVecOp);
+            (Instruction::BinaryOps)RdxDesc->getOpcode(Kind), PrevInChain,
+            NewVecOp);
----------------
This is a nice cleanup and could be split off as simple NFC.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111555/new/

https://reviews.llvm.org/D111555



More information about the llvm-commits mailing list