16 #define DEBUG_TYPE "armtti"
22 if (Bits == 0 || Bits > 32)
28 if ((SImmVal >= 0 && SImmVal < 65536) ||
35 if ((SImmVal >= 0 && SImmVal < 65536) ||
42 if (SImmVal >= 0 && SImmVal < 256)
52 assert(ISD &&
"Invalid opcode");
67 return LT.first * NEONFltDblTbl[Idx].
Cost;
80 NEONVectorConversionTbl[] = {
159 return NEONVectorConversionTbl[Idx].
Cost;
164 NEONFloatConversionTbl[] = {
190 return NEONFloatConversionTbl[Idx].
Cost;
195 NEONIntegerConversionTbl[] = {
222 return NEONIntegerConversionTbl[Idx].
Cost;
227 ARMIntegerConversionTbl[] = {
242 return ARMIntegerConversionTbl[Idx].
Cost;
253 Opcode == Instruction::InsertElement &&
260 if ((Opcode == Instruction::InsertElement ||
276 NEONVectorSelectTbl[] = {
292 return NEONVectorSelectTbl[Idx].
Cost;
307 unsigned NumVectorInstToHideOverhead = 10;
310 return NumVectorInstToHideOverhead;
362 return LT.first * NEONShuffleTbl[Idx].
Cost;
387 return LT.first * NEONAltShuffleTbl[Idx].
Cost;
400 const unsigned FunctionCallDivCost = 20;
401 const unsigned ReciprocalDivCost = 10;
449 return LT.first * CostTbl[Idx].
Cost;
452 Opd1PropInfo, Opd2PropInfo);
487 assert(Factor >= 2 &&
"Invalid interleave factor");
488 assert(isa<VectorType>(VecTy) &&
"Expect a vector type");
493 if (Factor <= TLI->getMaxSupportedInterleaveFactor() && !EltIs64Bits) {
499 if (NumElts % Factor == 0 && (SubVecSize == 64 || SubVecSize == 128))
504 Alignment, AddressSpace);
X = FP_ROUND(Y, TRUNC) - Rounding 'Y' from a larger floating point type down to the precision of the ...
uint64_t getZExtValue() const
Get zero extended value.
unsigned getFPOpCost(Type *Ty)
Cost tables and simple lookup functions.
VECTOR_SHUFFLE(VEC1, VEC2) - Returns a vector, of the same type as VEC1/VEC2.
unsigned getMemoryOpCost(unsigned Opcode, Type *Src, unsigned Alignment, unsigned AddressSpace)
unsigned getAddressComputationCost(Type *Val, bool IsComplex)
int CostTableLookup(const CostTblEntry< TypeTy > *Tbl, unsigned len, int ISD, CompareTy Ty)
Find in cost table, TypeTy must be comparable to CompareTy by ==.
bool isDoubleTy() const
isDoubleTy - Return true if this is 'double', a 64-bit IEEE fp type.
Type Conversion Cost Table.
bool isThumb1Only() const
uint64_t getTypeAllocSizeInBits(Type *Ty) const
Returns the offset in bits between successive objects of the specified type, including alignment padd...
bool isVector() const
isVector - Return true if this is a vector value type.
unsigned getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src)
static ConstantInt * ExtractElement(Constant *V, Constant *Idx)
Type * getVectorElementType() const
bool isInteger() const
isInteger - Return true if this is an integer, or a vector integer type.
unsigned getVectorInstrCost(unsigned Opcode, Type *Val, unsigned Index)
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)
[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...
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...
unsigned getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy)
unsigned getShuffleCost(TTI::ShuffleKind Kind, Type *Tp, int Index, Type *SubTp)
unsigned getIntImmCost(const APInt &Imm, Type *Ty)
The instances of the Type class are immutable: once they are created, they are never changed...
bool isVectorTy() const
isVectorTy - True if this is an instance of VectorType.
int64_t getSExtValue() const
Get sign extended value.
bool isFloatTy() const
isFloatTy - Return true if this is 'float', a 32-bit IEEE fp type.
X = FP_EXTEND(Y) - Extend a smaller FP type into a larger FP type.
EVT - Extended Value Type.
unsigned getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy)
unsigned getShuffleCost(TTI::ShuffleKind Kind, Type *Tp, int Index, Type *SubTp)
uint64_t getTypeAllocSize(Type *Ty) const
Returns the offset in bytes between successive objects of the specified type, including alignment pad...
unsigned getVectorNumElements() const
unsigned getScalarSizeInBits() const LLVM_READONLY
getScalarSizeInBits - If this is a vector type, return the getPrimitiveSizeInBits value for the eleme...
unsigned getInterleavedMemoryOpCost(unsigned Opcode, Type *VecTy, unsigned Factor, ArrayRef< unsigned > Indices, unsigned Alignment, unsigned AddressSpace)
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)
Class for arbitrary precision integers.
Select(COND, TRUEVAL, FALSEVAL).
bool isIntegerTy() const
isIntegerTy - True if this is an instance of IntegerType.
ZERO_EXTEND - Used for integer types, zeroing the new bits.
static int getSOImmVal(unsigned Arg)
getSOImmVal - Given a 32-bit immediate, if it is something that can fit into an shifter_operand immed...
const Type * getScalarType() const LLVM_READONLY
getScalarType - If this is a vector type, return the element type, otherwise return 'this'...
unsigned getVectorInstrCost(unsigned Opcode, Type *Val, unsigned Index)
bool isFloatingPoint() const
isFloatingPoint - Return true if this is a FP, or a vector FP type.
const ARM::ArchExtKind Kind
bool isSimple() const
isSimple - Test if the given EVT is simple (as opposed to being extended).
int ConvertCostTableLookup(const TypeConversionCostTblEntry< TypeTy > *Tbl, unsigned len, int ISD, CompareTy Dst, CompareTy Src)
Find in type conversion cost table, TypeTy must be comparable to CompareTy by ==. ...
unsigned getPrimitiveSizeInBits() const LLVM_READONLY
getPrimitiveSizeInBits - Return the basic size of this type if it is a primitive type.
static VectorType * get(Type *ElementType, unsigned NumElements)
VectorType::get - This static method is the primary way to construct an VectorType.
unsigned 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)
TRUNCATE - Completely drop the high bits.
std::pair< unsigned, MVT > getTypeLegalizationCost(const DataLayout &DL, Type *Ty) const
Estimate the cost of type-legalization and the legalized type.
unsigned getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src)
MVT getSimpleVT() const
getSimpleVT - Return the SimpleValueType held in the specified simple EVT.
This file describes how to lower LLVM code to machine code.