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

Alexey Bataev via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Feb 22 04:20:31 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()))
----------------
alexey-bataev wrote:

It does not known what transsformation is doing, it does exactly what you said - estimates the cost of the target-specific code. WE're not emitting frem calls directly, we're still emitting regular frem vector code, which is then lowered specifically for ARM. And target specific TTI should be aware of this.

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


More information about the llvm-branch-commits mailing list