Lines Matching refs:TargetTransformInfo
1 //===- llvm/Analysis/TargetTransformInfo.cpp ------------------------------===//
9 #include "llvm/Analysis/TargetTransformInfo.h"
202 TargetTransformInfo::TargetTransformInfo(const DataLayout &DL)
205 TargetTransformInfo::~TargetTransformInfo() = default;
207 TargetTransformInfo::TargetTransformInfo(TargetTransformInfo &&Arg)
210 TargetTransformInfo &TargetTransformInfo::operator=(TargetTransformInfo &&RHS) {
215 unsigned TargetTransformInfo::getInliningThresholdMultiplier() const {
220 TargetTransformInfo::getInliningCostBenefitAnalysisSavingsMultiplier() const {
225 TargetTransformInfo::getInliningCostBenefitAnalysisProfitableMultiplier()
230 int TargetTransformInfo::getInliningLastCallToStaticBonus() const {
235 TargetTransformInfo::adjustInliningThreshold(const CallBase *CB) const {
239 unsigned TargetTransformInfo::getCallerAllocaCost(const CallBase *CB,
244 int TargetTransformInfo::getInlinerVectorBonusPercent() const {
248 InstructionCost TargetTransformInfo::getGEPCost(
254 InstructionCost TargetTransformInfo::getPointersChainCost(
263 unsigned TargetTransformInfo::getEstimatedNumberOfCaseClusters(
270 TargetTransformInfo::getInstructionCost(const User *U,
279 BranchProbability TargetTransformInfo::getPredictableBranchThreshold() const {
285 InstructionCost TargetTransformInfo::getBranchMispredictPenalty() const {
289 bool TargetTransformInfo::hasBranchDivergence(const Function *F) const {
293 bool TargetTransformInfo::isSourceOfDivergence(const Value *V) const {
301 bool llvm::TargetTransformInfo::isAlwaysUniform(const Value *V) const {
305 bool llvm::TargetTransformInfo::isValidAddrSpaceCast(unsigned FromAS,
310 bool llvm::TargetTransformInfo::addrspacesMayAlias(unsigned FromAS,
315 unsigned TargetTransformInfo::getFlatAddressSpace() const {
319 bool TargetTransformInfo::collectFlatAddressOperands(
324 bool TargetTransformInfo::isNoopAddrSpaceCast(unsigned FromAS,
329 bool TargetTransformInfo::canHaveNonUndefGlobalInitializerInAddressSpace(
334 unsigned TargetTransformInfo::getAssumedAddrSpace(const Value *V) const {
338 bool TargetTransformInfo::isSingleThreaded() const {
343 TargetTransformInfo::getPredicatedAddrSpace(const Value *V) const {
347 Value *TargetTransformInfo::rewriteIntrinsicWithAddressSpace(
352 bool TargetTransformInfo::isLoweredToCall(const Function *F) const {
356 bool TargetTransformInfo::isHardwareLoopProfitable(
362 unsigned TargetTransformInfo::getEpilogueVectorizationMinVF() const {
366 bool TargetTransformInfo::preferPredicateOverEpilogue(
371 TailFoldingStyle TargetTransformInfo::getPreferredTailFoldingStyle(
377 TargetTransformInfo::instCombineIntrinsic(InstCombiner &IC,
382 std::optional<Value *> TargetTransformInfo::simplifyDemandedUseBitsIntrinsic(
389 std::optional<Value *> TargetTransformInfo::simplifyDemandedVectorEltsIntrinsic(
399 void TargetTransformInfo::getUnrollingPreferences(
405 void TargetTransformInfo::getPeelingPreferences(Loop *L, ScalarEvolution &SE,
410 bool TargetTransformInfo::isLegalAddImmediate(int64_t Imm) const {
414 bool TargetTransformInfo::isLegalAddScalableImmediate(int64_t Imm) const {
418 bool TargetTransformInfo::isLegalICmpImmediate(int64_t Imm) const {
422 bool TargetTransformInfo::isLegalAddressingMode(Type *Ty, GlobalValue *BaseGV,
432 bool TargetTransformInfo::isLSRCostLess(const LSRCost &C1,
437 bool TargetTransformInfo::isNumRegsMajorCostOfLSR() const {
441 bool TargetTransformInfo::shouldDropLSRSolutionIfLessProfitable() const {
445 bool TargetTransformInfo::isProfitableLSRChainElement(Instruction *I) const {
449 bool TargetTransformInfo::canMacroFuseCmp() const {
453 bool TargetTransformInfo::canSaveCmp(Loop *L, BranchInst **BI,
461 TargetTransformInfo::getPreferredAddressingMode(const Loop *L,
466 bool TargetTransformInfo::isLegalMaskedStore(Type *DataType,
471 bool TargetTransformInfo::isLegalMaskedLoad(Type *DataType,
476 bool TargetTransformInfo::isLegalNTStore(Type *DataType,
481 bool TargetTransformInfo::isLegalNTLoad(Type *DataType, Align Alignment) const {
485 bool TargetTransformInfo::isLegalBroadcastLoad(Type *ElementTy,
490 bool TargetTransformInfo::isLegalMaskedGather(Type *DataType,
495 bool TargetTransformInfo::isLegalAltInstr(
501 bool TargetTransformInfo::isLegalMaskedScatter(Type *DataType,
506 bool TargetTransformInfo::forceScalarizeMaskedGather(VectorType *DataType,
511 bool TargetTransformInfo::forceScalarizeMaskedScatter(VectorType *DataType,
516 bool TargetTransformInfo::isLegalMaskedCompressStore(Type *DataType,
521 bool TargetTransformInfo::isLegalMaskedExpandLoad(Type *DataType,
526 bool TargetTransformInfo::isLegalStridedLoadStore(Type *DataType,
531 bool TargetTransformInfo::isLegalInterleavedAccessType(
538 bool TargetTransformInfo::isLegalMaskedVectorHistogram(Type *AddrType,
543 bool TargetTransformInfo::enableOrderedReductions() const {
547 bool TargetTransformInfo::hasDivRemOp(Type *DataType, bool IsSigned) const {
551 bool TargetTransformInfo::hasVolatileVariant(Instruction *I,
556 bool TargetTransformInfo::prefersVectorizedAddressing() const {
560 InstructionCost TargetTransformInfo::getScalingFactorCost(
569 bool TargetTransformInfo::LSRWithInstrQueries() const {
573 bool TargetTransformInfo::isTruncateFree(Type *Ty1, Type *Ty2) const {
577 bool TargetTransformInfo::isProfitableToHoist(Instruction *I) const {
581 bool TargetTransformInfo::useAA() const { return TTIImpl->useAA(); }
583 bool TargetTransformInfo::isTypeLegal(Type *Ty) const {
587 unsigned TargetTransformInfo::getRegUsageForType(Type *Ty) const {
591 bool TargetTransformInfo::shouldBuildLookupTables() const {
595 bool TargetTransformInfo::shouldBuildLookupTablesForConstant(
600 bool TargetTransformInfo::shouldBuildRelLookupTables() const {
604 bool TargetTransformInfo::useColdCCForColdCall(Function &F) const {
608 bool TargetTransformInfo::isTargetIntrinsicTriviallyScalarizable(
613 bool TargetTransformInfo::isTargetIntrinsicWithScalarOpAtArg(
618 bool TargetTransformInfo::isTargetIntrinsicWithOverloadTypeAtArg(
623 bool TargetTransformInfo::isTargetIntrinsicWithStructReturnOverloadAtField(
628 InstructionCost TargetTransformInfo::getScalarizationOverhead(
635 InstructionCost TargetTransformInfo::getOperandsScalarizationOverhead(
641 bool TargetTransformInfo::supportsEfficientVectorElementLoadStore() const {
645 bool TargetTransformInfo::supportsTailCalls() const {
649 bool TargetTransformInfo::supportsTailCallFor(const CallBase *CB) const {
653 bool TargetTransformInfo::enableAggressiveInterleaving(
658 TargetTransformInfo::MemCmpExpansionOptions
659 TargetTransformInfo::enableMemCmpExpansion(bool OptSize, bool IsZeroCmp) const {
663 bool TargetTransformInfo::enableSelectOptimize() const {
667 bool TargetTransformInfo::shouldTreatInstructionLikeSelect(
672 bool TargetTransformInfo::enableInterleavedAccessVectorization() const {
676 bool TargetTransformInfo::enableMaskedInterleavedAccessVectorization() const {
680 bool TargetTransformInfo::isFPVectorizationPotentiallyUnsafe() const {
685 TargetTransformInfo::allowsMisalignedMemoryAccesses(LLVMContext &Context,
694 TargetTransformInfo::PopcntSupportKind
695 TargetTransformInfo::getPopcntSupport(unsigned IntTyWidthInBit) const {
699 bool TargetTransformInfo::haveFastSqrt(Type *Ty) const {
703 bool TargetTransformInfo::isExpensiveToSpeculativelyExecute(
708 bool TargetTransformInfo::isFCmpOrdCheaperThanFCmpZero(Type *Ty) const {
712 InstructionCost TargetTransformInfo::getFPOpCost(Type *Ty) const {
718 InstructionCost TargetTransformInfo::getIntImmCodeSizeCost(unsigned Opcode,
728 TargetTransformInfo::getIntImmCost(const APInt &Imm, Type *Ty,
735 InstructionCost TargetTransformInfo::getIntImmCostInst(
745 TargetTransformInfo::getIntImmCostIntrin(Intrinsic::ID IID, unsigned Idx,
754 bool TargetTransformInfo::preferToKeepConstantsAttached(
759 unsigned TargetTransformInfo::getNumberOfRegisters(unsigned ClassID) const {
763 bool TargetTransformInfo::hasConditionalLoadStoreForType(Type *Ty) const {
767 unsigned TargetTransformInfo::getRegisterClassForType(bool Vector,
772 const char *TargetTransformInfo::getRegisterClassName(unsigned ClassID) const {
776 TypeSize TargetTransformInfo::getRegisterBitWidth(
777 TargetTransformInfo::RegisterKind K) const {
781 unsigned TargetTransformInfo::getMinVectorRegisterBitWidth() const {
785 std::optional<unsigned> TargetTransformInfo::getMaxVScale() const {
789 std::optional<unsigned> TargetTransformInfo::getVScaleForTuning() const {
793 bool TargetTransformInfo::isVScaleKnownToBeAPowerOfTwo() const {
797 bool TargetTransformInfo::shouldMaximizeVectorBandwidth(
798 TargetTransformInfo::RegisterKind K) const {
802 ElementCount TargetTransformInfo::getMinimumVF(unsigned ElemWidth,
807 unsigned TargetTransformInfo::getMaximumVF(unsigned ElemWidth,
812 unsigned TargetTransformInfo::getStoreMinimumVF(unsigned VF, Type *ScalarMemTy,
817 bool TargetTransformInfo::shouldConsiderAddressTypePromotion(
823 unsigned TargetTransformInfo::getCacheLineSize() const {
829 TargetTransformInfo::getCacheSize(CacheLevel Level) const {
834 TargetTransformInfo::getCacheAssociativity(CacheLevel Level) const {
838 std::optional<unsigned> TargetTransformInfo::getMinPageSize() const {
843 unsigned TargetTransformInfo::getPrefetchDistance() const {
847 unsigned TargetTransformInfo::getMinPrefetchStride(
854 unsigned TargetTransformInfo::getMaxPrefetchIterationsAhead() const {
858 bool TargetTransformInfo::enableWritePrefetching() const {
862 bool TargetTransformInfo::shouldPrefetchAddressSpace(unsigned AS) const {
866 InstructionCost TargetTransformInfo::getPartialReductionCost(
875 unsigned TargetTransformInfo::getMaxInterleaveFactor(ElementCount VF) const {
879 TargetTransformInfo::OperandValueInfo
880 TargetTransformInfo::getOperandInfo(const Value *V) {
940 InstructionCost TargetTransformInfo::getArithmeticInstrCost(
967 InstructionCost TargetTransformInfo::getAltInstrCost(
976 InstructionCost TargetTransformInfo::getShuffleCost(
986 TargetTransformInfo::PartialReductionExtendKind
987 TargetTransformInfo::getPartialReductionExtendKind(Instruction *I) {
996 TargetTransformInfo::getCastContextHint(const Instruction *I) {
1039 InstructionCost TargetTransformInfo::getCastInstrCost(
1050 InstructionCost TargetTransformInfo::getExtractWithExtendCost(
1058 InstructionCost TargetTransformInfo::getCFInstrCost(
1067 InstructionCost TargetTransformInfo::getCmpSelInstrCost(
1079 InstructionCost TargetTransformInfo::getVectorInstrCost(
1091 InstructionCost TargetTransformInfo::getVectorInstrCost(
1105 TargetTransformInfo::getVectorInstrCost(const Instruction &I, Type *Val,
1116 InstructionCost TargetTransformInfo::getReplicationShuffleCost(
1125 InstructionCost TargetTransformInfo::getMemoryOpCost(
1137 InstructionCost TargetTransformInfo::getMaskedMemoryOpCost(
1146 InstructionCost TargetTransformInfo::getGatherScatterOpCost(
1156 InstructionCost TargetTransformInfo::getStridedMemoryOpCost(
1165 InstructionCost TargetTransformInfo::getInterleavedMemoryOpCost(
1177 TargetTransformInfo::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
1185 TargetTransformInfo::getCallInstrCost(Function *F, Type *RetTy,
1193 unsigned TargetTransformInfo::getNumberOfParts(Type *Tp) const {
1198 TargetTransformInfo::getAddressComputationCost(Type *Tp, ScalarEvolution *SE,
1205 InstructionCost TargetTransformInfo::getMemcpyCost(const Instruction *I) const {
1211 uint64_t TargetTransformInfo::getMaxMemIntrinsicInlineSizeThreshold() const {
1215 InstructionCost TargetTransformInfo::getArithmeticReductionCost(
1224 InstructionCost TargetTransformInfo::getMinMaxReductionCost(
1233 InstructionCost TargetTransformInfo::getExtendedReductionCost(
1240 InstructionCost TargetTransformInfo::getMulAccReductionCost(
1247 TargetTransformInfo::getCostOfKeepingLiveOverCall(ArrayRef<Type *> Tys) const {
1251 bool TargetTransformInfo::getTgtMemIntrinsic(IntrinsicInst *Inst,
1256 unsigned TargetTransformInfo::getAtomicMemIntrinsicMaxElementSize() const {
1260 Value *TargetTransformInfo::getOrCreateResultFromMemIntrinsic(
1265 Type *TargetTransformInfo::getMemcpyLoopLoweringType(
1274 void TargetTransformInfo::getMemcpyLoopResidualLoweringType(
1284 bool TargetTransformInfo::areInlineCompatible(const Function *Caller,
1290 TargetTransformInfo::getInlineCallPenalty(const Function *F,
1296 bool TargetTransformInfo::areTypesABICompatible(
1302 bool TargetTransformInfo::isIndexedLoadLegal(MemIndexedMode Mode,
1307 bool TargetTransformInfo::isIndexedStoreLegal(MemIndexedMode Mode,
1312 unsigned TargetTransformInfo::getLoadStoreVecRegBitWidth(unsigned AS) const {
1316 bool TargetTransformInfo::isLegalToVectorizeLoad(LoadInst *LI) const {
1320 bool TargetTransformInfo::isLegalToVectorizeStore(StoreInst *SI) const {
1324 bool TargetTransformInfo::isLegalToVectorizeLoadChain(
1330 bool TargetTransformInfo::isLegalToVectorizeStoreChain(
1336 bool TargetTransformInfo::isLegalToVectorizeReduction(
1341 bool TargetTransformInfo::isElementTypeLegalForScalableVector(Type *Ty) const {
1345 unsigned TargetTransformInfo::getLoadVectorFactor(unsigned VF,
1352 unsigned TargetTransformInfo::getStoreVectorFactor(unsigned VF,
1359 bool TargetTransformInfo::preferFixedOverScalableIfEqualCost() const {
1363 bool TargetTransformInfo::preferInLoopReduction(unsigned Opcode, Type *Ty,
1368 bool TargetTransformInfo::preferPredicatedReductionSelect(
1373 bool TargetTransformInfo::preferEpilogueVectorization() const {
1377 TargetTransformInfo::VPLegalization
1378 TargetTransformInfo::getVPLegalizationStrategy(const VPIntrinsic &VPI) const {
1382 bool TargetTransformInfo::hasArmWideBranch(bool Thumb) const {
1386 uint64_t TargetTransformInfo::getFeatureMask(const Function &F) const {
1390 bool TargetTransformInfo::isMultiversionedFunction(const Function &F) const {
1394 unsigned TargetTransformInfo::getMaxNumArgs() const {
1398 bool TargetTransformInfo::shouldExpandReduction(const IntrinsicInst *II) const {
1402 TargetTransformInfo::ReductionShuffle
1403 TargetTransformInfo::getPreferredExpandedReductionShuffle(
1408 unsigned TargetTransformInfo::getGISelRematGlobalCost() const {
1412 unsigned TargetTransformInfo::getMinTripCountTailFoldingThreshold() const {
1416 bool TargetTransformInfo::supportsScalableVectors() const {
1420 bool TargetTransformInfo::enableScalableVectorization() const {
1424 bool TargetTransformInfo::hasActiveVectorLength(unsigned Opcode, Type *DataType,
1429 bool TargetTransformInfo::isProfitableToSinkOperands(
1434 bool TargetTransformInfo::isVectorShiftByScalarCheap(Type *Ty) const {
1439 TargetTransformInfo::getNumBytesToPadGlobalArray(unsigned Size,
1444 void TargetTransformInfo::collectKernelLaunchBounds(
1450 TargetTransformInfo::Concept::~Concept() = default;
1489 TargetTransformInfo &TargetTransformInfoWrapperPass::getTTI(const Function &F) {