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

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 1 02:56:10 PDT 2021


fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:9618
+            new VPInstruction(Instruction::FMul, FMulOps);
+        FMulRecipe->setUnderlyingInstr(R);
+        WidenRecipe->getParent()->insert(FMulRecipe,
----------------
david-arm wrote:
> Hi @RosieSumpter, I realise you were asked to make this change, but it also doesn't feel right to be setting an underlying instruction here because there isn't one really. The underlying instruction is the fmuladd call and is already added to the VPReductionRecipe, so adding to two recipes feels a bit dangerous? Perhaps we should be adding a new interface to VPInstruction instead that allows setting the 'FastMathFlags' for the instruction?
Agreed, we shouldn't set the underlying instruction explicitly here, visitbility is intentionally restricted. I don't think the FMF changes should be pulled into this change. Can the setting of FMFs be moved to a follow-up patch?


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

https://reviews.llvm.org/D111555



More information about the llvm-commits mailing list