[PATCH] D111630: [LoopVectorize][CostModel] Update cost model for fmuladd intrinsic

Rosie Sumpter via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 12 06:01:48 PDT 2021


RosieSumpter added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:7269
+    // fmul instruction to the cost of the fadd reduction.
+    Value *Op2 = I->getOperand(1);
+    TargetTransformInfo::OperandValueProperties Op2VP;
----------------
fhahn wrote:
> Could this be handled in `TTI.getArithmeticReductionCost`? What about other potential users of fmuladd reductions, like the SLP vectorizer?
Hi Florian, I did discuss this option with @david-arm, but it would mean changing the interface of ##getArithmeticReductionCost## (e.g. by adding an optional  ##Instruction*## argument) to be able to determine if it's a call to the fmuladd intrinsic.  David also made the point that the fmul isn't actually part of the reduction cost, so perhaps it doesn't make sense to ask for an fmuladd reduction cost? If you would prefer it to be there though I'm happy to make the change.

For the SLP vectorizer, it doesn't handle the fmuladd at the moment (I've added an assert for this in D111555 for safety) 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111630



More information about the llvm-commits mailing list