[llvm-branch-commits] [llvm] [AArch64] SLP can vectorize frem (PR #82488)

Paul Walker via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Feb 22 04:34:03 PST 2024


================
@@ -869,6 +870,18 @@ TargetTransformInfo::getOperandInfo(const Value *V) {
   return {OpInfo, OpProps};
 }
 
+InstructionCost TargetTransformInfo::getVecLibCallCost(
+    const int OpCode, const TargetLibraryInfo *TLI, VectorType *VecTy,
+    TTI::TargetCostKind CostKind) {
+  Type *ScalarTy = VecTy->getScalarType();
+  LibFunc Func;
+  if (TLI->getLibFunc(OpCode, ScalarTy, Func) &&
+      TLI->isFunctionVectorizable(TLI->getName(Func), VecTy->getElementCount()))
----------------
paulwalker-arm wrote:

OK, I see what you're saying.  I guess the problem here is that we're relying on a subsequent pass (ReplaceWithVecLib) to be present in the pipeline in order to correctly cost the FREM. With neither SLP nor TTI having this knowledge?

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


More information about the llvm-branch-commits mailing list