LLVM 22.0.0git
|
#include "RISCVTargetTransformInfo.h"
#include "MCTargetDesc/RISCVMatInt.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/CodeGen/BasicTTIImpl.h"
#include "llvm/CodeGen/CostTable.h"
#include "llvm/CodeGen/TargetLowering.h"
#include "llvm/CodeGen/ValueTypes.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/PatternMatch.h"
#include <cmath>
#include <optional>
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "riscvtti" |
Functions | |
static InstructionCost | getIntImmCostImpl (const DataLayout &DL, const RISCVSubtarget *ST, const APInt &Imm, Type *Ty, TTI::TargetCostKind CostKind, bool FreeZeroes) |
static bool | canUseShiftPair (Instruction *Inst, const APInt &Imm) |
static bool | isRepeatedConcatMask (ArrayRef< int > Mask, int &SubVectorSize) |
static VectorType * | getVRGatherIndexType (MVT DataVT, const RISCVSubtarget &ST, LLVMContext &C) |
static InstructionCost | costShuffleViaSplitting (const RISCVTTIImpl &TTI, MVT LegalVT, VectorType *Tp, ArrayRef< int > Mask, TTI::TargetCostKind CostKind) |
Attempt to approximate the cost of a shuffle which will require splitting during legalization. | |
static InstructionCost | costShuffleViaVRegSplitting (const RISCVTTIImpl &TTI, MVT LegalVT, std::optional< unsigned > VLen, VectorType *Tp, ArrayRef< int > Mask, TTI::TargetCostKind CostKind) |
Try to perform better estimation of the permutation. | |
static unsigned | isM1OrSmaller (MVT VT) |
Variables | |
static cl::opt< unsigned > | RVVRegisterWidthLMUL ("riscv-v-register-bit-width-lmul", cl::desc("The LMUL to use for getRegisterBitWidth queries. Affects LMUL used " "by autovectorized code. Fractional LMULs are not supported."), cl::init(2), cl::Hidden) |
static cl::opt< unsigned > | SLPMaxVF ("riscv-v-slp-max-vf", cl::desc("Overrides result used for getMaximumVF query which is used " "exclusively by SLP vectorizer."), cl::Hidden) |
static cl::opt< unsigned > | RVVMinTripCount ("riscv-v-min-trip-count", cl::desc("Set the lower bound of a trip count to decide on " "vectorization while tail-folding."), cl::init(5), cl::Hidden) |
static const CostTblEntry | VectorIntrinsicCostTable [] |
#define DEBUG_TYPE "riscvtti" |
Definition at line 24 of file RISCVTargetTransformInfo.cpp.
|
static |
Definition at line 145 of file RISCVTargetTransformInfo.cpp.
References llvm::countr_zero(), llvm::User::getOperand(), and llvm::isShiftedMask_64().
Referenced by llvm::RISCVTTIImpl::getIntImmCostInst().
|
static |
Attempt to approximate the cost of a shuffle which will require splitting during legalization.
Note that processShuffleMasks is not an exact proxy for the algorithm used in LegalizeVectorTypes, but hopefully it's a reasonably close upperbound.
Definition at line 413 of file RISCVTargetTransformInfo.cpp.
References assert(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::copy(), CostKind, llvm::divideCeil(), llvm::FixedVectorType::get(), llvm::InstructionCost::getInvalid(), llvm::TargetTransformInfo::getShuffleCost(), llvm::MVT::getSizeInBits(), llvm::MVT::getStoreSize(), llvm::MVT::getVectorElementType(), llvm::MVT::getVectorNumElements(), llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::insert(), llvm::MVT::isFixedLengthVector(), llvm::ShuffleVectorInst::isIdentityMask(), llvm::PoisonMaskElem, llvm::processShuffleMasks(), llvm::ArrayRef< T >::size(), llvm::TargetTransformInfo::SK_PermuteSingleSrc, and llvm::TargetTransformInfo::SK_PermuteTwoSrc.
Referenced by llvm::RISCVTTIImpl::getShuffleCost().
|
static |
Try to perform better estimation of the permutation.
Definition at line 483 of file RISCVTargetTransformInfo.cpp.
References assert(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::copy(), CostKind, llvm::divideCeil(), llvm::FixedVectorType::get(), llvm::MVT::getFixedSizeInBits(), llvm::InstructionCost::getInvalid(), llvm::TargetTransformInfo::getShuffleCost(), llvm::MVT::getSizeInBits(), llvm::MVT::getStoreSize(), llvm::InstructionCost::getValue(), llvm::MVT::getVectorElementType(), llvm::MVT::getVectorNumElements(), llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::insert(), llvm::MVT::isFixedLengthVector(), llvm::ShuffleVectorInst::isIdentityMask(), llvm::PoisonMaskElem, llvm::processShuffleMasks(), llvm::ArrayRef< T >::size(), llvm::TargetTransformInfo::SK_PermuteSingleSrc, and llvm::TargetTransformInfo::SK_PermuteTwoSrc.
Referenced by llvm::RISCVTTIImpl::getShuffleCost().
|
static |
Definition at line 119 of file RISCVTargetTransformInfo.cpp.
References assert(), DL, llvm::RISCVMatInt::getIntMatCost(), llvm::Type::isIntegerTy(), and llvm::TargetTransformInfo::TCC_Free.
Referenced by llvm::RISCVTTIImpl::getIntImmCost(), and llvm::RISCVTTIImpl::getIntImmCostInst().
|
static |
Definition at line 399 of file RISCVTargetTransformInfo.cpp.
References assert(), llvm::MVT::bitsGT(), llvm::CallingConv::C, llvm::MVT::changeTypeToInteger(), llvm::MVT::changeVectorElementType(), llvm::MVT::getScalarSizeInBits(), llvm::MVT::getScalarType(), and llvm::MVT::getVectorNumElements().
Referenced by llvm::RISCVTTIImpl::getShuffleCost().
Definition at line 919 of file RISCVTargetTransformInfo.cpp.
References llvm::RISCVTargetLowering::getLMUL(), llvm::RISCVVType::LMUL_1, llvm::RISCVVType::LMUL_F2, llvm::RISCVVType::LMUL_F4, and llvm::RISCVVType::LMUL_F8.
Referenced by llvm::RISCVTTIImpl::getScalarizationOverhead().
Definition at line 377 of file RISCVTargetTransformInfo.cpp.
References I, llvm::isPowerOf2_32(), and Size.
Referenced by llvm::RISCVTTIImpl::getShuffleCost().
|
static |
Referenced by llvm::RISCVTTIImpl::getMinTripCountTailFoldingThreshold().
|
static |
Referenced by llvm::RISCVTTIImpl::getRegisterBitWidth().
|
static |
Referenced by llvm::RISCVTTIImpl::getMaximumVF().
|
static |
Definition at line 1181 of file RISCVTargetTransformInfo.cpp.
Referenced by llvm::RISCVTTIImpl::getIntrinsicInstrCost().