Go to the documentation of this file.
16 #ifndef LLVM_LIB_TARGET_RISCV_RISCVTARGETTRANSFORMINFO_H
17 #define LLVM_LIB_TARGET_RISCV_RISCVTARGETTRANSFORMINFO_H
43 TLI(ST->getTargetLowering()) {}
77 return ST->useRVVForFixedLengthVectors() ? 16 : 0;
90 const Value *Ptr,
bool VariableMask,
109 if (!ST->hasVInstructions())
113 if (isa<FixedVectorType>(DataType) && ST->getMinRVVVectorSizeInBits() == 0)
118 if (isa<FixedVectorType>(DataType) &&
137 if (!ST->hasVInstructions())
141 if (isa<FixedVectorType>(DataType) && ST->getMinRVVVectorSizeInBits() == 0)
146 if (isa<FixedVectorType>(DataType) &&
202 return VF == 1 ? 1 : ST->getMaxInterleaveFactor();
208 bool Vector = (ClassID == 1);
210 if (ST->hasVInstructions())
222 #endif // LLVM_LIB_TARGET_RISCV_RISCVTARGETTRANSFORMINFO_H
Optional< unsigned > getMaxVScale() const
bool shouldExpandReduction(const IntrinsicInst *II) const
This is an optimization pass for GlobalISel generic memory operations.
InstructionCost getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA, TTI::TargetCostKind CostKind)
InstructionCost getIntImmCostIntrin(Intrinsic::ID IID, unsigned Idx, const APInt &Imm, Type *Ty, TTI::TargetCostKind CostKind)
TargetTransformInfo::PopcntSupportKind getPopcntSupport(unsigned TyWidth)
@ Or
Bitwise or logical OR of integers.
InstructionCost getMinMaxReductionCost(VectorType *Ty, VectorType *CondTy, bool IsUnsigned, TTI::TargetCostKind CostKind)
RISCVTTIImpl(const RISCVTargetMachine *TM, const Function &F)
ScalarTy getFixedSize() const
Represents a single loop in the control flow graph.
InstructionCost getMaskedMemoryOpCost(unsigned Opcode, Type *Src, Align Alignment, unsigned AddressSpace, TTI::TargetCostKind CostKind)
Type * getScalarType() const
If this is a vector type, return the element type, otherwise return 'this'.
TypeSize getTypeStoreSize(Type *Ty) const
Returns the maximum number of bytes that may be overwritten by storing the specified type.
The main scalar evolution driver.
bool isLegalMaskedScatter(Type *DataType, Align Alignment)
InstructionCost getArithmeticReductionCost(unsigned Opcode, VectorType *Ty, Optional< FastMathFlags > FMF, TTI::TargetCostKind CostKind)
The instances of the Type class are immutable: once they are created, they are never changed.
bool isLegalMaskedGather(Type *DataType, Align Alignment)
unsigned getNumberOfRegisters(unsigned ClassID) const
So we should use XX3Form_Rcr to implement intrinsic Convert DP outs ins xscvdpsp No builtin are required Round &Convert QP DP(dword[1] is set to zero) No builtin are required Round to Quad Precision because you need to assign rounding mode in instruction Provide builtin(set f128:$vT,(int_ppc_vsx_xsrqpi f128:$vB))(set f128 yields< n x< ty > >< result > yields< ty >< result > No builtin are required Load Store Vector
InstructionCost getIntImmCost(const APInt &Imm, Type *Ty, TTI::TargetCostKind CostKind)
@ SMin
Signed integer min implemented in terms of select(cmp()).
unsigned getMinVectorRegisterBitWidth() const
bool isScalable() const
Returns whether the size is scaled by a runtime quantity (vscale).
constexpr std::underlying_type_t< E > Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
void getPeelingPreferences(Loop *L, ScalarEvolution &SE, TTI::PeelingPreferences &PP)
bool isLegalElementTypeForRVV(Type *ScalarTy) const
@ And
Bitwise or logical AND of integers.
TypeSize getRegisterBitWidth(TargetTransformInfo::RegisterKind K) const
InstructionCost getSpliceCost(VectorType *Tp, int Index)
Type * getRecurrenceType() const
Returns the type of the recurrence.
bool supportsScalableVectors() const
unsigned getScalarSizeInBits() const LLVM_READONLY
If this is a vector type, return the getPrimitiveSizeInBits value for the element type.
RecurKind getRecurrenceKind() const
InstructionCost getRegUsageForType(Type *Ty)
unsigned getMaxInterleaveFactor(unsigned VF)
This struct is a compact representation of a valid (non-zero power of two) alignment.
bool isLegalMaskedStore(Type *DataType, Align Alignment)
@ UMin
Unisgned integer min implemented in terms of select(cmp()).
InstructionCost getGatherScatterOpCost(unsigned Opcode, Type *DataTy, const Value *Ptr, bool VariableMask, Align Alignment, TTI::TargetCostKind CostKind, const Instruction *I)
Base class of all SIMD vector types.
bool isLegalToVectorizeReduction(const RecurrenceDescriptor &RdxDesc, ElementCount VF) const
InstructionCost getShuffleCost(TTI::ShuffleKind Kind, VectorType *Tp, ArrayRef< int > Mask, int Index, VectorType *SubTp, ArrayRef< const Value * > Args=None)
Base class which can be used to help build a TTI implementation.
bool isLegalMaskedLoadStore(Type *DataType, Align Alignment)
TargetTransformInfo::VPLegalization getVPLegalizationStrategy(const VPIntrinsic &PI) const
void getUnrollingPreferences(Loop *L, ScalarEvolution &SE, TTI::UnrollingPreferences &UP, OptimizationRemarkEmitter *ORE)
InstructionCost getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src, TTI::CastContextHint CCH, TTI::TargetCostKind CostKind, const Instruction *I=nullptr)
bool isLegalMaskedGatherScatter(Type *DataType, Align Alignment)
Class for arbitrary precision integers.
@ UMax
Unsigned integer max implemented in terms of select(cmp()).
static cl::opt< TargetTransformInfo::TargetCostKind > CostKind("cost-kind", cl::desc("Target cost kind"), cl::init(TargetTransformInfo::TCK_RecipThroughput), cl::values(clEnumValN(TargetTransformInfo::TCK_RecipThroughput, "throughput", "Reciprocal throughput"), clEnumValN(TargetTransformInfo::TCK_Latency, "latency", "Instruction latency"), clEnumValN(TargetTransformInfo::TCK_CodeSize, "code-size", "Code size"), clEnumValN(TargetTransformInfo::TCK_SizeAndLatency, "size-latency", "Code size and latency")))
static const Function * getParent(const Value *V)
@ FMax
FP max implemented in terms of select(cmp()).
This is the common base class for vector predication intrinsics.
TargetTransformInfo::VPLegalization VPLegalization
bool isLegalMaskedLoad(Type *DataType, Align Alignment)
A wrapper class for inspecting calls to intrinsic functions.
The RecurrenceDescriptor is used to identify recurrences variables in a loop.
const char LLVMTargetMachineRef TM
@ FMin
FP min implemented in terms of select(cmp()).
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
@ SMax
Signed integer max implemented in terms of select(cmp()).
LLVM Value Representation.
InstructionCost getIntImmCostInst(unsigned Opcode, unsigned Idx, const APInt &Imm, Type *Ty, TTI::TargetCostKind CostKind, Instruction *Inst=nullptr)
@ Xor
Bitwise or logical XOR of integers.