16 #define DEBUG_TYPE "armtti"
28 if ((SImmVal >= 0 && SImmVal < 65536) ||
35 if ((SImmVal >= 0 && SImmVal < 65536) ||
42 if (SImmVal >= 0 && SImmVal < 256)
67 if ((Opcode == Instruction::SDiv || Opcode == Instruction::UDiv ||
68 Opcode == Instruction::SRem || Opcode == Instruction::URem) &&
80 if (Opcode == Instruction::ICmp && Imm.
isNegative() &&
83 if (ST->
isThumb2() && NegImm < 1<<12)
86 if (ST->
isThumb() && NegImm < 1<<8)
97 assert(ISD &&
"Invalid opcode");
110 if (
const auto *Entry =
CostTableLookup(NEONFltDblTbl, ISD, LT.second))
111 return LT.first * Entry->Cost;
296 if ((Opcode == Instruction::InsertElement ||
297 Opcode == Instruction::ExtractElement)) {
347 unsigned NumVectorInstToHideOverhead = 10;
348 int MaxMergeDistance = 64;
352 return NumVectorInstToHideOverhead;
402 return LT.first * Entry->Cost;
427 return LT.first * Entry->Cost;
442 const unsigned FunctionCallDivCost = 20;
443 const unsigned ReciprocalDivCost = 10;
486 if (
const auto *Entry =
CostTableLookup(CostTbl, ISDOpcode, LT.second))
487 return LT.first * Entry->Cost;
490 Opd1PropInfo, Opd2PropInfo);
524 assert(Factor >= 2 &&
"Invalid interleave factor");
525 assert(isa<VectorType>(VecTy) &&
"Expect a vector type");
530 if (Factor <= TLI->getMaxSupportedInterleaveFactor() && !EltIs64Bits) {
536 if (NumElts % Factor == 0 && (SubVecSize == 64 || SubVecSize == 128))
541 Alignment, AddressSpace);
X = FP_ROUND(Y, TRUNC) - Rounding 'Y' from a larger floating point type down to the precision of the ...
int getMemoryOpCost(unsigned Opcode, Type *Src, unsigned Alignment, unsigned AddressSpace)
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.
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.
uint64_t getLimitedValue(uint64_t Limit=~0ULL) const
If this value is smaller than the specified limit, return it, otherwise return the limit value...
Type Conversion Cost Table.
bool isThumb1Only() const
bool isNegative() const
Determine sign of this APInt.
bool isVector() const
isVector - Return true if this is a vector value type.
unsigned getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src)
int getFPOpCost(Type *Ty)
int getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src)
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
isInteger - 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)
int getShuffleCost(TTI::ShuffleKind Kind, Type *Tp, int Index, Type *SubTp)
[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.
Type * getScalarType() const LLVM_READONLY
If this is a vector type, return the element type, otherwise return 'this'.
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 etc Experimental Use value profile to guide fuzzing Number of simultaneous worker processes to run the jobs If min(jobs, NumberOfCpuCores()/2)\" is used.") FUZZER_FLAG_INT(reload
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...
unsigned getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy)
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.
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.
EVT - Extended Value Type.
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 getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy)
int getAddressComputationCost(Type *Val, ScalarEvolution *SE, const SCEV *Ptr)
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...
APInt And(const APInt &LHS, const APInt &RHS)
Bitwise AND function for APInt.
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
isFloatingPoint - Return true if this is a FP, or a vector FP type.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool isSimple() const
isSimple - Test if the given EVT is simple (as opposed to being extended).
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)
TRUNCATE - Completely drop the high bits.
MVT getSimpleVT() const
getSimpleVT - Return the SimpleValueType held in the specified simple EVT.
This file describes how to lower LLVM code to machine code.