================ @@ -1031,6 +1032,22 @@ APInt llvm::possiblyDemandedEltsInMask(Value *Mask) { return DemandedElts; } +InstructionCost +llvm::getVecLibCallCost(const Instruction *I, const TargetTransformInfo *TTI, + const TargetLibraryInfo *TLI, VectorType *VecTy, + TargetTransformInfo::TargetCostKind CostKind) { + SmallVector<Type *, 4> OpTypes; + for (auto &Op : I->operands()) + OpTypes.push_back(Op->getType()); + + LibFunc Func; + if (TLI->getLibFunc(I->getOpcode(), I->getType(), Func) && + TLI->isFunctionVectorizable(TLI->getName(Func), VecTy->getElementCount())) + return TTI->getCallInstrCost(nullptr, VecTy, OpTypes, CostKind); + + return InstructionCost::getInvalid(); ---------------- paulwalker-arm wrote:
Given you've pulled this from LoopVectorize so the "hack" is easier to track I would rather you also update LoopVectorize to use it and thus verify existing behaviour is honoured. https://github.com/llvm/llvm-project/pull/82488 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits