diff options
Diffstat (limited to 'llvm/include/llvm/CodeGen/BasicTTIImpl.h')
-rw-r--r-- | llvm/include/llvm/CodeGen/BasicTTIImpl.h | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/llvm/include/llvm/CodeGen/BasicTTIImpl.h b/llvm/include/llvm/CodeGen/BasicTTIImpl.h index 2e57b4c9d332..30533d90bbf7 100644 --- a/llvm/include/llvm/CodeGen/BasicTTIImpl.h +++ b/llvm/include/llvm/CodeGen/BasicTTIImpl.h @@ -326,7 +326,9 @@ public: } unsigned getEstimatedNumberOfCaseClusters(const SwitchInst &SI, - unsigned &JumpTableSize) { + unsigned &JumpTableSize, + ProfileSummaryInfo *PSI, + BlockFrequencyInfo *BFI) { /// Try to find the estimated number of clusters. Note that the number of /// clusters identified in this function could be different from the actual /// numbers found in lowering. This function ignore switches that are @@ -374,7 +376,7 @@ public: (MaxCaseVal - MinCaseVal) .getLimitedValue(std::numeric_limits<uint64_t>::max() - 1) + 1; // Check whether a range of clusters is dense enough for a jump table - if (TLI->isSuitableForJumpTable(&SI, N, Range)) { + if (TLI->isSuitableForJumpTable(&SI, N, Range, PSI, BFI)) { JumpTableSize = Range; return 1; } @@ -508,6 +510,13 @@ public: return BaseT::isHardwareLoopProfitable(L, SE, AC, LibInfo, HWLoopInfo); } + bool preferPredicateOverEpilogue(Loop *L, LoopInfo *LI, ScalarEvolution &SE, + AssumptionCache &AC, TargetLibraryInfo *TLI, + DominatorTree *DT, + const LoopAccessInfo *LAI) { + return BaseT::preferPredicateOverEpilogue(L, LI, SE, AC, TLI, DT, LAI); + } + int getInstructionLatency(const Instruction *I) { if (isa<LoadInst>(I)) return getST()->getSchedModel().DefaultLoadLatency; @@ -624,7 +633,8 @@ public: TTI::OperandValueKind Opd2Info = TTI::OK_AnyValue, TTI::OperandValueProperties Opd1PropInfo = TTI::OP_None, TTI::OperandValueProperties Opd2PropInfo = TTI::OP_None, - ArrayRef<const Value *> Args = ArrayRef<const Value *>()) { + ArrayRef<const Value *> Args = ArrayRef<const Value *>(), + const Instruction *CxtI = nullptr) { // Check if any of the operands are vector operands. const TargetLoweringBase *TLI = getTLI(); int ISD = TLI->InstructionOpcodeToISD(Opcode); @@ -772,9 +782,10 @@ public: // cost of the split itself. Count that as 1, to be consistent with // TLI->getTypeLegalizationCost(). if ((TLI->getTypeAction(Src->getContext(), TLI->getValueType(DL, Src)) == - TargetLowering::TypeSplitVector) || - (TLI->getTypeAction(Dst->getContext(), TLI->getValueType(DL, Dst)) == - TargetLowering::TypeSplitVector)) { + TargetLowering::TypeSplitVector || + TLI->getTypeAction(Dst->getContext(), TLI->getValueType(DL, Dst)) == + TargetLowering::TypeSplitVector) && + Src->getVectorNumElements() > 1 && Dst->getVectorNumElements() > 1) { Type *SplitDst = VectorType::get(Dst->getVectorElementType(), Dst->getVectorNumElements() / 2); Type *SplitSrc = VectorType::get(Src->getVectorElementType(), @@ -869,8 +880,9 @@ public: return LT.first; } - unsigned getMemoryOpCost(unsigned Opcode, Type *Src, unsigned Alignment, - unsigned AddressSpace, const Instruction *I = nullptr) { + unsigned getMemoryOpCost(unsigned Opcode, Type *Src, MaybeAlign Alignment, + unsigned AddressSpace, + const Instruction *I = nullptr) { assert(!Src->isVoidTy() && "Invalid type"); std::pair<unsigned, MVT> LT = getTLI()->getTypeLegalizationCost(DL, Src); @@ -921,8 +933,8 @@ public: Cost = static_cast<T *>(this)->getMaskedMemoryOpCost( Opcode, VecTy, Alignment, AddressSpace); else - Cost = static_cast<T *>(this)->getMemoryOpCost(Opcode, VecTy, Alignment, - AddressSpace); + Cost = static_cast<T *>(this)->getMemoryOpCost( + Opcode, VecTy, MaybeAlign(Alignment), AddressSpace); // Legalize the vector type, and get the legalized and unlegalized type // sizes. |