LLVM 20.0.0git
|
#include "Target/RISCV/RISCVTargetTransformInfo.h"
Additional Inherited Members | |
Protected Types inherited from llvm::TargetTransformInfoImplBase | |
typedef TargetTransformInfo | TTI |
Protected Member Functions inherited from llvm::BasicTTIImplBase< RISCVTTIImpl > | |
BasicTTIImplBase (const TargetMachine *TM, const DataLayout &DL) | |
virtual | ~BasicTTIImplBase ()=default |
Protected Member Functions inherited from llvm::TargetTransformInfoImplCRTPBase< T > | |
TargetTransformInfoImplCRTPBase (const DataLayout &DL) | |
Protected Member Functions inherited from llvm::TargetTransformInfoImplBase | |
TargetTransformInfoImplBase (const DataLayout &DL) | |
unsigned | minRequiredElementSize (const Value *Val, bool &isSigned) const |
bool | isStridedAccess (const SCEV *Ptr) const |
const SCEVConstant * | getConstantStrideStep (ScalarEvolution *SE, const SCEV *Ptr) const |
bool | isConstantStridedAccessLessThan (ScalarEvolution *SE, const SCEV *Ptr, int64_t MergeDistance) const |
Protected Attributes inherited from llvm::BasicTTIImplBase< RISCVTTIImpl > | |
const DataLayout & | DL |
Protected Attributes inherited from llvm::TargetTransformInfoImplBase | |
const DataLayout & | DL |
Definition at line 29 of file RISCVTargetTransformInfo.h.
Enumerator | |
---|---|
GPRRC | |
FPRRC | |
VRRC |
Definition at line 370 of file RISCVTargetTransformInfo.h.
|
inlineexplicit |
Definition at line 59 of file RISCVTargetTransformInfo.h.
bool RISCVTTIImpl::canSplatOperand | ( | Instruction * | I, |
int | Operand | ||
) | const |
Return true if the (vector) instruction I will be lowered to an instruction with a scalar splat operand for the given Operand number.
Definition at line 2435 of file RISCVTargetTransformInfo.cpp.
References canSplatOperand(), llvm::RISCVSubtarget::hasVInstructions(), I, and II.
Referenced by canSplatOperand(), getArithmeticInstrCost(), and isProfitableToSinkOperands().
Return true if a vector instruction will lower to a target instruction able to splat the given operand.
Definition at line 2406 of file RISCVTargetTransformInfo.cpp.
|
inline |
Definition at line 368 of file RISCVTargetTransformInfo.h.
RISCVTTIImpl::TTI::MemCmpExpansionOptions RISCVTTIImpl::enableMemCmpExpansion | ( | bool | OptSize, |
bool | IsZeroCmp | ||
) | const |
Definition at line 2548 of file RISCVTargetTransformInfo.cpp.
References llvm::TargetLoweringBase::getMaxExpandSizeMemcmp(), llvm::RISCVSubtarget::is64Bit(), and Options.
|
inline |
Definition at line 98 of file RISCVTargetTransformInfo.h.
|
inline |
Definition at line 99 of file RISCVTargetTransformInfo.h.
|
inline |
Definition at line 280 of file RISCVTargetTransformInfo.h.
|
inline |
Definition at line 285 of file RISCVTargetTransformInfo.h.
InstructionCost RISCVTTIImpl::getArithmeticInstrCost | ( | unsigned | Opcode, |
Type * | Ty, | ||
TTI::TargetCostKind | CostKind, | ||
TTI::OperandValueInfo | Op1Info = {TTI::OK_AnyValue, TTI::OP_None} , |
||
TTI::OperandValueInfo | Op2Info = {TTI::OK_AnyValue, TTI::OP_None} , |
||
ArrayRef< const Value * > | Args = {} , |
||
const Instruction * | CxtI = nullptr |
||
) |
Definition at line 2037 of file RISCVTargetTransformInfo.cpp.
References llvm::ISD::ADD, llvm::ISD::AND, canSplatOperand(), CostKind, llvm::ISD::FADD, llvm::ISD::FDIV, llvm::ISD::FMUL, llvm::ISD::FNEG, llvm::ISD::FSUB, llvm::BasicTTIImplBase< RISCVTTIImpl >::getArithmeticInstrCost(), getCastInstrCost(), llvm::Type::getContext(), llvm::RISCVSubtarget::getELen(), llvm::TargetLoweringBase::getOperationAction(), llvm::Type::getScalarSizeInBits(), llvm::EVT::getTypeForEVT(), llvm::BasicTTIImplBase< RISCVTTIImpl >::getTypeLegalizationCost(), llvm::TargetLoweringBase::getTypeToPromoteTo(), InstrCost, llvm::TargetLoweringBase::InstructionOpcodeToISD(), llvm::TargetTransformInfo::OperandValueInfo::isConstant(), llvm::Type::isFPOrFPVectorTy(), llvm::ISD::MUL, llvm::ISD::MULHS, llvm::ISD::MULHU, llvm::TargetTransformInfo::None, llvm::ISD::OR, llvm::TargetLoweringBase::Promote, llvm::ISD::SDIV, llvm::ISD::SHL, llvm::ISD::SRA, llvm::ISD::SREM, llvm::ISD::SRL, llvm::ISD::SUB, llvm::TargetTransformInfo::TCK_RecipThroughput, llvm::ISD::UDIV, llvm::ISD::UREM, llvm::RISCVSubtarget::useRVVForFixedLengthVectors(), and llvm::ISD::XOR.
Referenced by getIntrinsicInstrCost(), and getPointersChainCost().
InstructionCost RISCVTTIImpl::getArithmeticReductionCost | ( | unsigned | Opcode, |
VectorType * | Ty, | ||
std::optional< FastMathFlags > | FMF, | ||
TTI::TargetCostKind | CostKind | ||
) |
Definition at line 1519 of file RISCVTargetTransformInfo.cpp.
References llvm::ISD::ADD, llvm::ISD::AND, assert(), CostKind, llvm::ISD::FADD, llvm::BasicTTIImplBase< RISCVTTIImpl >::getArithmeticReductionCost(), getCmpSelInstrCost(), llvm::VectorType::getElementType(), llvm::RISCVSubtarget::getELen(), llvm::Type::getScalarSizeInBits(), llvm::BasicTTIImplBase< RISCVTTIImpl >::getTypeLegalizationCost(), llvm::RISCVSubtarget::hasVInstructionsF16(), llvm::CmpInst::ICMP_EQ, llvm::CmpInst::ICMP_NE, llvm::TargetLoweringBase::InstructionOpcodeToISD(), llvm::Type::isIntegerTy(), llvm::ISD::OR, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::TargetTransformInfo::requiresOrderedReduction(), llvm::RISCVSubtarget::useRVVForFixedLengthVectors(), and llvm::ISD::XOR.
Referenced by getExtendedReductionCost(), and getMinMaxReductionCost().
InstructionCost RISCVTTIImpl::getCastInstrCost | ( | unsigned | Opcode, |
Type * | Dst, | ||
Type * | Src, | ||
TTI::CastContextHint | CCH, | ||
TTI::TargetCostKind | CostKind, | ||
const Instruction * | I = nullptr |
||
) |
Definition at line 1207 of file RISCVTargetTransformInfo.cpp.
References assert(), llvm::MVT::changeVectorElementType(), CostKind, llvm::BasicTTIImplBase< RISCVTTIImpl >::DL, llvm::ISD::FP_EXTEND, llvm::ISD::FP_ROUND, llvm::ISD::FP_TO_SINT, llvm::ISD::FP_TO_UINT, llvm::IntegerType::get(), llvm::VectorType::get(), llvm::BasicTTIImplBase< RISCVTTIImpl >::getCastInstrCost(), getCastInstrCost(), llvm::TargetTransformInfoImplBase::getDataLayout(), llvm::RISCVSubtarget::getELen(), llvm::MVT::getFloatingPointVT(), llvm::Type::getFloatTy(), llvm::MVT::getIntegerVT(), llvm::EVT::getTypeForEVT(), llvm::BasicTTIImplBase< RISCVTTIImpl >::getTypeLegalizationCost(), llvm::DataLayout::getTypeSizeInBits(), llvm::RISCVSubtarget::hasVInstructions(), llvm::RISCVSubtarget::hasVInstructionsF16(), I, llvm::TargetLoweringBase::InstructionOpcodeToISD(), llvm::details::FixedOrScalableQuantity< TypeSize, uint64_t >::isKnownLE(), llvm::Log2_32(), llvm::ISD::SIGN_EXTEND, llvm::ISD::SINT_TO_FP, llvm::ISD::TRUNCATE, llvm::ISD::UINT_TO_FP, and llvm::ISD::ZERO_EXTEND.
Referenced by getArithmeticInstrCost(), getCastInstrCost(), getMinMaxReductionCost(), getScalarizationOverhead(), and getVectorInstrCost().
InstructionCost RISCVTTIImpl::getCFInstrCost | ( | unsigned | Opcode, |
TTI::TargetCostKind | CostKind, | ||
const Instruction * | I = nullptr |
||
) |
Definition at line 1881 of file RISCVTargetTransformInfo.cpp.
References CostKind, and llvm::TargetTransformInfo::TCK_RecipThroughput.
Referenced by getMinMaxReductionCost().
InstructionCost RISCVTTIImpl::getCmpSelInstrCost | ( | unsigned | Opcode, |
Type * | ValTy, | ||
Type * | CondTy, | ||
CmpInst::Predicate | VecPred, | ||
TTI::TargetCostKind | CostKind, | ||
TTI::OperandValueInfo | Op1Info = {TTI::OK_AnyValue, TTI::OP_None} , |
||
TTI::OperandValueInfo | Op2Info = {TTI::OK_AnyValue, TTI::OP_None} , |
||
const Instruction * | I = nullptr |
||
) |
Definition at line 1721 of file RISCVTargetTransformInfo.cpp.
References llvm::all_of(), CostKind, llvm::CmpInst::FCMP_FALSE, llvm::CmpInst::FCMP_OEQ, llvm::CmpInst::FCMP_OGE, llvm::CmpInst::FCMP_OGT, llvm::CmpInst::FCMP_OLE, llvm::CmpInst::FCMP_OLT, llvm::CmpInst::FCMP_ONE, llvm::CmpInst::FCMP_ORD, llvm::CmpInst::FCMP_TRUE, llvm::CmpInst::FCMP_UEQ, llvm::CmpInst::FCMP_UGE, llvm::CmpInst::FCMP_UGT, llvm::CmpInst::FCMP_ULE, llvm::CmpInst::FCMP_ULT, llvm::CmpInst::FCMP_UNE, llvm::CmpInst::FCMP_UNO, llvm::BasicTTIImplBase< RISCVTTIImpl >::getCmpSelInstrCost(), llvm::RISCVSubtarget::getELen(), llvm::Type::getScalarSizeInBits(), llvm::BasicTTIImplBase< RISCVTTIImpl >::getTypeLegalizationCost(), llvm::RISCVSubtarget::hasConditionalMoveFusion(), llvm::RISCVSubtarget::hasVInstructionsF16(), llvm::RISCVSubtarget::hasVInstructionsF32(), llvm::RISCVSubtarget::hasVInstructionsF64(), I, llvm::TargetTransformInfo::OperandValueInfo::isConstant(), llvm::CmpInst::isFPPredicate(), llvm::Type::isIntegerTy(), llvm::CmpInst::isIntPredicate(), llvm::Type::isVectorTy(), llvm::TargetTransformInfo::TCK_RecipThroughput, and llvm::RISCVSubtarget::useRVVForFixedLengthVectors().
Referenced by getArithmeticReductionCost(), and getIntrinsicInstrCost().
InstructionCost RISCVTTIImpl::getCostOfKeepingLiveOverCall | ( | ArrayRef< Type * > | Tys | ) |
Definition at line 864 of file RISCVTargetTransformInfo.cpp.
References A, CostKind, llvm::BasicTTIImplBase< RISCVTTIImpl >::DL, getMemoryOpCost(), llvm::DataLayout::getPrefTypeAlign(), and llvm::TargetTransformInfo::TCK_RecipThroughput.
InstructionCost RISCVTTIImpl::getExtendedReductionCost | ( | unsigned | Opcode, |
bool | IsUnsigned, | ||
Type * | ResTy, | ||
VectorType * | ValTy, | ||
FastMathFlags | FMF, | ||
TTI::TargetCostKind | CostKind | ||
) |
Definition at line 1621 of file RISCVTargetTransformInfo.cpp.
References CostKind, getArithmeticReductionCost(), llvm::RISCVSubtarget::getELen(), llvm::BasicTTIImplBase< RISCVTTIImpl >::getExtendedReductionCost(), llvm::Type::getScalarSizeInBits(), llvm::BasicTTIImplBase< RISCVTTIImpl >::getTypeLegalizationCost(), and llvm::RISCVSubtarget::useRVVForFixedLengthVectors().
InstructionCost RISCVTTIImpl::getGatherScatterOpCost | ( | unsigned | Opcode, |
Type * | DataTy, | ||
const Value * | Ptr, | ||
bool | VariableMask, | ||
Align | Alignment, | ||
TTI::TargetCostKind | CostKind, | ||
const Instruction * | I | ||
) |
Definition at line 815 of file RISCVTargetTransformInfo.cpp.
References CostKind, llvm::BasicTTIImplBase< RISCVTTIImpl >::getGatherScatterOpCost(), getMemoryOpCost(), I, isLegalMaskedGather(), isLegalMaskedScatter(), Ptr, and llvm::TargetTransformInfo::TCK_RecipThroughput.
InstructionCost RISCVTTIImpl::getInterleavedMemoryOpCost | ( | unsigned | Opcode, |
Type * | VecTy, | ||
unsigned | Factor, | ||
ArrayRef< unsigned > | Indices, | ||
Align | Alignment, | ||
unsigned | AddressSpace, | ||
TTI::TargetCostKind | CostKind, | ||
bool | UseMaskForCond = false , |
||
bool | UseMaskForGaps = false |
||
) |
Definition at line 719 of file RISCVTargetTransformInfo.cpp.
References assert(), CostKind, llvm::createInterleaveMask(), llvm::createStrideMask(), llvm::BasicTTIImplBase< RISCVTTIImpl >::DL, llvm::VectorType::get(), llvm::FixedVectorType::get(), llvm::BasicTTIImplBase< RISCVTTIImpl >::getInterleavedMemoryOpCost(), llvm::InstructionCost::getInvalid(), llvm::RISCVTargetLowering::getLMULCost(), getMemoryOpCost(), getShuffleCost(), llvm::EVT::getSimpleVT(), llvm::BasicTTIImplBase< RISCVTTIImpl >::getTypeLegalizationCost(), llvm::TargetLoweringBase::getValueType(), llvm::RISCVSubtarget::hasOptimizedSegmentLoadStore(), llvm::RISCVTargetLowering::isLegalInterleavedAccessType(), and llvm::TargetTransformInfo::SK_PermuteSingleSrc.
InstructionCost RISCVTTIImpl::getIntImmCost | ( | const APInt & | Imm, |
Type * | Ty, | ||
TTI::TargetCostKind | CostKind | ||
) |
Definition at line 129 of file RISCVTargetTransformInfo.cpp.
References CostKind, llvm::TargetTransformInfoImplBase::getDataLayout(), and getIntImmCostImpl().
Referenced by getIntImmCostInst().
InstructionCost RISCVTTIImpl::getIntImmCostInst | ( | unsigned | Opcode, |
unsigned | Idx, | ||
const APInt & | Imm, | ||
Type * | Ty, | ||
TTI::TargetCostKind | CostKind, | ||
Instruction * | Inst = nullptr |
||
) |
Definition at line 161 of file RISCVTargetTransformInfo.cpp.
References assert(), canUseShiftPair(), CostKind, llvm::BasicTTIImplBase< RISCVTTIImpl >::DL, llvm::Type::getContext(), llvm::TargetTransformInfoImplBase::getDataLayout(), getIntImmCost(), getIntImmCostImpl(), getValueType(), llvm::RISCVSubtarget::getXLen(), Idx, llvm::Instruction::isCommutative(), llvm::Type::isIntegerTy(), llvm::BasicTTIImplBase< RISCVTTIImpl >::isLegalAddImmediate(), and llvm::TargetTransformInfo::TCC_Free.
InstructionCost RISCVTTIImpl::getIntImmCostIntrin | ( | Intrinsic::ID | IID, |
unsigned | Idx, | ||
const APInt & | Imm, | ||
Type * | Ty, | ||
TTI::TargetCostKind | CostKind | ||
) |
Definition at line 269 of file RISCVTargetTransformInfo.cpp.
References llvm::TargetTransformInfo::TCC_Free.
InstructionCost RISCVTTIImpl::getIntrinsicInstrCost | ( | const IntrinsicCostAttributes & | ICA, |
TTI::TargetCostKind | CostKind | ||
) |
Definition at line 962 of file RISCVTargetTransformInfo.cpp.
References assert(), llvm::CmpInst::BAD_ICMP_PREDICATE, CostKind, llvm::CostTableLookup(), llvm::BasicTTIImplBase< RISCVTTIImpl >::DL, llvm::ISD::FCEIL, llvm::VectorType::get(), llvm::IntrinsicCostAttributes::getArgs(), llvm::IntrinsicCostAttributes::getArgTypes(), getArithmeticInstrCost(), getCmpSelInstrCost(), llvm::VPIntrinsic::getFunctionalOpcodeForVP(), llvm::IntrinsicCostAttributes::getID(), llvm::Type::getInt1Ty(), llvm::BasicTTIImplBase< RISCVTTIImpl >::getIntrinsicInstrCost(), llvm::InstructionCost::getInvalid(), getISDForVPIntrinsicID(), llvm::IntrinsicCostAttributes::getReturnType(), llvm::BasicTTIImplBase< RISCVTTIImpl >::getTypeLegalizationCost(), llvm::TargetLoweringBase::getValueType(), llvm::RISCVSubtarget::hasVInstructions(), llvm::CmpInst::ICMP_SLT, llvm::TargetLoweringBase::isOperationCustom(), RetTy, llvm::RISCVTargetLowering::shouldExpandCttzElements(), llvm::SmallVectorBase< Size_T >::size(), and VectorIntrinsicCostTable.
InstructionCost RISCVTTIImpl::getMaskedMemoryOpCost | ( | unsigned | Opcode, |
Type * | Src, | ||
Align | Alignment, | ||
unsigned | AddressSpace, | ||
TTI::TargetCostKind | CostKind | ||
) |
Definition at line 708 of file RISCVTargetTransformInfo.cpp.
References CostKind, llvm::BasicTTIImplBase< RISCVTTIImpl >::getMaskedMemoryOpCost(), getMemoryOpCost(), isLegalMaskedLoadStore(), and llvm::TargetTransformInfo::TCK_RecipThroughput.
Definition at line 2316 of file RISCVTargetTransformInfo.cpp.
References llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getFixedValue(), getRegisterBitWidth(), llvm::TargetTransformInfo::RGK_FixedWidthVector, and SLPMaxVF.
|
inline |
Definition at line 359 of file RISCVTargetTransformInfo.h.
References llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::isScalable(), and llvm::ElementCount::isScalar().
std::optional< unsigned > RISCVTTIImpl::getMaxVScale | ( | ) | const |
Definition at line 302 of file RISCVTargetTransformInfo.cpp.
References llvm::BasicTTIImplBase< RISCVTTIImpl >::getMaxVScale(), llvm::RISCVSubtarget::getRealMaxVLen(), llvm::RISCVSubtarget::hasVInstructions(), and llvm::RISCV::RVVBitsPerBlock.
InstructionCost RISCVTTIImpl::getMemoryOpCost | ( | unsigned | Opcode, |
Type * | Src, | ||
MaybeAlign | Alignment, | ||
unsigned | AddressSpace, | ||
TTI::TargetCostKind | CostKind, | ||
TTI::OperandValueInfo | OpdInfo = {TTI::OK_AnyValue, TTI::OP_None} , |
||
const Instruction * | I = nullptr |
||
) |
Definition at line 1675 of file RISCVTargetTransformInfo.cpp.
References CostKind, llvm::BasicTTIImplBase< RISCVTTIImpl >::DL, llvm::TargetTransformInfoImplBase::getDataLayout(), llvm::RISCVTargetLowering::getLMULCost(), llvm::BasicTTIImplBase< RISCVTTIImpl >::getMemoryOpCost(), getStoreImmCost(), llvm::BasicTTIImplBase< RISCVTTIImpl >::getTypeLegalizationCost(), llvm::DataLayout::getTypeStoreSizeInBits(), llvm::TargetLoweringBase::getValueType(), I, llvm::TargetTransformInfo::OperandValueInfo::isConstant(), llvm::details::FixedOrScalableQuantity< TypeSize, uint64_t >::isKnownLT(), llvm::Type::isVectorTy(), llvm::TargetTransformInfo::TCK_CodeSize, and llvm::TargetTransformInfo::TCK_RecipThroughput.
Referenced by getCostOfKeepingLiveOverCall(), getGatherScatterOpCost(), getInterleavedMemoryOpCost(), getMaskedMemoryOpCost(), getStridedMemoryOpCost(), and getVectorInstrCost().
InstructionCost RISCVTTIImpl::getMinMaxReductionCost | ( | Intrinsic::ID | IID, |
VectorType * | Ty, | ||
FastMathFlags | FMF, | ||
TTI::TargetCostKind | CostKind | ||
) |
Definition at line 1413 of file RISCVTargetTransformInfo.cpp.
References CostKind, llvm::BasicTTIImplBase< RISCVTTIImpl >::DL, getArithmeticReductionCost(), getCastInstrCost(), getCFInstrCost(), llvm::Type::getContext(), llvm::VectorType::getElementType(), llvm::RISCVSubtarget::getELen(), llvm::Type::getIntNTy(), llvm::BasicTTIImplBase< RISCVTTIImpl >::getMinMaxReductionCost(), llvm::Type::getScalarSizeInBits(), llvm::Type::getScalarType(), llvm::BasicTTIImplBase< RISCVTTIImpl >::getTypeLegalizationCost(), llvm::DataLayout::getTypeSizeInBits(), llvm::Type::isIntegerTy(), llvm_unreachable, llvm::FastMathFlags::noNaNs(), llvm::TargetTransformInfo::None, and llvm::RISCVSubtarget::useRVVForFixedLengthVectors().
|
inline |
Definition at line 425 of file RISCVTargetTransformInfo.h.
|
inline |
Definition at line 138 of file RISCVTargetTransformInfo.h.
Definition at line 371 of file RISCVTargetTransformInfo.h.
References FPRRC, GPRRC, llvm_unreachable, and VRRC.
void RISCVTTIImpl::getPeelingPreferences | ( | Loop * | L, |
ScalarEvolution & | SE, | ||
TTI::PeelingPreferences & | PP | ||
) |
Definition at line 2291 of file RISCVTargetTransformInfo.cpp.
References llvm::BasicTTIImplBase< RISCVTTIImpl >::getPeelingPreferences().
InstructionCost RISCVTTIImpl::getPointersChainCost | ( | ArrayRef< const Value * > | Ptrs, |
const Value * | Base, | ||
const TTI::PointersChainInfo & | Info, | ||
Type * | AccessTy, | ||
TTI::TargetCostKind | CostKind | ||
) |
Definition at line 2167 of file RISCVTargetTransformInfo.cpp.
References llvm::sampleprof::Base, CostKind, llvm::BasicTTIImplBase< RISCVTTIImpl >::DL, llvm::enumerate(), GEP, getArithmeticInstrCost(), llvm::BasicTTIImplBase< RISCVTTIImpl >::getGEPCost(), llvm::DataLayout::getTypeStoreSize(), I, Info, llvm::BasicTTIImplBase< RISCVTTIImpl >::isLegalAddressingMode(), and llvm::TargetTransformInfo::TCC_Free.
TargetTransformInfo::PopcntSupportKind RISCVTTIImpl::getPopcntSupport | ( | unsigned | TyWidth | ) |
Definition at line 281 of file RISCVTargetTransformInfo.cpp.
References assert(), llvm::RISCVSubtarget::is64Bit(), llvm::isPowerOf2_32(), llvm::TargetTransformInfo::PSK_FastHardware, and llvm::TargetTransformInfo::PSK_Software.
|
inline |
Definition at line 101 of file RISCVTargetTransformInfo.h.
References llvm::Data, and llvm::DataWithoutLaneMask.
TypeSize RISCVTTIImpl::getRegisterBitWidth | ( | TargetTransformInfo::RegisterKind | K | ) | const |
Definition at line 317 of file RISCVTargetTransformInfo.cpp.
References llvm::bit_floor(), llvm::TypeSize::getFixed(), llvm::RISCVSubtarget::getRealMinVLen(), llvm::TypeSize::getScalable(), llvm::RISCVSubtarget::getXLen(), llvm::RISCVSubtarget::hasVInstructions(), llvm_unreachable, llvm::TargetTransformInfo::RGK_FixedWidthVector, llvm::TargetTransformInfo::RGK_ScalableVector, llvm::TargetTransformInfo::RGK_Scalar, llvm::RISCV::RVVBitsPerBlock, RVVRegisterWidthLMUL, and llvm::RISCVSubtarget::useRVVForFixedLengthVectors().
Referenced by getMaximumVF().
|
inline |
Definition at line 391 of file RISCVTargetTransformInfo.h.
References FPRRC, llvm::Type::getScalarType(), GPRRC, llvm::Type::isDoubleTy(), llvm::Type::isFloatTy(), llvm::Type::isHalfTy(), llvm::Vector, and VRRC.
Definition at line 407 of file RISCVTargetTransformInfo.h.
References FPRRC, GPRRC, llvm_unreachable, and VRRC.
Definition at line 2296 of file RISCVTargetTransformInfo.cpp.
References llvm::divideCeil(), llvm::BasicTTIImplBase< RISCVTTIImpl >::DL, llvm::VectorType::get(), llvm::Type::getContext(), llvm::Type::getFloatTy(), llvm::RISCVSubtarget::getRealMinVLen(), llvm::BasicTTIImplBase< RISCVTTIImpl >::getRegUsageForType(), llvm::DataLayout::getTypeSizeInBits(), llvm::RISCVSubtarget::hasVInstructions(), llvm::RISCVSubtarget::hasVInstructionsF16(), llvm::Type::isBFloatTy(), llvm::Type::isHalfTy(), llvm::Type::isVectorTy(), llvm::RISCV::RVVBitsPerBlock, Size, and llvm::RISCVSubtarget::useRVVForFixedLengthVectors().
InstructionCost RISCVTTIImpl::getScalarizationOverhead | ( | VectorType * | Ty, |
const APInt & | DemandedElts, | ||
bool | Insert, | ||
bool | Extract, | ||
TTI::TargetCostKind | CostKind, | ||
ArrayRef< Value * > | VL = {} |
||
) |
Definition at line 670 of file RISCVTargetTransformInfo.cpp.
References assert(), CostKind, getCastInstrCost(), llvm::RISCVTargetLowering::getContainerForFixedLengthVector(), llvm::InstructionCost::getInvalid(), llvm::BasicTTIImplBase< RISCVTTIImpl >::getScalarizationOverhead(), getScalarizationOverhead(), llvm::Type::getScalarSizeInBits(), llvm::BasicTTIImplBase< RISCVTTIImpl >::getTypeLegalizationCost(), llvm::Type::getWithNewBitWidth(), isM1OrSmaller(), and llvm::TargetTransformInfo::None.
Referenced by getScalarizationOverhead().
InstructionCost RISCVTTIImpl::getShuffleCost | ( | TTI::ShuffleKind | Kind, |
VectorType * | Tp, | ||
ArrayRef< int > | Mask, | ||
TTI::TargetCostKind | CostKind, | ||
int | Index, | ||
VectorType * | SubTp, | ||
ArrayRef< const Value * > | Args = {} , |
||
const Instruction * | CxtI = nullptr |
||
) |
Definition at line 378 of file RISCVTargetTransformInfo.cpp.
References llvm::all_of(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::CallingConv::C, CostKind, llvm::createStrideMask(), llvm::divideCeil(), llvm::enumerate(), llvm::equal(), llvm::VectorType::get(), llvm::FixedVectorType::get(), llvm::Type::getContext(), llvm::FixedVectorType::getDoubleElementsVectorType(), llvm::VectorType::getElementCount(), llvm::VectorType::getElementType(), llvm::RISCVSubtarget::getELen(), llvm::Type::getInt1Ty(), llvm::RISCVTargetLowering::getLMULCost(), llvm::Operator::getOpcode(), llvm::Type::getPrimitiveSizeInBits(), llvm::RISCVSubtarget::getRealMaxVLen(), llvm::RISCVSubtarget::getRealMinVLen(), llvm::MVT::getScalarSizeInBits(), llvm::BasicTTIImplBase< RISCVTTIImpl >::getShuffleCost(), getShuffleCost(), llvm::BasicTTIImplBase< RISCVTTIImpl >::getTypeLegalizationCost(), getVRGatherIndexType(), I, llvm::BasicTTIImplBase< RISCVTTIImpl >::improveShuffleKindFromMask(), llvm::Type::isIntegerTy(), llvm::ShuffleVectorInst::isInterleaveMask(), isRepeatedConcatMask(), llvm::Log2_32(), P, llvm::PoisonMaskElem, llvm::PowerOf2Ceil(), llvm::TargetTransformInfo::SK_Broadcast, llvm::TargetTransformInfo::SK_ExtractSubvector, llvm::TargetTransformInfo::SK_InsertSubvector, llvm::TargetTransformInfo::SK_PermuteSingleSrc, llvm::TargetTransformInfo::SK_PermuteTwoSrc, llvm::TargetTransformInfo::SK_Reverse, llvm::TargetTransformInfo::SK_Select, llvm::TargetTransformInfo::SK_Splice, llvm::TargetTransformInfo::SK_Transpose, llvm::TargetTransformInfo::TCC_Free, and llvm::transform().
Referenced by getInterleavedMemoryOpCost(), and getShuffleCost().
InstructionCost RISCVTTIImpl::getStoreImmCost | ( | Type * | VecTy, |
TTI::OperandValueInfo | OpInfo, | ||
TTI::TargetCostKind | CostKind | ||
) |
Return the cost of materializing an immediate for a value operand of a store instruction.
Definition at line 1655 of file RISCVTargetTransformInfo.cpp.
References assert(), CostKind, llvm::TargetTransformInfo::OperandValueInfo::isConstant(), and llvm::TargetTransformInfo::OperandValueInfo::isUniform().
Referenced by getMemoryOpCost().
InstructionCost RISCVTTIImpl::getStridedMemoryOpCost | ( | unsigned | Opcode, |
Type * | DataTy, | ||
const Value * | Ptr, | ||
bool | VariableMask, | ||
Align | Alignment, | ||
TTI::TargetCostKind | CostKind, | ||
const Instruction * | I | ||
) |
Definition at line 840 of file RISCVTargetTransformInfo.cpp.
References CostKind, getMemoryOpCost(), llvm::BasicTTIImplBase< RISCVTTIImpl >::getStridedMemoryOpCost(), I, isLegalStridedLoadStore(), Ptr, llvm::TargetTransformInfo::TCC_Basic, and llvm::TargetTransformInfo::TCK_CodeSize.
void RISCVTTIImpl::getUnrollingPreferences | ( | Loop * | L, |
ScalarEvolution & | SE, | ||
TTI::UnrollingPreferences & | UP, | ||
OptimizationRemarkEmitter * | ORE | ||
) |
Definition at line 2214 of file RISCVTargetTransformInfo.cpp.
References llvm::dbgs(), F, llvm::TargetTransformInfo::UnrollingPreferences::Force, llvm::getBooleanLoopAttribute(), getCalledFunction(), llvm::TargetTransformInfoImplCRTPBase< T >::getInstructionCost(), llvm::BasicTTIImplBase< T >::getUnrollingPreferences(), I, llvm::TargetTransformInfoImplBase::isLoweredToCall(), LLVM_DEBUG, Operands, llvm::TargetTransformInfo::UnrollingPreferences::OptSizeThreshold, llvm::TargetTransformInfo::UnrollingPreferences::Partial, llvm::TargetTransformInfo::UnrollingPreferences::PartialOptSizeThreshold, llvm::TargetTransformInfo::UnrollingPreferences::Runtime, llvm::SmallVectorBase< Size_T >::size(), llvm::TargetTransformInfo::TCK_SizeAndLatency, llvm::TargetTransformInfo::UnrollingPreferences::UnrollAndJam, llvm::TargetTransformInfo::UnrollingPreferences::UnrollRemainder, and llvm::TargetTransformInfo::UnrollingPreferences::UpperBound.
InstructionCost RISCVTTIImpl::getVectorInstrCost | ( | unsigned | Opcode, |
Type * | Val, | ||
TTI::TargetCostKind | CostKind, | ||
unsigned | Index, | ||
Value * | Op0, | ||
Value * | Op1 | ||
) |
Definition at line 1890 of file RISCVTargetTransformInfo.cpp.
References assert(), CostKind, llvm::BasicTTIImplBase< RISCVTTIImpl >::DL, llvm::IntegerType::get(), llvm::VectorType::get(), getCastInstrCost(), llvm::Type::getContext(), getMemoryOpCost(), llvm::DataLayout::getPrefTypeAlign(), llvm::RISCVSubtarget::getRealVLen(), llvm::Type::getScalarSizeInBits(), llvm::Type::getScalarType(), llvm::BasicTTIImplBase< RISCVTTIImpl >::getTypeLegalizationCost(), llvm::BasicTTIImplBase< RISCVTTIImpl >::getVectorInstrCost(), getVectorInstrCost(), llvm::RISCVSubtarget::getXLen(), if(), llvm::Type::isIntegerTy(), llvm::Type::isVectorTy(), and llvm::TargetTransformInfo::None.
Referenced by getVectorInstrCost().
|
inline |
Definition at line 312 of file RISCVTargetTransformInfo.h.
References llvm::TargetTransformInfo::VPLegalization::Convert, llvm::TargetTransformInfo::VPLegalization::Discard, llvm::CallBase::getArgOperand(), llvm::IntrinsicInst::getIntrinsicID(), llvm::Value::getType(), and llvm::TargetTransformInfo::VPLegalization::Legal.
std::optional< unsigned > RISCVTTIImpl::getVScaleForTuning | ( | ) | const |
Definition at line 308 of file RISCVTargetTransformInfo.cpp.
References llvm::RISCVSubtarget::getRealMinVLen(), llvm::BasicTTIImplBase< RISCVTTIImpl >::getVScaleForTuning(), llvm::RISCVSubtarget::hasVInstructions(), and llvm::RISCV::RVVBitsPerBlock.
bool RISCVTTIImpl::hasActiveVectorLength | ( | unsigned | Opcode, |
Type * | DataType, | ||
Align | Alignment | ||
) | const |
Definition at line 276 of file RISCVTargetTransformInfo.cpp.
References llvm::RISCVSubtarget::hasVInstructions().
Definition at line 222 of file RISCVTargetTransformInfo.h.
References llvm::BasicTTIImplBase< RISCVTTIImpl >::DL, llvm::TargetLoweringBase::getValueType(), and llvm::RISCVTargetLowering::isLegalElementTypeForRVV().
|
inline |
Definition at line 295 of file RISCVTargetTransformInfo.h.
References llvm::BasicTTIImplBase< RISCVTTIImpl >::DL, and llvm::RISCVTargetLowering::isLegalInterleavedAccessType().
Definition at line 2364 of file RISCVTargetTransformInfo.cpp.
References isLegalMaskedLoadStore().
Definition at line 2347 of file RISCVTargetTransformInfo.cpp.
References llvm::RISCVSubtarget::getMaxLMULForFixedLengthVectors(), llvm::RISCVSubtarget::getRealMinVLen(), and isLegalMaskedLoadStore().
Definition at line 273 of file RISCVTargetTransformInfo.h.
References isLegalMaskedGatherScatter().
Referenced by getGatherScatterOpCost().
Definition at line 250 of file RISCVTargetTransformInfo.h.
References llvm::BasicTTIImplBase< RISCVTTIImpl >::DL, llvm::TargetLoweringBase::getPointerTy(), llvm::EVT::getScalarType(), llvm::EVT::getStoreSize(), llvm::TargetLoweringBase::getValueType(), llvm::EVT::isFixedLengthVector(), llvm::RISCVTargetLowering::isLegalElementTypeForRVV(), and llvm::EVT::isScalableVector().
Referenced by isLegalMaskedGather(), and isLegalMaskedScatter().
Definition at line 243 of file RISCVTargetTransformInfo.h.
References isLegalMaskedLoadStore().
Definition at line 226 of file RISCVTargetTransformInfo.h.
References llvm::BasicTTIImplBase< RISCVTTIImpl >::DL, llvm::EVT::getScalarType(), llvm::EVT::getStoreSize(), llvm::TargetLoweringBase::getValueType(), llvm::EVT::isFixedLengthVector(), and llvm::RISCVTargetLowering::isLegalElementTypeForRVV().
Referenced by getMaskedMemoryOpCost(), isLegalMaskedCompressStore(), isLegalMaskedExpandLoad(), isLegalMaskedLoad(), and isLegalMaskedStore().
Definition at line 276 of file RISCVTargetTransformInfo.h.
References isLegalMaskedGatherScatter().
Referenced by getGatherScatterOpCost().
Definition at line 246 of file RISCVTargetTransformInfo.h.
References isLegalMaskedLoadStore().
Definition at line 290 of file RISCVTargetTransformInfo.h.
References llvm::BasicTTIImplBase< RISCVTTIImpl >::DL, llvm::TargetLoweringBase::getValueType(), and llvm::RISCVTargetLowering::isLegalStridedLoadStore().
Referenced by getStridedMemoryOpCost().
|
inline |
Definition at line 323 of file RISCVTargetTransformInfo.h.
References llvm::Add, llvm::And, llvm::BasicTTIImplBase< RISCVTTIImpl >::DL, llvm::FAdd, llvm::FAnyOf, llvm::FMax, llvm::FMin, llvm::FMulAdd, llvm::RecurrenceDescriptor::getRecurrenceKind(), llvm::RecurrenceDescriptor::getRecurrenceType(), llvm::TargetLoweringBase::getValueType(), llvm::IAnyOf, llvm::Type::isBFloatTy(), llvm::Type::isHalfTy(), llvm::RISCVTargetLowering::isLegalElementTypeForRVV(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::isScalable(), llvm::Or, llvm::SMax, llvm::SMin, llvm::UMax, llvm::UMin, and llvm::Xor.
bool RISCVTTIImpl::isLSRCostLess | ( | const TargetTransformInfo::LSRCost & | C1, |
const TargetTransformInfo::LSRCost & | C2 | ||
) |
Definition at line 2332 of file RISCVTargetTransformInfo.cpp.
References llvm::TargetTransformInfo::LSRCost::AddRecCost, llvm::TargetTransformInfo::LSRCost::ImmCost, llvm::TargetTransformInfo::LSRCost::Insns, llvm::TargetTransformInfo::LSRCost::NumBaseAdds, llvm::TargetTransformInfo::LSRCost::NumIVMuls, llvm::TargetTransformInfo::LSRCost::NumRegs, llvm::TargetTransformInfo::LSRCost::ScaleCost, and llvm::TargetTransformInfo::LSRCost::SetupCost.
bool RISCVTTIImpl::isProfitableToSinkOperands | ( | Instruction * | I, |
SmallVectorImpl< Use * > & | Ops | ||
) | const |
Check if sinking I's
operands to I's basic block is profitable, because the operands can be folded into a target instruction, e.g.
splats of scalars can fold into vector instructions.
Definition at line 2500 of file RISCVTargetTransformInfo.cpp.
References llvm::any_of(), canSplatOperand(), llvm::enumerate(), llvm::RISCVSubtarget::hasVInstructions(), I, Insn, llvm::PatternMatch::m_InsertElt(), llvm::PatternMatch::m_Shuffle(), llvm::PatternMatch::m_Undef(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::m_ZeroInt(), llvm::PatternMatch::match(), and llvm::SmallVectorTemplateBase< T, bool >::push_back().
|
inline |
Definition at line 305 of file RISCVTargetTransformInfo.h.
References llvm::RISCVTargetLowering::isVScaleKnownToBeAPowerOfTwo().
|
inline |
Definition at line 114 of file RISCVTargetTransformInfo.h.
bool RISCVTTIImpl::shouldConsiderAddressTypePromotion | ( | const Instruction & | I, |
bool & | AllowPromotionWithoutCommonHeader | ||
) |
See if I
should be considered for address type promotion.
We check if I
is a sext with right type and used in memory accesses. If it used in a "complex" getelementptr, we allow it to be promoted without finding other sext instructions that sign extended the same initial value. A getelementptr is considered as "complex" if it has more than 2 operands.
Definition at line 2379 of file RISCVTargetTransformInfo.cpp.
References llvm::Type::getInt64Ty(), and I.
bool RISCVTTIImpl::shouldExpandReduction | ( | const IntrinsicInst * | II | ) | const |
Definition at line 288 of file RISCVTargetTransformInfo.cpp.
References II.
|
inline |
Definition at line 97 of file RISCVTargetTransformInfo.h.