15 #ifndef LLVM_ANALYSIS_TARGETTRANSFORMINFOIMPL_H
16 #define LLVM_ANALYSIS_TARGETTRANSFORMINFOIMPL_H
51 case Instruction::GetElementPtr:
54 case Instruction::BitCast:
55 assert(OpTy &&
"Cast instructions must provide the operand type");
63 case Instruction::IntToPtr: {
74 case Instruction::PtrToInt: {
85 case Instruction::Trunc:
98 for (
unsigned Idx = 0, Size = Operands.
size(); Idx != Size; ++Idx)
99 if (!isa<Constant>(Operands[Idx]))
106 assert(FTy &&
"FunctionType must be provided to this routine.");
129 case Intrinsic::annotation:
130 case Intrinsic::assume:
131 case Intrinsic::dbg_declare:
132 case Intrinsic::dbg_value:
133 case Intrinsic::invariant_start:
134 case Intrinsic::invariant_end:
135 case Intrinsic::lifetime_start:
136 case Intrinsic::lifetime_end:
137 case Intrinsic::objectsize:
138 case Intrinsic::ptr_annotation:
139 case Intrinsic::var_annotation:
140 case Intrinsic::experimental_gc_result_int:
141 case Intrinsic::experimental_gc_result_float:
142 case Intrinsic::experimental_gc_result_ptr:
143 case Intrinsic::experimental_gc_result:
144 case Intrinsic::experimental_gc_relocate:
169 if (Name ==
"copysign" || Name ==
"copysignf" || Name ==
"copysignl" ||
170 Name ==
"fabs" || Name ==
"fabsf" || Name ==
"fabsl" || Name ==
"sin" ||
171 Name ==
"fmin" || Name ==
"fminf" || Name ==
"fminl" ||
172 Name ==
"fmax" || Name ==
"fmaxf" || Name ==
"fmaxl" ||
173 Name ==
"sinf" || Name ==
"sinl" || Name ==
"cos" || Name ==
"cosf" ||
174 Name ==
"cosl" || Name ==
"sqrt" || Name ==
"sqrtf" || Name ==
"sqrtl")
178 if (Name ==
"pow" || Name ==
"powf" || Name ==
"powl" || Name ==
"exp2" ||
179 Name ==
"exp2l" || Name ==
"exp2f" || Name ==
"floor" ||
180 Name ==
"floorf" || Name ==
"ceil" || Name ==
"round" ||
181 Name ==
"ffs" || Name ==
"ffsl" || Name ==
"abs" || Name ==
"labs" ||
195 bool HasBaseReg, int64_t Scale,
196 unsigned AddrSpace) {
199 return !BaseGV && BaseOffset == 0 && (Scale == 0 || Scale == 1);
207 bool HasBaseReg, int64_t Scale,
unsigned AddrSpace) {
320 Type *ExpectedType) {
335 template <
typename T>
348 :
BaseT(std::move(static_cast<
BaseT &>(Arg))) {}
353 assert(F &&
"A concrete function must be provided to this routine.");
363 return static_cast<T *
>(
this)
367 if (!static_cast<T *>(
this)->isLoweredToCall(F))
390 for (
unsigned Idx = 0, Size = Arguments.
size(); Idx != Size; ++Idx)
391 ParamTys.
push_back(Arguments[Idx]->getType());
401 return static_cast<T *
>(
this)
409 Type *FTy =
CS.getCalledValue()->getType()->getPointerElementType();
410 return static_cast<T *
>(
this)
415 return static_cast<T *
>(
this)->
getCallCost(F, Arguments);
418 if (
const CastInst *CI = dyn_cast<CastInst>(U)) {
422 if (isa<CmpInst>(CI->getOperand(0)))
void push_back(const T &Elt)
A parsed version of the target data layout string in and methods for querying it. ...
unsigned getNumParams() const
getNumParams - Return the number of fixed parameters this function type requires. ...
unsigned getNumOperands() const
unsigned getPointerTypeSizeInBits(Type *) const
Layout pointer size, in bits, based on the type.
Attribute getFnAttribute(Attribute::AttrKind Kind) const
Return the attribute for the given attribute kind.
void reserve(size_type N)
StringRef getName() const
Return a constant reference to the value's name.
This is the base class for all instructions that perform data casts.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
param_iterator param_end() const
FunctionType - Class to represent function types.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
size_t size() const
size - Get the array size.
The instances of the Type class are immutable: once they are created, they are never changed...
param_iterator param_begin() const
Value * getOperand(unsigned i) const
bool isPointerTy() const
isPointerTy - True if this is an instance of PointerType.
unsigned getScalarSizeInBits() const LLVM_READONLY
getScalarSizeInBits - If this is a vector type, return the getPrimitiveSizeInBits value for the eleme...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Type * getType() const
All values are typed, get the type of this value.
Intrinsic::ID getIntrinsicID() const LLVM_READONLY
getIntrinsicID - This method returns the ID number of the specified function, or Intrinsic::not_intri...
Class for arbitrary precision integers.
unsigned getOpcode() const
Return the opcode for this Instruction or ConstantExpr.
bool isLegalInteger(unsigned Width) const
Returns true if the specified type is known to be a native integer type supported by the CPU...
ImmutableCallSite - establish a view to a call site for examination.
FunctionType * getFunctionType() const
bool hasLocalLinkage() const
Type * getReturnType() const
const ARM::ArchExtKind Kind
LLVM Value Representation.
uint64_t getTypeSizeInBits(Type *Ty) const
Size examples:
StringRef - Represent a constant reference to a string, i.e.
Information about a load/store intrinsic defined by the target.
IntrinsicInst - A useful wrapper class for inspecting calls to intrinsic functions.