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

Paschalis Mpeis via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Feb 22 01:37:50 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()))
----------------
paschalis-mpeis wrote:

Actually, in LoopVectorizer we have done it this way.

For the sake of reusing the code between the 2 vectorizers, I've put it in TTI, but after our discussion I've now moved it to `VectorUtils`. LoopVectorizer should now reuse this method.

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


More information about the llvm-branch-commits mailing list