16 #define DEBUG_TYPE "armtti"
27 bool MatchExact = (CallerBits & ~InlineFeatureWhitelist) ==
28 (CalleeBits & ~InlineFeatureWhitelist);
31 bool MatchSubset = ((CallerBits & CalleeBits) & InlineFeatureWhitelist) ==
32 (CalleeBits & InlineFeatureWhitelist);
33 return MatchExact && MatchSubset;
46 if ((SImmVal >= 0 && SImmVal < 65536) ||
53 if ((SImmVal >= 0 && SImmVal < 65536) ||
60 if (SImmVal >= 0 && SImmVal < 256)
85 if ((Opcode == Instruction::SDiv || Opcode == Instruction::UDiv ||
86 Opcode == Instruction::SRem || Opcode == Instruction::URem) &&
90 if (Opcode == Instruction::And)
98 if (Opcode == Instruction::ICmp && Imm.
isNegative() &&
101 if (ST->
isThumb2() && NegImm < 1<<12)
104 if (ST->
isThumb() && NegImm < 1<<8)
116 assert(ISD &&
"Invalid opcode");
129 if (
const auto *Entry =
CostTableLookup(NEONFltDblTbl, ISD, LT.second))
130 return LT.first * Entry->Cost;
315 if ((Opcode == Instruction::InsertElement ||
316 Opcode == Instruction::ExtractElement)) {
367 unsigned NumVectorInstToHideOverhead = 10;
368 int MaxMergeDistance = 64;
372 return NumVectorInstToHideOverhead;
422 return LT.first * Entry->Cost;
447 return LT.first * Entry->Cost;
462 const unsigned FunctionCallDivCost = 20;
463 const unsigned ReciprocalDivCost = 10;
506 if (
const auto *Entry =
CostTableLookup(CostTbl, ISDOpcode, LT.second))
507 return LT.first * Entry->Cost;
510 Opd1PropInfo, Opd2PropInfo);
544 assert(Factor >= 2 &&
"Invalid interleave factor");
545 assert(isa<VectorType>(VecTy) &&
"Expect a vector type");
550 if (Factor <= TLI->getMaxSupportedInterleaveFactor() && !EltIs64Bits) {
557 if (NumElts % Factor == 0 &&
563 Alignment, AddressSpace);
X = FP_ROUND(Y, TRUNC) - Rounding 'Y' from a larger floating point type down to the precision of the ...
int getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy, const Instruction *I=nullptr)
GCNRegPressure max(const GCNRegPressure &P1, const GCNRegPressure &P2)
uint64_t getZExtValue() const
Get zero extended value.
Cost tables and simple lookup functions.
VECTOR_SHUFFLE(VEC1, VEC2) - Returns a vector, of the same type as VEC1/VEC2.
const TargetMachine & getTargetMachine() const
Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it always prefer smaller inputs during the corpus shuffle When libFuzzer itself reports a bug this exit code will be used If indicates the maximal total time in seconds to run the fuzzer minimizes the provided crash input Use with tries to cleanse the provided crash input to make it contain fewer original bytes Use with exact_artifact_path to specify the output Experimental Use value profile to guide fuzzing Number of jobs to run If min(jobs, NumberOfCpuCores()/2)\" is used.") FUZZER_FLAG_INT(reload
int getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src, const Instruction *I=nullptr)
The main scalar evolution driver.
bool isNonNegative() const
Determine if this APInt Value is non-negative (>= 0)
int getInterleavedMemoryOpCost(unsigned Opcode, Type *VecTy, unsigned Factor, ArrayRef< unsigned > Indices, unsigned Alignment, unsigned AddressSpace)
bool isDoubleTy() const
Return true if this is 'double', a 64-bit IEEE fp type.
Type * getScalarType() const
If this is a vector type, return the element type, otherwise return 'this'.
Type Conversion Cost Table.
bool isLegalInterleavedAccessType(VectorType *VecTy, const DataLayout &DL) const
Returns true if VecTy is a legal interleaved access type.
bool isThumb1Only() const
bool isNegative() const
Determine sign of this APInt.
bool isVector() const
Return true if this is a vector value type.
int getFPOpCost(Type *Ty)
int getMemoryOpCost(unsigned Opcode, Type *Src, unsigned Alignment, unsigned AddressSpace, const Instruction *I=nullptr)
uint64_t getLimitedValue(uint64_t Limit=UINT64_MAX) const
If this value is smaller than the specified limit, return it, otherwise return the limit value...
bool areInlineCompatible(const Function *Caller, const Function *Callee) const
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 ==. ...
Type * getVectorElementType() const
bool isInteger() const
Return true if this is an integer or a vector integer type.
int InstructionOpcodeToISD(unsigned Opcode) const
Get the ISD node that corresponds to the Instruction class opcode.
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)
int getShuffleCost(TTI::ShuffleKind Kind, Type *Tp, int Index, Type *SubTp)
unsigned getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src, const Instruction *I=nullptr)
[SU]INT_TO_FP - These operators convert integers (whose interpreted sign depends on the first letter)...
static int getT2SOImmVal(unsigned Arg)
getT2SOImmVal - Given a 32-bit immediate, if it is something that can fit into a Thumb-2 shifter_oper...
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
unsigned getActiveBits() const
Compute the number of active bits in the value.
EVT getValueType(const DataLayout &DL, Type *Ty, bool AllowUnknown=false) const
Return the EVT corresponding to this LLVM type.
FP_TO_[US]INT - Convert a floating point value to a signed or unsigned integer.
static bool isThumbImmShiftedVal(unsigned V)
isThumbImmShiftedVal - Return true if the specified value can be obtained by left shifting a 8-bit im...
Container class for subtarget features.
The instances of the Type class are immutable: once they are created, they are never changed...
bool isVectorTy() const
True if this is an instance of VectorType.
int64_t getSExtValue() const
Get sign extended value.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
bool isFloatTy() const
Return true if this is 'float', a 32-bit IEEE fp type.
unsigned getIntegerBitWidth() const
X = FP_EXTEND(Y) - Extend a smaller FP type into a larger FP type.
virtual const TargetSubtargetInfo * getSubtargetImpl(const Function &) const
Virtual method implemented by subclasses that returns a reference to that target's TargetSubtargetInf...
unsigned getShuffleCost(TTI::ShuffleKind Kind, Type *Tp, int Index, Type *SubTp)
bool hasSlowLoadDSubregister() const
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 * >())
unsigned getScalarSizeInBits() const LLVM_READONLY
If this is a vector type, return the getPrimitiveSizeInBits value for the element type...
int getAddressComputationCost(Type *Val, ScalarEvolution *SE, const SCEV *Ptr)
const FeatureBitset & getFeatureBits() const
getFeatureBits - Return the feature bits.
Class for arbitrary precision integers.
Select(COND, TRUEVAL, FALSEVAL).
bool isIntegerTy() const
True if this is an instance of IntegerType.
std::pair< int, MVT > getTypeLegalizationCost(const DataLayout &DL, Type *Ty) const
Estimate the cost of type-legalization and the legalized type.
ZERO_EXTEND - Used for integer types, zeroing the new bits.
unsigned getVectorNumElements() const
static int getSOImmVal(unsigned Arg)
getSOImmVal - Given a 32-bit immediate, if it is something that can fit into an shifter_operand immed...
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 getIntImmCost(const APInt &Imm, Type *Ty)
unsigned getVectorInstrCost(unsigned Opcode, Type *Val, unsigned Index)
int getArithmeticInstrCost(unsigned Opcode, Type *Ty, TTI::OperandValueKind Op1Info=TTI::OK_AnyValue, TTI::OperandValueKind Op2Info=TTI::OK_AnyValue, TTI::OperandValueProperties Opd1PropInfo=TTI::OP_None, TTI::OperandValueProperties Opd2PropInfo=TTI::OP_None, ArrayRef< const Value * > Args=ArrayRef< const Value * >())
bool isFloatingPoint() const
Return true if this is a FP or a vector FP type.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool isSimple() const
Test if the given EVT is simple (as opposed to being extended).
unsigned getNumInterleavedAccesses(VectorType *VecTy, const DataLayout &DL) const
Returns the number of interleaved accesses that will be generated when lowering accesses of the given...
unsigned getPrimitiveSizeInBits() const LLVM_READONLY
Return the basic size of this type if it is a primitive type.
static VectorType * get(Type *ElementType, unsigned NumElements)
This static method is the primary way to construct an VectorType.
int getIntImmCodeSizeCost(unsigned Opcode, unsigned Idx, const APInt &Imm, Type *Ty)
uint64_t getTypeSizeInBits(Type *Ty) const
Size examples:
int getVectorInstrCost(unsigned Opcode, Type *Val, unsigned Index)
Primary interface to the complete machine description for the target machine.
TRUNCATE - Completely drop the high bits.
MVT getSimpleVT() const
Return the SimpleValueType held in the specified simple EVT.
This file describes how to lower LLVM code to machine code.