52 #define DEBUG_TYPE "x86tti" 135 if (ST->
hasAVX512() && PreferVectorWidth >= 512)
137 if (ST->
hasAVX() && PreferVectorWidth >= 256)
139 if (ST->
hasSSE1() && PreferVectorWidth >= 128)
173 unsigned Opcode,
Type *Ty,
182 assert(ISD &&
"Invalid opcode");
194 return LT.first * Entry->Cost;
223 bool Op1Signed =
false;
225 bool Op2Signed =
false;
228 bool signedMode = Op1Signed | Op2Signed;
229 unsigned OpMinSize =
std::max(Op1MinSize, Op2MinSize);
233 if (!signedMode && OpMinSize <= 8)
237 if (!signedMode && OpMinSize <= 16)
243 return LT.first * Entry->Cost;
289 static const CostTblEntry AVX512BWUniformConstCostTable[] = {
302 if (
const auto *Entry =
CostTableLookup(AVX512BWUniformConstCostTable, ISD,
304 return LT.first * Entry->Cost;
307 static const CostTblEntry AVX512UniformConstCostTable[] = {
320 if (
const auto *Entry =
CostTableLookup(AVX512UniformConstCostTable, ISD,
322 return LT.first * Entry->Cost;
325 static const CostTblEntry AVX2UniformConstCostTable[] = {
344 if (
const auto *Entry =
CostTableLookup(AVX2UniformConstCostTable, ISD,
346 return LT.first * Entry->Cost;
349 static const CostTblEntry SSE2UniformConstCostTable[] = {
380 return LT.first * 32;
382 return LT.first * 38;
384 return LT.first * 15;
386 return LT.first * 20;
391 if (
const auto *Entry =
393 return LT.first * Entry->Cost;
406 if (
const auto *Entry =
408 return LT.first * Entry->Cost;
428 if (
const auto *Entry =
430 return LT.first * Entry->Cost;
442 return LT.first * Entry->Cost;
469 return LT.first * Entry->Cost;
501 return LT.first * Entry->Cost;
530 return LT.first * Entry->Cost;
565 return LT.first * Entry->Cost;
567 static const CostTblEntry SSE2UniformShiftCostTable[] = {
591 if (
const auto *Entry =
593 return LT.first * Entry->Cost;
651 return LT.first * Entry->Cost;
687 return LT.first * Entry->Cost;
713 return LT.first * Entry->Cost;
742 return LT.first * Entry->Cost;
778 return LT.first * Entry->Cost;
787 return LT.first * Entry->Cost;
798 Opcode, Ty->getScalarType(), Op1Info, Op2Info,
800 return 20 *
LT.first *
LT.second.getVectorNumElements() * ScalarCost;
823 MVT LegalVT = LT.second;
832 unsigned NumOfSrcs = (VecTySize + LegalVTSize - 1) / LegalVTSize;
834 unsigned NumOfDests = LT.first;
839 unsigned NumOfShuffles = (NumOfSrcs - 1) * NumOfDests;
840 return NumOfShuffles *
850 int NumOfDests = LT.first;
851 int NumOfShufflesPerDest = LT.first * 2 - 1;
852 LT.first = NumOfDests * NumOfShufflesPerDest;
868 if (
const auto *Entry =
870 return LT.first * Entry->Cost;
895 if (
const auto *Entry =
897 return LT.first * Entry->Cost;
940 return LT.first * Entry->Cost;
981 return LT.first * Entry->Cost;
1003 return LT.first * Entry->Cost;
1050 return LT.first * Entry->Cost;
1063 return LT.first * Entry->Cost;
1084 return LT.first * Entry->Cost;
1123 return LT.first * Entry->Cost;
1135 return LT.first * Entry->Cost;
1143 assert(ISD &&
"Invalid opcode");
1457 LTDest.second, LTSrc.second))
1458 return LTSrc.first * Entry->Cost;
1516 MVT MTy = LT.second;
1519 assert(ISD &&
"Invalid opcode");
1565 return LT.first * Entry->Cost;
1569 return LT.first * Entry->Cost;
1573 return LT.first * Entry->Cost;
1577 return LT.first * Entry->Cost;
1581 return LT.first * Entry->Cost;
1585 return LT.first * Entry->Cost;
1594 unsigned ScalarizationCostPassed) {
1788 case Intrinsic::bitreverse:
1791 case Intrinsic::bswap:
1794 case Intrinsic::ctlz:
1797 case Intrinsic::ctpop:
1800 case Intrinsic::cttz:
1803 case Intrinsic::sqrt:
1810 MVT MTy = LT.second;
1815 return LT.first * Entry->Cost;
1819 return LT.first * Entry->Cost;
1823 return LT.first * Entry->Cost;
1827 return LT.first * Entry->Cost;
1831 return LT.first * Entry->Cost;
1835 return LT.first * Entry->Cost;
1839 return LT.first * Entry->Cost;
1843 return LT.first * Entry->Cost;
1847 return LT.first * Entry->Cost;
1851 return LT.first * Entry->Cost;
1855 return LT.first * Entry->Cost;
1859 return LT.first * Entry->Cost;
1863 return LT.first * Entry->Cost;
1866 return LT.first * Entry->Cost;
1886 if (!LT.second.isVector())
1890 unsigned Width = LT.second.getVectorNumElements();
1891 Index = Index % Width;
1894 if (ScalarType->isFloatingPointTy() && Index == 0)
1900 int RegisterFileMoveCost = 0;
1901 if (Opcode == Instruction::ExtractElement && ScalarType->isPointerTy())
1902 RegisterFileMoveCost = 1;
1910 if (
VectorType *VTy = dyn_cast<VectorType>(Src)) {
1911 unsigned NumElem = VTy->getVectorNumElements();
1915 if (NumElem == 3 && VTy->getScalarSizeInBits() == 32)
1920 if (NumElem == 3 && VTy->getScalarSizeInBits() == 64)
1930 return NumElem * Cost + SplitCost;
1940 int Cost = LT.first * 1;
1969 int MaskCmpCost = NumElem * (BranchCost + ScalarCompareCost);
1976 return MemopCost + ValueSplitCost + MaskSplitCost + MaskCmpCost;
1983 if (VT.isSimple() && LT.second != VT.getSimpleVT() &&
1984 LT.second.getVectorNumElements() == NumElem)
1989 else if (LT.second.getVectorNumElements() > NumElem) {
1996 return Cost + LT.first*4;
1999 return Cost+LT.first;
2008 unsigned NumVectorInstToHideOverhead = 10;
2019 return NumVectorInstToHideOverhead;
2032 MVT MTy = LT.second;
2035 assert(ISD &&
"Invalid opcode");
2080 if (
const auto *Entry =
CostTableLookup(AVX1CostTblPairWise, ISD, MTy))
2081 return LT.first * Entry->Cost;
2084 if (
const auto *Entry =
CostTableLookup(SSE42CostTblPairWise, ISD, MTy))
2085 return LT.first * Entry->Cost;
2088 if (
const auto *Entry =
CostTableLookup(AVX1CostTblNoPairWise, ISD, MTy))
2089 return LT.first * Entry->Cost;
2092 if (
const auto *Entry =
CostTableLookup(SSE42CostTblNoPairWise, ISD, MTy))
2093 return LT.first * Entry->Cost;
2100 bool IsPairwise,
bool IsUnsigned) {
2103 MVT MTy = LT.second;
2110 "Expected float point or integer vector type.");
2198 static const CostTblEntry AVX512CostTblNoPairWise[] = {
2209 if (
const auto *Entry =
CostTableLookup(AVX512CostTblPairWise, ISD, MTy))
2210 return LT.first * Entry->Cost;
2213 if (
const auto *Entry =
CostTableLookup(AVX2CostTblPairWise, ISD, MTy))
2214 return LT.first * Entry->Cost;
2217 if (
const auto *Entry =
CostTableLookup(AVX1CostTblPairWise, ISD, MTy))
2218 return LT.first * Entry->Cost;
2221 if (
const auto *Entry =
CostTableLookup(SSE42CostTblPairWise, ISD, MTy))
2222 return LT.first * Entry->Cost;
2225 if (
const auto *Entry =
2227 return LT.first * Entry->Cost;
2230 if (
const auto *Entry =
CostTableLookup(AVX2CostTblNoPairWise, ISD, MTy))
2231 return LT.first * Entry->Cost;
2234 if (
const auto *Entry =
CostTableLookup(AVX1CostTblNoPairWise, ISD, MTy))
2235 return LT.first * Entry->Cost;
2238 if (
const auto *Entry =
CostTableLookup(SSE42CostTblNoPairWise, ISD, MTy))
2239 return LT.first * Entry->Cost;
2277 if (BitSize % 64 != 0)
2283 for (
unsigned ShiftVal = 0; ShiftVal < BitSize; ShiftVal += 64) {
2302 unsigned ImmIdx = ~0U;
2306 case Instruction::GetElementPtr:
2316 case Instruction::ICmp:
2324 if (ImmVal == 0x100000000ULL || ImmVal == 0xffffffff)
2329 case Instruction::And:
2338 case Instruction::Sub:
2344 case Instruction::Mul:
2345 case Instruction::UDiv:
2346 case Instruction::SDiv:
2347 case Instruction::URem:
2348 case Instruction::SRem:
2349 case Instruction::Or:
2350 case Instruction::Xor:
2354 case Instruction::Shl:
2355 case Instruction::LShr:
2356 case Instruction::AShr:
2360 case Instruction::Trunc:
2361 case Instruction::ZExt:
2362 case Instruction::SExt:
2363 case Instruction::IntToPtr:
2364 case Instruction::PtrToInt:
2365 case Instruction::BitCast:
2366 case Instruction::PHI:
2374 if (Idx == ImmIdx) {
2398 case Intrinsic::sadd_with_overflow:
2399 case Intrinsic::uadd_with_overflow:
2400 case Intrinsic::ssub_with_overflow:
2401 case Intrinsic::usub_with_overflow:
2402 case Intrinsic::smul_with_overflow:
2403 case Intrinsic::umul_with_overflow:
2407 case Intrinsic::experimental_stackmap:
2411 case Intrinsic::experimental_patchpoint_void:
2412 case Intrinsic::experimental_patchpoint_i64:
2422 if (isa<StoreInst>(U)) {
2426 if (
auto GEP = dyn_cast<GetElementPtrInst>(Ptr)) {
2427 if (!
all_of(
GEP->indices(), [](
Value *V) {
return isa<Constant>(V); }))
2436 int X86TTIImpl::getGSVectorCost(
unsigned Opcode,
Type *SrcVTy,
Value *
Ptr,
2439 assert(isa<VectorType>(SrcVTy) &&
"Unexpected type in getGSVectorCost");
2450 if (IndexSize < 64 || !GEP)
2453 unsigned NumOfVarIndices = 0;
2465 ++NumOfVarIndices > 1)
2468 return (
unsigned)32;
2474 unsigned IndexSize = (ST->
hasAVX512() && VF >= 16)
2475 ? getIndexSizeInBits(Ptr,
DL)
2482 int SplitFactor =
std::max(IdxsLT.first, SrcLT.first);
2483 if (SplitFactor > 1) {
2486 return SplitFactor * getGSVectorCost(Opcode, SplitSrcTy, Ptr, Alignment,
2507 int X86TTIImpl::getGSScalarCost(
unsigned Opcode,
Type *SrcVTy,
2508 bool VariableMask,
unsigned Alignment,
2509 unsigned AddressSpace) {
2512 int MaskUnpackCost = 0;
2517 int ScalarCompareCost =
2521 MaskUnpackCost += VF * (BranchCost + ScalarCompareCost);
2528 int InsertExtractCost = 0;
2530 for (
unsigned i = 0; i < VF; ++i)
2532 InsertExtractCost +=
2535 for (
unsigned i = 0; i < VF; ++i)
2537 InsertExtractCost +=
2540 return MemoryOpCost + MaskUnpackCost + InsertExtractCost;
2545 Value *Ptr,
bool VariableMask,
2546 unsigned Alignment) {
2552 assert(PtrTy &&
"Unexpected type for Ptr argument");
2555 bool Scalarize =
false;
2569 return getGSScalarCost(Opcode, SrcVTy, VariableMask, Alignment,
2572 return getGSVectorCost(Opcode, SrcVTy, Ptr, Alignment, AddressSpace);
2595 int DataWidth = isa<PointerType>(ScalarTy) ?
2598 return ((DataWidth == 32 || DataWidth == 64) && ST->
hasAVX()) ||
2599 ((DataWidth == 8 || DataWidth == 16) && ST->
hasBWI());
2619 if (isa<VectorType>(DataTy)) {
2625 int DataWidth = isa<PointerType>(ScalarTy) ?
2631 return (DataWidth == 32 || DataWidth == 64) &&
2664 return (CallerBits & CalleeBits) == CalleeBits;
2671 static const auto ThreeWayOptions = [
this]() {
2681 static const auto EqZeroOptions = [
this]() {
2695 return IsZeroCmp ? &EqZeroOptions : &ThreeWayOptions;
2721 unsigned AddressSpace) {
2725 if (Indices.
size() && Indices.
size() != Factor)
2727 Alignment, AddressSpace);
2739 Alignment, AddressSpace);
2748 unsigned NumOfMemOps = (VecTySize + LegalVTSize - 1) / LegalVTSize;
2753 unsigned MemOpCost =
2760 Alignment, AddressSpace);
2789 static const CostTblEntry AVX2InterleavedStoreTbl[] = {
2807 if (
const auto *Entry =
2809 return NumOfMemOps * MemOpCost + Entry->Cost;
2812 "Expected Store Instruction at this point");
2813 if (
const auto *Entry =
2815 return NumOfMemOps * MemOpCost + Entry->Cost;
2819 Alignment, AddressSpace);
2830 unsigned AddressSpace) {
2841 unsigned NumOfMemOps = (VecTySize + LegalVTSize - 1) / LegalVTSize;
2846 unsigned MemOpCost =
2859 static const CostTblEntry AVX512InterleavedLoadTbl[] = {
2865 if (
const auto *Entry =
2867 return NumOfMemOps * MemOpCost + Entry->Cost;
2876 unsigned ShuffleCost =
2879 unsigned NumOfLoadsInInterleaveGrp =
2880 Indices.
size() ? Indices.
size() : Factor;
2883 unsigned NumOfResults =
2885 NumOfLoadsInInterleaveGrp;
2889 unsigned NumOfUnfoldedLoads =
2890 NumOfResults > 1 ? NumOfMemOps : NumOfMemOps / 2;
2893 unsigned NumOfShufflesPerResult =
2894 std::max((
unsigned)1, (
unsigned)(NumOfMemOps - 1));
2899 unsigned NumOfMoves = 0;
2901 NumOfMoves = NumOfResults * NumOfShufflesPerResult / 2;
2903 int Cost = NumOfResults * NumOfShufflesPerResult * ShuffleCost +
2904 NumOfUnfoldedLoads * MemOpCost + NumOfMoves;
2911 "Expected Store Instruction at this point");
2913 static const CostTblEntry AVX512InterleavedStoreTbl[] = {
2924 if (
const auto *Entry =
2926 return NumOfMemOps * MemOpCost + Entry->Cost;
2931 unsigned NumOfSources = Factor;
2932 unsigned ShuffleCost =
2934 unsigned NumOfShufflesPerStore = NumOfSources - 1;
2938 unsigned NumOfMoves = NumOfMemOps * NumOfShufflesPerStore / 2;
2939 int Cost = NumOfMemOps * (MemOpCost + NumOfShufflesPerStore * ShuffleCost) +
2948 unsigned AddressSpace) {
2949 auto isSupportedOnAVX512 = [](
Type *VecTy,
bool HasBW) {
2960 Alignment, AddressSpace);
2963 Alignment, AddressSpace);
2966 Alignment, AddressSpace);
Type * getVectorElementType() const
constexpr bool isUInt< 32 >(uint64_t x)
X = FP_ROUND(Y, TRUNC) - Rounding 'Y' from a larger floating point type down to the precision of the ...
bool is64Bit() const
Is this x86_64? (disregarding specific ABI / programming model)
void push_back(const T &Elt)
A parsed version of the target data layout string in and methods for querying it. ...
FMINNUM/FMAXNUM - Perform floating-point minimum or maximum on two values.
Value * getPointerOperand()
unsigned getArithmeticInstrCost(unsigned Opcode, Type *Ty, TTI::OperandValueKind Opd1Info=TTI::OK_AnyValue, 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 * >())
static IntegerType * getInt1Ty(LLVMContext &C)
llvm::Optional< unsigned > getCacheSize(TargetTransformInfo::CacheLevel Level) const
uint64_t getZExtValue() const
Get zero extended value.
APInt sext(unsigned width) const
Sign extend to a new width.
GCNRegPressure max(const GCNRegPressure &P1, const GCNRegPressure &P2)
DELETED_NODE - This is an illegal value that is used to catch errors.
Compute iterated dominance frontiers using a linear time algorithm.
static MVT getVectorVT(MVT VT, unsigned NumElements)
Cost tables and simple lookup functions.
int getVectorInstrCost(unsigned Opcode, Type *Val, unsigned Index)
bool isFCmpOrdCheaperThanFCmpZero(Type *Ty)
int getGatherScatterOpCost(unsigned Opcode, Type *DataTy, Value *Ptr, bool VariableMask, unsigned Alignment)
Calculate the cost of Gather / Scatter operation.
const Value * getSplatValue(const Value *V)
Get splat value if the input is a splat vector or return nullptr.
bool isVector() const
Return true if this is a vector value type.
unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract)
Estimate the overhead of scalarizing an instruction.
The main scalar evolution driver.
unsigned getRegisterBitWidth(bool Vector) const
MVT getSimpleVT() const
Return the SimpleValueType held in the specified simple EVT.
unsigned getVectorNumElements() const
bool isLegalMaskedScatter(Type *DataType)
bool all_of(R &&range, UnaryPredicate P)
Provide wrappers to std::all_of which take ranges instead of having to pass begin/end explicitly...
unsigned getPointerSizeInBits(unsigned AS=0) const
Layout pointer size, in bits FIXME: The defaults need to be removed once all of the backends/clients ...
Type Conversion Cost Table.
uint64_t alignTo(uint64_t Value, uint64_t Align, uint64_t Skew=0)
Returns the next integer (mod 2**64) that is greater than or equal to Value and is a multiple of Alig...
[US]{MIN/MAX} - Binary minimum or maximum or signed or unsigned integers.
bool isVectorTy() const
True if this is an instance of VectorType.
int getInterleavedMemoryOpCost(unsigned Opcode, Type *VecTy, unsigned Factor, ArrayRef< unsigned > Indices, unsigned Alignment, unsigned AddressSpace)
unsigned getAtomicMemIntrinsicMaxElementSize() const
unsigned getBitWidth() const
Return the number of bits in the APInt.
unsigned getNumberOfRegisters(bool Vector)
int getGatherOverhead() const
LLVMContext & getContext() const
Return the LLVMContext in which this type was uniqued.
unsigned getMaxInterleaveFactor(unsigned VF)
SDIVREM/UDIVREM - Divide two integers and produce both a quotient and remainder result.
bool areInlineCompatible(const Function *Caller, const Function *Callee) const
bool isUnalignedMem32Slow() const
unsigned getIntrinsicInstrCost(Intrinsic::ID IID, Type *RetTy, ArrayRef< Value * > Args, FastMathFlags FMF, unsigned VF=1)
Get intrinsic cost based on arguments.
bool isLegalMaskedStore(Type *DataType)
unsigned getAddressComputationCost(Type *Ty, ScalarEvolution *, const SCEV *)
int getArithmeticInstrCost(unsigned Opcode, Type *Ty, TTI::OperandValueKind Opd1Info=TTI::OK_AnyValue, 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 *>())
const FeatureBitset & getFeatureBits() const
Shift and rotation operations.
bool isIntegerTy() const
True if this is an instance of IntegerType.
unsigned getArithmeticReductionCost(unsigned Opcode, Type *Ty, bool IsPairwise)
Try to calculate arithmetic and shuffle op costs for reduction operations.
const TypeConversionCostTblEntry * ConvertCostTableLookup(ArrayRef< TypeConversionCostTblEntry > Tbl, int ISD, MVT Dst, MVT Src)
Find in type conversion cost table, TypeTy must be comparable to CompareTy by ==. ...
unsigned getStoreSize() const
Return the number of bytes overwritten by a store of the specified value type.
bool isLSRCostLess(TargetTransformInfo::LSRCost &C1, TargetTransformInfo::LSRCost &C2)
unsigned getSizeInBits() const
unsigned getInterleavedMemoryOpCost(unsigned Opcode, Type *VecTy, unsigned Factor, ArrayRef< unsigned > Indices, unsigned Alignment, unsigned AddressSpace)
unsigned getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy, const Instruction *I)
int64_t getSExtValue() const
Get sign extended value.
unsigned getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src, const Instruction *I=nullptr)
Type * getType() const
All values are typed, get the type of this value.
[SU]INT_TO_FP - These operators convert integers (whose interpreted sign depends on the first letter)...
APInt sextOrTrunc(unsigned width) const
Sign extend or truncate to width.
Simple integer binary arithmetic operators.
llvm::Optional< unsigned > getCacheAssociativity(TargetTransformInfo::CacheLevel Level) const
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
bool isIntOrIntVectorTy() const
Return true if this is an integer type or a vector of integer types.
int getAddressComputationCost(Type *PtrTy, ScalarEvolution *SE, const SCEV *Ptr)
amdgpu Simplify well known AMD library false Value * Callee
MVT getVectorElementType() const
Value * getOperand(unsigned i) const
Class to represent pointers.
FP_TO_[US]INT - Convert a floating point value to a signed or unsigned integer.
Type * getScalarType() const
If this is a vector type, return the element type, otherwise return 'this'.
bool isFloatTy() const
Return true if this is 'float', a 32-bit IEEE fp type.
an instruction for type-safe pointer arithmetic to access elements of arrays and structs ...
* if(!EatIfPresent(lltok::kw_thread_local)) return false
ParseOptionalThreadLocal := /*empty.
Container class for subtarget features.
constexpr bool isPowerOf2_32(uint32_t Value)
Return true if the argument is a power of two > 0.
The instances of the Type class are immutable: once they are created, they are never changed...
Simple binary floating point operators.
bool isLegalMaskedGather(Type *DataType)
size_t size() const
size - Get the array size.
unsigned getMinMaxReductionCost(Type *Ty, Type *CondTy, bool IsPairwise, bool)
Try to calculate op costs for min/max reduction operations.
bool isPointerTy() const
True if this is an instance of PointerType.
bool isLegalMaskedLoad(Type *DataType)
const TTI::MemCmpExpansionOptions * enableMemCmpExpansion(bool IsZeroCmp) const
unsigned getAddressSpace() const
Return the address space of the Pointer type.
int getMaskedMemoryOpCost(unsigned Opcode, Type *Src, unsigned Alignment, unsigned AddressSpace)
This file provides a helper that implements much of the TTI interface in terms of the target-independ...
static MVT getVT(Type *Ty, bool HandleUnknown=false)
Return the value type corresponding to the specified type.
bool isOperationLegal(unsigned Op, EVT VT) const
Return true if the specified operation is legal on this target.
int getInterleavedMemoryOpCostAVX2(unsigned Opcode, Type *VecTy, unsigned Factor, ArrayRef< unsigned > Indices, unsigned Alignment, unsigned AddressSpace)
X = FP_EXTEND(Y) - Extend a smaller FP type into a larger FP type.
int getArithmeticReductionCost(unsigned Opcode, Type *Ty, bool IsPairwiseForm)
unsigned getUserCost(const User *U, ArrayRef< const Value *> Operands)
const TargetMachine & getTargetMachine() const
bool enableInterleavedAccessVectorization()
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
EVT getValueType(const DataLayout &DL, Type *Ty, bool AllowUnknown=false) const
Return the EVT corresponding to this LLVM type.
int getMemoryOpCost(unsigned Opcode, Type *Src, unsigned Alignment, unsigned AddressSpace, const Instruction *I=nullptr)
int getShuffleCost(TTI::ShuffleKind Kind, Type *Tp, int Index, Type *SubTp)
TTI::PopcntSupportKind getPopcntSupport(unsigned TyWidth)
unsigned getCFInstrCost(unsigned Opcode)
bool isAtom() const
TODO: to be removed later and replaced with suitable properties.
unsigned getShuffleCost(TTI::ShuffleKind Kind, Type *Tp, int Index, Type *SubTp)
APInt ashr(unsigned ShiftAmt) const
Arithmetic right-shift function.
static IntegerType * get(LLVMContext &C, unsigned NumBits)
This static method is the primary way of constructing an IntegerType.
unsigned getNumOperands() const
constexpr bool isInt< 32 >(int64_t x)
unsigned getPreferVectorWidth() const
Byte Swap and Counting operators.
int getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy, const Instruction *I=nullptr)
int getMinMaxReductionCost(Type *Ty, Type *CondTy, bool IsPairwiseForm, bool IsUnsigned)
virtual const TargetSubtargetInfo * getSubtargetImpl(const Function &) const
Virtual method implemented by subclasses that returns a reference to that target's TargetSubtargetInf...
unsigned getVectorNumElements() const
Class to represent vector types.
Class for arbitrary precision integers.
int getScatterOverhead() const
ZERO_EXTEND - Used for integer types, zeroing the new bits.
unsigned getMemoryOpCost(unsigned Opcode, Type *Src, unsigned Alignment, unsigned AddressSpace, const Instruction *I=nullptr)
int InstructionOpcodeToISD(unsigned Opcode) const
Get the ISD node that corresponds to the Instruction class opcode.
unsigned getLoadStoreVecRegBitWidth(unsigned AS) const
const CostTblEntry * CostTableLookup(ArrayRef< CostTblEntry > Tbl, int ISD, MVT Ty)
Find in cost table, TypeTy must be comparable to CompareTy by ==.
This class represents an analyzed expression in the program.
int getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src, const Instruction *I=nullptr)
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
unsigned getVectorInstrCost(unsigned Opcode, Type *Val, unsigned Index)
uint64_t divideCeil(uint64_t Numerator, uint64_t Denominator)
Returns the integer ceil(Numerator / Denominator).
bool isFPOrFPVectorTy() const
Return true if this is a FP type or a vector of FP.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
int getInterleavedMemoryOpCostAVX512(unsigned Opcode, Type *VecTy, unsigned Factor, ArrayRef< unsigned > Indices, unsigned Alignment, unsigned AddressSpace)
unsigned getPrimitiveSizeInBits() const LLVM_READONLY
Return the basic size of this type if it is a primitive type.
LLVM Value Representation.
uint64_t getTypeStoreSize(Type *Ty) const
Returns the maximum number of bytes that may be overwritten by storing the specified type...
bool hasDivRemOp(Type *DataType, bool IsSigned)
static VectorType * get(Type *ElementType, unsigned NumElements)
This static method is the primary way to construct an VectorType.
bool hasMacroFusion() const
Primary interface to the complete machine description for the target machine.
#define LLVM_FALLTHROUGH
LLVM_FALLTHROUGH - Mark fallthrough cases in switch statements.
Convenience struct for specifying and reasoning about fast-math flags.
SetCC operator - This evaluates to a true value iff the condition is true.
bool hasFastGather() const
TRUNCATE - Completely drop the high bits.
bool isSimple() const
Test if the given EVT is simple (as opposed to being extended).
bool isDoubleTy() const
Return true if this is 'double', a 64-bit IEEE fp type.
int getIntrinsicInstrCost(Intrinsic::ID IID, Type *RetTy, ArrayRef< Type *> Tys, FastMathFlags FMF, unsigned ScalarizationCostPassed=UINT_MAX)
static IntegerType * getInt8Ty(LLVMContext &C)
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
std::pair< int, MVT > getTypeLegalizationCost(const DataLayout &DL, Type *Ty) const
Estimate the cost of type-legalization and the legalized type.
int getIntImmCost(int64_t)
Calculate the cost of materializing a 64-bit value.
This file describes how to lower LLVM code to machine code.