[PATCH] D132872: [SLP] Account for loss due to FMAs when estimating fmul costs.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 30 07:10:46 PDT 2022


fhahn marked an inline comment as done.
fhahn added a comment.





================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:6449-6450
+          NumScalarFusable +=
+              TTI->getIntrinsicInstrCost(ICA, TTI::TCK_RecipThroughput) ==
+              TargetTransformInfo::TCC_Basic;
+        }
----------------
ABataev wrote:
> The cost-based analysis may lead to the wrong final decision here, need to return something like a flag instead or implement this analysis in TTI. What if the cost of Intrinsic::fmuladd != TCC_Basic?
Thanks! Updated the code to check if the the cost of the scalar FMA is <= the cost of the scalar FMUL. I think that should indicate whether we can consider the FMUL as free if the FMA is used instead FMUL + FADD.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132872



More information about the llvm-commits mailing list