30 #define DEBUG_TYPE "AMDGPUtti"
80 return Vector ? 0 : 32;
118 Opd1PropInfo, Opd2PropInfo);
127 unsigned NElts = LT.second.isVector() ?
128 LT.second.getVectorNumElements() : 1;
137 return get64BitInstrCost() * LT.first * NElts;
140 return getFullRateInstrCost() * LT.first * NElts;
149 return 2 * getFullRateInstrCost() * LT.first * NElts;
152 return LT.first * NElts * getFullRateInstrCost();
155 const int QuarterRateCost = getQuarterRateInstrCost();
157 const int FullRateCost = getFullRateInstrCost();
158 return (4 * QuarterRateCost + (2 * 2) * FullRateCost) * LT.first * NElts;
162 return QuarterRateCost * NElts * LT.first;
168 return LT.first * NElts * get64BitInstrCost();
171 return LT.first * NElts * getFullRateInstrCost();
179 int Cost = 4 * get64BitInstrCost() + 7 * getQuarterRateInstrCost();
183 Cost += 3 * getFullRateInstrCost();
185 return LT.first * Cost * NElts;
191 int Cost = 7 * getFullRateInstrCost() + 1 * getQuarterRateInstrCost();
192 return LT.first * NElts * Cost;
201 Opd1PropInfo, Opd2PropInfo);
207 case Instruction::Br:
218 case Instruction::ExtractElement:
219 case Instruction::InsertElement:
225 return Index == ~0u ? 2 : 0;
241 case Intrinsic::amdgcn_workitem_id_x:
242 case Intrinsic::amdgcn_workitem_id_y:
243 case Intrinsic::amdgcn_workitem_id_z:
244 case Intrinsic::amdgcn_interp_mov:
245 case Intrinsic::amdgcn_interp_p1:
246 case Intrinsic::amdgcn_interp_p2:
247 case Intrinsic::amdgcn_mbcnt_hi:
248 case Intrinsic::amdgcn_mbcnt_lo:
249 case Intrinsic::r600_read_tidig_x:
250 case Intrinsic::r600_read_tidig_y:
251 case Intrinsic::r600_read_tidig_z:
252 case Intrinsic::amdgcn_image_atomic_swap:
253 case Intrinsic::amdgcn_image_atomic_add:
254 case Intrinsic::amdgcn_image_atomic_sub:
255 case Intrinsic::amdgcn_image_atomic_smin:
256 case Intrinsic::amdgcn_image_atomic_umin:
257 case Intrinsic::amdgcn_image_atomic_smax:
258 case Intrinsic::amdgcn_image_atomic_umax:
259 case Intrinsic::amdgcn_image_atomic_and:
260 case Intrinsic::amdgcn_image_atomic_or:
261 case Intrinsic::amdgcn_image_atomic_xor:
262 case Intrinsic::amdgcn_image_atomic_inc:
263 case Intrinsic::amdgcn_image_atomic_dec:
264 case Intrinsic::amdgcn_image_atomic_cmpswap:
265 case Intrinsic::amdgcn_buffer_atomic_swap:
266 case Intrinsic::amdgcn_buffer_atomic_add:
267 case Intrinsic::amdgcn_buffer_atomic_sub:
268 case Intrinsic::amdgcn_buffer_atomic_smin:
269 case Intrinsic::amdgcn_buffer_atomic_umin:
270 case Intrinsic::amdgcn_buffer_atomic_smax:
271 case Intrinsic::amdgcn_buffer_atomic_umax:
272 case Intrinsic::amdgcn_buffer_atomic_and:
273 case Intrinsic::amdgcn_buffer_atomic_or:
274 case Intrinsic::amdgcn_buffer_atomic_xor:
275 case Intrinsic::amdgcn_buffer_atomic_cmpswap:
276 case Intrinsic::amdgcn_ps_live:
284 case AMDGPUIntrinsic::SI_fs_interp:
285 case AMDGPUIntrinsic::SI_fs_constant:
311 if (
const Argument *
A = dyn_cast<Argument>(V))
327 if (isa<AtomicRMWInst>(V) || isa<AtomicCmpXchgInst>(V))
330 if (
const IntrinsicInst *Intrinsic = dyn_cast<IntrinsicInst>(V)) {
336 if (isa<CallInst>(V) || isa<InvokeInst>(V))
A parsed version of the target data layout string in and methods for querying it. ...
Value * getPointerOperand()
unsigned getNumberOfRegisters(bool Vector)
LLVM Argument representation.
void getUnrollingPreferences(Loop *L, TTI::UnrollingPreferences &UP)
Cost tables and simple lookup functions.
const TargetMachine & getTargetMachine() const
Intrinsic::ID getIntrinsicID() const
Return the intrinsic ID of this intrinsic.
An instruction for reading from memory.
Address space for local memory.
bool hasAttribute(unsigned Index, Attribute::AttrKind Kind) const
Return true if the attribute exists at the given index.
const std::vector< BlockT * > & getBlocks() const
Get a list of the basic blocks which make up this loop.
CallingConv::ID getCallingConv() const
getCallingConv()/setCallingConv(CC) - These method get and set the calling convention of this functio...
StringRef getName() const
Return a constant reference to the value's name.
bool isSourceOfDivergence(const Value *V) const
unsigned getRegisterBitWidth(bool Vector)
unsigned getLoadStoreVecRegBitWidth(unsigned AddrSpace) const
const HexagonInstrInfo * TII
Shift and rotation operations.
unsigned getMaxInterleaveFactor(unsigned VF)
int InstructionOpcodeToISD(unsigned Opcode) const
Get the ISD node that corresponds to the Instruction class opcode.
Simple integer binary arithmetic operators.
virtual unsigned lookupName(const char *Name, unsigned Len) const =0
Look up target intrinsic by name.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
EVT getValueType(const DataLayout &DL, Type *Ty, bool AllowUnknown=false) const
Return the EVT corresponding to this LLVM type.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
Generation getGeneration() const
Address space for region memory.
an instruction for type-safe pointer arithmetic to access elements of arrays and structs ...
bool isShader(CallingConv::ID cc)
LLVM Basic Block Representation.
The instances of the Type class are immutable: once they are created, they are never changed...
const Function * getParent() const
Address space for constant memory (VTX2)
Simple binary floating point operators.
Address space for private memory.
bool hasFP32Denormals() const
This file provides a helper that implements much of the TTI interface in terms of the target-independ...
Address space for flat memory.
EVT - Extended Value Type.
Value * GetUnderlyingObject(Value *V, const DataLayout &DL, unsigned MaxLookup=6)
This method strips off any GEP address adjustments and pointer casts from the specified value...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
TargetIntrinsicInfo - Interface to description of machine instruction set.
unsigned getAddressSpace() const
Returns the address space of this instruction's pointer type.
unsigned getCFInstrCost(unsigned Opcode)
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 * >())
Module.h This file contains the declarations for the Module class.
unsigned getCFInstrCost(unsigned Opcode)
Function * getCalledFunction() const
Return the function called, or null if this is an indirect function invocation.
AttributeSet getAttributes() const
Return the attribute list for this Function.
std::pair< int, MVT > getTypeLegalizationCost(const DataLayout &DL, Type *Ty) const
Estimate the cost of type-legalization and the legalized type.
int getVectorInstrCost(unsigned Opcode, Type *ValTy, unsigned Index)
Bitwise operators - logical and, logical or, logical xor.
unsigned getMaxPrivateElementSize() const
virtual const TargetIntrinsicInfo * getIntrinsicInfo() const
If intrinsic information is available, return it. If not, return null.
Address space for indirect addressible parameter memory (VTX1)
Represents a single loop in the control flow graph.
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)
Address space for direct addressible parameter memory (CONST0)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool isSimple() const
isSimple - Test if the given EVT is simple (as opposed to being extended).
const unsigned char * bytes_begin() const
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 * >())
LLVM Value Representation.
unsigned getArgNo() const
Return the index of this formal argument in its containing function.
Primary interface to the complete machine description for the target machine.
StringRef - Represent a constant reference to a string, i.e.
static GCRegistry::Add< ErlangGC > A("erlang","erlang-compatible garbage collector")
A wrapper class for inspecting calls to intrinsic functions.
This file describes how to lower LLVM code to machine code.
an instruction to allocate memory on the stack
Address space for global memory (RAT0, VTX0).