LLVM  3.7.0
Public Member Functions | Protected Member Functions | List of all members
llvm::BasicTTIImplBase< T > Class Template Reference

Base class which can be used to help build a TTI implementation. More...

#include <BasicTTIImpl.h>

Inheritance diagram for llvm::BasicTTIImplBase< T >:
[legend]
Collaboration diagram for llvm::BasicTTIImplBase< T >:
[legend]

Public Member Functions

 BasicTTIImplBase (const BasicTTIImplBase &Arg)
 
 BasicTTIImplBase (BasicTTIImplBase &&Arg)
 
Scalar TTI Implementations
bool hasBranchDivergence ()
 
bool isSourceOfDivergence (const Value *V)
 
bool isLegalAddImmediate (int64_t imm)
 
bool isLegalICmpImmediate (int64_t imm)
 
bool isLegalAddressingMode (Type *Ty, GlobalValue *BaseGV, int64_t BaseOffset, bool HasBaseReg, int64_t Scale, unsigned AddrSpace)
 
int getScalingFactorCost (Type *Ty, GlobalValue *BaseGV, int64_t BaseOffset, bool HasBaseReg, int64_t Scale, unsigned AddrSpace)
 
bool isTruncateFree (Type *Ty1, Type *Ty2)
 
bool isProfitableToHoist (Instruction *I)
 
bool isTypeLegal (Type *Ty)
 
unsigned getIntrinsicCost (Intrinsic::ID IID, Type *RetTy, ArrayRef< const Value * > Arguments)
 
unsigned getIntrinsicCost (Intrinsic::ID IID, Type *RetTy, ArrayRef< Type * > ParamTys)
 
unsigned getJumpBufAlignment ()
 
unsigned getJumpBufSize ()
 
bool shouldBuildLookupTables ()
 
bool haveFastSqrt (Type *Ty)
 
unsigned getFPOpCost (Type *Ty)
 
unsigned getOperationCost (unsigned Opcode, Type *Ty, Type *OpTy)
 
void getUnrollingPreferences (Loop *L, TTI::UnrollingPreferences &UP)
 
Vector TTI Implementations
unsigned getNumberOfRegisters (bool Vector)
 
unsigned getRegisterBitWidth (bool Vector)
 
unsigned getMaxInterleaveFactor (unsigned VF)
 
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)
 
unsigned getShuffleCost (TTI::ShuffleKind Kind, Type *Tp, int Index, Type *SubTp)
 
unsigned getCastInstrCost (unsigned Opcode, Type *Dst, Type *Src)
 
unsigned getCFInstrCost (unsigned Opcode)
 
unsigned getCmpSelInstrCost (unsigned Opcode, Type *ValTy, Type *CondTy)
 
unsigned getVectorInstrCost (unsigned Opcode, Type *Val, unsigned Index)
 
unsigned getMemoryOpCost (unsigned Opcode, Type *Src, unsigned Alignment, unsigned AddressSpace)
 
unsigned getInterleavedMemoryOpCost (unsigned Opcode, Type *VecTy, unsigned Factor, ArrayRef< unsigned > Indices, unsigned Alignment, unsigned AddressSpace)
 
unsigned getIntrinsicInstrCost (Intrinsic::ID IID, Type *RetTy, ArrayRef< Type * > Tys)
 
unsigned getCallInstrCost (Function *F, Type *RetTy, ArrayRef< Type * > Tys)
 Compute a cost of the given call instruction. More...
 
unsigned getNumberOfParts (Type *Tp)
 
unsigned getAddressComputationCost (Type *Ty, bool IsComplex)
 
unsigned getReductionCost (unsigned Opcode, Type *Ty, bool IsPairwise)
 
- Public Member Functions inherited from llvm::TargetTransformInfoImplCRTPBase< T >
 TargetTransformInfoImplCRTPBase (const TargetTransformInfoImplCRTPBase &Arg)
 
 TargetTransformInfoImplCRTPBase (TargetTransformInfoImplCRTPBase &&Arg)
 
unsigned getCallCost (const Function *F, int NumArgs)
 
unsigned getCallCost (const Function *F, ArrayRef< const Value * > Arguments)
 
unsigned getIntrinsicCost (Intrinsic::ID IID, Type *RetTy, ArrayRef< const Value * > Arguments)
 
unsigned getUserCost (const User *U)
 
- Public Member Functions inherited from llvm::TargetTransformInfoImplBase
 TargetTransformInfoImplBase (const TargetTransformInfoImplBase &Arg)
 
 TargetTransformInfoImplBase (TargetTransformInfoImplBase &&Arg)
 
const DataLayoutgetDataLayout () const
 
unsigned getOperationCost (unsigned Opcode, Type *Ty, Type *OpTy)
 
unsigned getGEPCost (const Value *Ptr, ArrayRef< const Value * > Operands)
 
unsigned getCallCost (FunctionType *FTy, int NumArgs)
 
unsigned getIntrinsicCost (Intrinsic::ID IID, Type *RetTy, ArrayRef< Type * > ParamTys)
 
bool hasBranchDivergence ()
 
bool isSourceOfDivergence (const Value *V)
 
bool isLoweredToCall (const Function *F)
 
void getUnrollingPreferences (Loop *, TTI::UnrollingPreferences &)
 
bool isLegalAddImmediate (int64_t Imm)
 
bool isLegalICmpImmediate (int64_t Imm)
 
bool isLegalAddressingMode (Type *Ty, GlobalValue *BaseGV, int64_t BaseOffset, bool HasBaseReg, int64_t Scale, unsigned AddrSpace)
 
bool isLegalMaskedStore (Type *DataType, int Consecutive)
 
bool isLegalMaskedLoad (Type *DataType, int Consecutive)
 
int getScalingFactorCost (Type *Ty, GlobalValue *BaseGV, int64_t BaseOffset, bool HasBaseReg, int64_t Scale, unsigned AddrSpace)
 
bool isTruncateFree (Type *Ty1, Type *Ty2)
 
bool isProfitableToHoist (Instruction *I)
 
bool isTypeLegal (Type *Ty)
 
unsigned getJumpBufAlignment ()
 
unsigned getJumpBufSize ()
 
bool shouldBuildLookupTables ()
 
bool enableAggressiveInterleaving (bool LoopHasReductions)
 
TTI::PopcntSupportKind getPopcntSupport (unsigned IntTyWidthInBit)
 
bool haveFastSqrt (Type *Ty)
 
unsigned getFPOpCost (Type *Ty)
 
unsigned getIntImmCost (const APInt &Imm, Type *Ty)
 
unsigned getIntImmCost (unsigned Opcode, unsigned Idx, const APInt &Imm, Type *Ty)
 
unsigned getIntImmCost (Intrinsic::ID IID, unsigned Idx, const APInt &Imm, Type *Ty)
 
unsigned getNumberOfRegisters (bool Vector)
 
unsigned getRegisterBitWidth (bool Vector)
 
unsigned getMaxInterleaveFactor (unsigned VF)
 
unsigned getArithmeticInstrCost (unsigned Opcode, Type *Ty, TTI::OperandValueKind Opd1Info, TTI::OperandValueKind Opd2Info, TTI::OperandValueProperties Opd1PropInfo, TTI::OperandValueProperties Opd2PropInfo)
 
unsigned getShuffleCost (TTI::ShuffleKind Kind, Type *Ty, int Index, Type *SubTp)
 
unsigned getCastInstrCost (unsigned Opcode, Type *Dst, Type *Src)
 
unsigned getCFInstrCost (unsigned Opcode)
 
unsigned getCmpSelInstrCost (unsigned Opcode, Type *ValTy, Type *CondTy)
 
unsigned getVectorInstrCost (unsigned Opcode, Type *Val, unsigned Index)
 
unsigned getMemoryOpCost (unsigned Opcode, Type *Src, unsigned Alignment, unsigned AddressSpace)
 
unsigned getMaskedMemoryOpCost (unsigned Opcode, Type *Src, unsigned Alignment, unsigned AddressSpace)
 
unsigned getInterleavedMemoryOpCost (unsigned Opcode, Type *VecTy, unsigned Factor, ArrayRef< unsigned > Indices, unsigned Alignment, unsigned AddressSpace)
 
unsigned getIntrinsicInstrCost (Intrinsic::ID ID, Type *RetTy, ArrayRef< Type * > Tys)
 
unsigned getCallInstrCost (Function *F, Type *RetTy, ArrayRef< Type * > Tys)
 
unsigned getNumberOfParts (Type *Tp)
 
unsigned getAddressComputationCost (Type *Tp, bool)
 
unsigned getReductionCost (unsigned, Type *, bool)
 
unsigned getCostOfKeepingLiveOverCall (ArrayRef< Type * > Tys)
 
bool getTgtMemIntrinsic (IntrinsicInst *Inst, MemIntrinsicInfo &Info)
 
ValuegetOrCreateResultFromMemIntrinsic (IntrinsicInst *Inst, Type *ExpectedType)
 
bool hasCompatibleFunctionAttributes (const Function *Caller, const Function *Callee) const
 

Protected Member Functions

 BasicTTIImplBase (const TargetMachine *TM, const DataLayout &DL)
 
- Protected Member Functions inherited from llvm::TargetTransformInfoImplCRTPBase< T >
 TargetTransformInfoImplCRTPBase (const DataLayout &DL)
 
- Protected Member Functions inherited from llvm::TargetTransformInfoImplBase
 TargetTransformInfoImplBase (const DataLayout &DL)
 

Additional Inherited Members

- Protected Types inherited from llvm::TargetTransformInfoImplBase
typedef TargetTransformInfo TTI
 
- Protected Attributes inherited from llvm::TargetTransformInfoImplBase
const DataLayoutDL
 

Detailed Description

template<typename T>
class llvm::BasicTTIImplBase< T >

Base class which can be used to help build a TTI implementation.

This class provides as much implementation of the TTI interface as is possible using the target independent parts of the code generator.

In order to subclass it, your class must implement a getST() method to return the subtarget, and a getTLI() method to return the target lowering. We need these methods implemented in the derived class so that this class doesn't have to duplicate storage for them.

Definition at line 40 of file BasicTTIImpl.h.

Constructor & Destructor Documentation

template<typename T>
llvm::BasicTTIImplBase< T >::BasicTTIImplBase ( const TargetMachine TM,
const DataLayout DL 
)
inlineexplicitprotected

Definition at line 94 of file BasicTTIImpl.h.

template<typename T>
llvm::BasicTTIImplBase< T >::BasicTTIImplBase ( const BasicTTIImplBase< T > &  Arg)
inline

Definition at line 101 of file BasicTTIImpl.h.

template<typename T>
llvm::BasicTTIImplBase< T >::BasicTTIImplBase ( BasicTTIImplBase< T > &&  Arg)
inline

Definition at line 103 of file BasicTTIImpl.h.

Member Function Documentation

template<typename T>
unsigned llvm::BasicTTIImplBase< T >::getAddressComputationCost ( Type Ty,
bool  IsComplex 
)
inline

Definition at line 770 of file BasicTTIImpl.h.

template<typename T>
unsigned llvm::BasicTTIImplBase< T >::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 
)
inline
template<typename T>
unsigned llvm::BasicTTIImplBase< T >::getCallInstrCost ( Function F,
Type RetTy,
ArrayRef< Type * >  Tys 
)
inline

Compute a cost of the given call instruction.

Compute the cost of calling function F with return type RetTy and argument types Tys. F might be nullptr, in this case the cost of an arbitrary call with the specified signature will be returned. This is used, for instance, when we estimate call of a vector counterpart of the given function.

Parameters
FCalled function, might be nullptr.
RetTyReturn value types.
TysArgument types.
Returns
The cost of Call instruction.

Definition at line 761 of file BasicTTIImpl.h.

template<typename T>
unsigned llvm::BasicTTIImplBase< T >::getCastInstrCost ( unsigned  Opcode,
Type Dst,
Type Src 
)
inline
template<typename T>
unsigned llvm::BasicTTIImplBase< T >::getCFInstrCost ( unsigned  Opcode)
inline

Definition at line 435 of file BasicTTIImpl.h.

template<typename T>
unsigned llvm::BasicTTIImplBase< T >::getCmpSelInstrCost ( unsigned  Opcode,
Type ValTy,
Type CondTy 
)
inline
template<typename T>
unsigned llvm::BasicTTIImplBase< T >::getFPOpCost ( Type Ty)
inline

Definition at line 194 of file BasicTTIImpl.h.

template<typename T>
unsigned llvm::BasicTTIImplBase< T >::getInterleavedMemoryOpCost ( unsigned  Opcode,
Type VecTy,
unsigned  Factor,
ArrayRef< unsigned Indices,
unsigned  Alignment,
unsigned  AddressSpace 
)
inline

Definition at line 518 of file BasicTTIImpl.h.

template<typename T>
unsigned llvm::BasicTTIImplBase< T >::getIntrinsicCost ( Intrinsic::ID  IID,
Type RetTy,
ArrayRef< const Value * >  Arguments 
)
inline

Definition at line 155 of file BasicTTIImpl.h.

template<typename T>
unsigned llvm::BasicTTIImplBase< T >::getIntrinsicCost ( Intrinsic::ID  IID,
Type RetTy,
ArrayRef< Type * >  ParamTys 
)
inline

Definition at line 160 of file BasicTTIImpl.h.

template<typename T>
unsigned llvm::BasicTTIImplBase< T >::getIntrinsicInstrCost ( Intrinsic::ID  IID,
Type RetTy,
ArrayRef< Type * >  Tys 
)
inline
template<typename T>
unsigned llvm::BasicTTIImplBase< T >::getJumpBufAlignment ( )
inline

Definition at line 177 of file BasicTTIImpl.h.

template<typename T>
unsigned llvm::BasicTTIImplBase< T >::getJumpBufSize ( )
inline

Definition at line 179 of file BasicTTIImpl.h.

template<typename T>
unsigned llvm::BasicTTIImplBase< T >::getMaxInterleaveFactor ( unsigned  VF)
inline

Definition at line 283 of file BasicTTIImpl.h.

template<typename T>
unsigned llvm::BasicTTIImplBase< T >::getMemoryOpCost ( unsigned  Opcode,
Type Src,
unsigned  Alignment,
unsigned  AddressSpace 
)
inline
template<typename T>
unsigned llvm::BasicTTIImplBase< T >::getNumberOfParts ( Type Tp)
inline

Definition at line 765 of file BasicTTIImpl.h.

template<typename T>
unsigned llvm::BasicTTIImplBase< T >::getNumberOfRegisters ( bool  Vector)
inline

Definition at line 279 of file BasicTTIImpl.h.

template<typename T>
unsigned llvm::BasicTTIImplBase< T >::getOperationCost ( unsigned  Opcode,
Type Ty,
Type OpTy 
)
inline

Definition at line 200 of file BasicTTIImpl.h.

template<typename T>
unsigned llvm::BasicTTIImplBase< T >::getReductionCost ( unsigned  Opcode,
Type Ty,
bool  IsPairwise 
)
inline

Definition at line 772 of file BasicTTIImpl.h.

template<typename T>
unsigned llvm::BasicTTIImplBase< T >::getRegisterBitWidth ( bool  Vector)
inline

Definition at line 281 of file BasicTTIImpl.h.

template<typename T>
int llvm::BasicTTIImplBase< T >::getScalingFactorCost ( Type Ty,
GlobalValue BaseGV,
int64_t  BaseOffset,
bool  HasBaseReg,
int64_t  Scale,
unsigned  AddrSpace 
)
inline

Definition at line 132 of file BasicTTIImpl.h.

template<typename T>
unsigned llvm::BasicTTIImplBase< T >::getShuffleCost ( TTI::ShuffleKind  Kind,
Type Tp,
int  Index,
Type SubTp 
)
inline

Definition at line 334 of file BasicTTIImpl.h.

template<typename T>
void llvm::BasicTTIImplBase< T >::getUnrollingPreferences ( Loop L,
TTI::UnrollingPreferences UP 
)
inline

Definition at line 219 of file BasicTTIImpl.h.

template<typename T>
unsigned llvm::BasicTTIImplBase< T >::getVectorInstrCost ( unsigned  Opcode,
Type Val,
unsigned  Index 
)
inline
template<typename T>
bool llvm::BasicTTIImplBase< T >::hasBranchDivergence ( )
inline

Definition at line 109 of file BasicTTIImpl.h.

template<typename T>
bool llvm::BasicTTIImplBase< T >::haveFastSqrt ( Type Ty)
inline

Definition at line 187 of file BasicTTIImpl.h.

template<typename T>
bool llvm::BasicTTIImplBase< T >::isLegalAddImmediate ( int64_t  imm)
inline

Definition at line 113 of file BasicTTIImpl.h.

template<typename T>
bool llvm::BasicTTIImplBase< T >::isLegalAddressingMode ( Type Ty,
GlobalValue BaseGV,
int64_t  BaseOffset,
bool  HasBaseReg,
int64_t  Scale,
unsigned  AddrSpace 
)
inline

Definition at line 121 of file BasicTTIImpl.h.

template<typename T>
bool llvm::BasicTTIImplBase< T >::isLegalICmpImmediate ( int64_t  imm)
inline

Definition at line 117 of file BasicTTIImpl.h.

template<typename T>
bool llvm::BasicTTIImplBase< T >::isProfitableToHoist ( Instruction I)
inline

Definition at line 146 of file BasicTTIImpl.h.

template<typename T>
bool llvm::BasicTTIImplBase< T >::isSourceOfDivergence ( const Value V)
inline

Definition at line 111 of file BasicTTIImpl.h.

template<typename T>
bool llvm::BasicTTIImplBase< T >::isTruncateFree ( Type Ty1,
Type Ty2 
)
inline

Definition at line 142 of file BasicTTIImpl.h.

template<typename T>
bool llvm::BasicTTIImplBase< T >::isTypeLegal ( Type Ty)
inline

Definition at line 150 of file BasicTTIImpl.h.

template<typename T>
bool llvm::BasicTTIImplBase< T >::shouldBuildLookupTables ( )
inline

Definition at line 181 of file BasicTTIImpl.h.


The documentation for this class was generated from the following file: