LLVM 22.0.0git
llvm::RISCVSubtarget Class Reference

#include "Target/RISCV/RISCVSubtarget.h"

Inheritance diagram for llvm::RISCVSubtarget:
[legend]

Public Types

enum  RISCVProcFamilyEnum : uint8_t {
  Others , SiFive7 , VentanaVeyron , MIPSP8700 ,
  Andes45
}
enum  RISCVVRGatherCostModelEnum : uint8_t { Quadratic , NLog2N }

Public Member Functions

 RISCVSubtarget (const Triple &TT, StringRef CPU, StringRef TuneCPU, StringRef FS, StringRef ABIName, unsigned RVVVectorBitsMin, unsigned RVVVectorLMULMax, const TargetMachine &TM)
 ~RISCVSubtarget () override
void ParseSubtargetFeatures (StringRef CPU, StringRef TuneCPU, StringRef FS)
const RISCVFrameLoweringgetFrameLowering () const override
const RISCVInstrInfogetInstrInfo () const override
const RISCVRegisterInfogetRegisterInfo () const override
const RISCVTargetLoweringgetTargetLowering () const override
bool enableMachineScheduler () const override
bool enablePostRAScheduler () const override
Align getPrefFunctionAlignment () const
Align getPrefLoopAlignment () const
RISCVProcFamilyEnum getProcFamily () const
 Returns RISC-V processor family.
RISCVVRGatherCostModelEnum getVRGatherCostModel () const
bool hasStdExtCOrZca () const
bool hasStdExtCOrZcd () const
bool hasStdExtCOrZcfOrZce () const
bool hasStdExtZvl () const
bool hasStdExtFOrZfinx () const
bool hasStdExtDOrZdinx () const
bool hasStdExtZfhOrZhinx () const
bool hasStdExtZfhminOrZhinxmin () const
bool hasHalfFPLoadStoreMove () const
bool hasCLZLike () const
bool hasCTZLike () const
bool hasCPOPLike () const
bool hasREV8Like () const
bool hasBEXTILike () const
bool hasCZEROLike () const
bool hasConditionalMoveFusion () const
bool hasShlAdd (int64_t ShAmt) const
bool is64Bit () const
MVT getXLenVT () const
unsigned getXLen () const
bool useLoadStorePairs () const
bool useCCMovInsn () const
unsigned getFLen () const
unsigned getELen () const
unsigned getRealMinVLen () const
unsigned getRealMaxVLen () const
std::optional< unsignedgetRealVLen () const
template<typename Quantity>
Quantity expandVScale (Quantity X) const
 If the ElementCount or TypeSize X is scalable and VScale (VLEN) is exactly known, returns X converted to a fixed quantity.
RISCVABI::ABI getTargetABI () const
bool isSoftFPABI () const
bool isRegisterReservedByUser (Register i) const override
bool isXRaySupported () const override
bool hasVInstructions () const
bool hasVInstructionsI64 () const
bool hasVInstructionsF16Minimal () const
bool hasVInstructionsF16 () const
bool hasVInstructionsBF16Minimal () const
bool hasVInstructionsF32 () const
bool hasVInstructionsF64 () const
bool hasVInstructionsAnyF () const
bool hasVInstructionsFullMultiply () const
unsigned getMaxInterleaveFactor () const
bool hasOptimizedSegmentLoadStore (unsigned NF) const
unsigned getDLenFactor () const
const SelectionDAGTargetInfogetSelectionDAGInfo () const override
const CallLoweringgetCallLowering () const override
InstructionSelectorgetInstructionSelector () const override
const LegalizerInfogetLegalizerInfo () const override
const RISCVRegisterBankInfogetRegBankInfo () const override
bool isTargetAndroid () const
bool isTargetFuchsia () const
bool useConstantPoolForLargeInts () const
unsigned getMaxBuildIntsCost () const
unsigned getMaxLMULForFixedLengthVectors () const
bool useRVVForFixedLengthVectors () const
bool enableSubRegLiveness () const override
bool enableMachinePipeliner () const override
bool useDFAforSMS () const override
bool useAA () const override
 Enable use of alias analysis during code generation (during MI scheduling, DAGCombine, etc.).
unsigned getCacheLineSize () const override
unsigned getPrefetchDistance () const override
unsigned getMinPrefetchStride (unsigned NumMemAccesses, unsigned NumStridedMemAccesses, unsigned NumPrefetches, bool HasCall) const override
unsigned getMaxPrefetchIterationsAhead () const override
bool enableWritePrefetching () const override
unsigned getMinimumJumpTableEntries () const
unsigned getTailDupAggressiveThreshold () const
unsigned getMaxStoresPerMemset (bool OptSize) const
unsigned getMaxGluedStoresPerMemcpy () const
unsigned getMaxStoresPerMemcpy (bool OptSize) const
unsigned getMaxStoresPerMemmove (bool OptSize) const
unsigned getMaxLoadsPerMemcmp (bool OptSize) const
MISched::Direction getPostRASchedDirection () const
void overrideSchedPolicy (MachineSchedPolicy &Policy, const SchedRegion &Region) const override
void overridePostRASchedPolicy (MachineSchedPolicy &Policy, const SchedRegion &Region) const override

Protected Member Functions

unsigned getMaxRVVVectorSizeInBits () const
unsigned getMinRVVVectorSizeInBits () const

Protected Attributes

std::unique_ptr< const SelectionDAGTargetInfoTSInfo
std::unique_ptr< CallLoweringCallLoweringInfo
std::unique_ptr< InstructionSelectorInstSelector
std::unique_ptr< LegalizerInfoLegalizer
std::unique_ptr< RISCVRegisterBankInfoRegBankInfo

Detailed Description

Definition at line 79 of file RISCVSubtarget.h.

Member Enumeration Documentation

◆ RISCVProcFamilyEnum

Enumerator
Others 
SiFive7 
VentanaVeyron 
MIPSP8700 
Andes45 

Definition at line 82 of file RISCVSubtarget.h.

◆ RISCVVRGatherCostModelEnum

Enumerator
Quadratic 
NLog2N 

Definition at line 89 of file RISCVSubtarget.h.

Constructor & Destructor Documentation

◆ RISCVSubtarget()

RISCVSubtarget::RISCVSubtarget ( const Triple & TT,
StringRef CPU,
StringRef TuneCPU,
StringRef FS,
StringRef ABIName,
unsigned RVVVectorBitsMin,
unsigned RVVVectorLMULMax,
const TargetMachine & TM )

Definition at line 98 of file RISCVSubtarget.cpp.

References TSInfo.

◆ ~RISCVSubtarget()

RISCVSubtarget::~RISCVSubtarget ( )
overridedefault

Member Function Documentation

◆ enableMachinePipeliner()

bool RISCVSubtarget::enableMachinePipeliner ( ) const
override

Definition at line 204 of file RISCVSubtarget.cpp.

◆ enableMachineScheduler()

bool llvm::RISCVSubtarget::enableMachineScheduler ( ) const
inlineoverride

Definition at line 149 of file RISCVSubtarget.h.

◆ enablePostRAScheduler()

bool llvm::RISCVSubtarget::enablePostRAScheduler ( ) const
inlineoverride

Definition at line 151 of file RISCVSubtarget.h.

◆ enableSubRegLiveness()

bool RISCVSubtarget::enableSubRegLiveness ( ) const
override

Definition at line 202 of file RISCVSubtarget.cpp.

◆ enableWritePrefetching()

bool llvm::RISCVSubtarget::enableWritePrefetching ( ) const
inlineoverride

Definition at line 389 of file RISCVSubtarget.h.

◆ expandVScale()

template<typename Quantity>
Quantity llvm::RISCVSubtarget::expandVScale ( Quantity X) const
inline

If the ElementCount or TypeSize X is scalable and VScale (VLEN) is exactly known, returns X converted to a fixed quantity.

Otherwise returns X unmodified.

Definition at line 264 of file RISCVSubtarget.h.

References getRealVLen(), llvm::RISCV::RVVBitsPerBlock, and X.

◆ getCacheLineSize()

unsigned llvm::RISCVSubtarget::getCacheLineSize ( ) const
inlineoverride

Definition at line 374 of file RISCVSubtarget.h.

◆ getCallLowering()

const CallLowering * RISCVSubtarget::getCallLowering ( ) const
override

Definition at line 117 of file RISCVSubtarget.cpp.

References CallLoweringInfo, and getTargetLowering().

◆ getDLenFactor()

unsigned llvm::RISCVSubtarget::getDLenFactor ( ) const
inline

Definition at line 324 of file RISCVSubtarget.h.

◆ getELen()

◆ getFLen()

unsigned llvm::RISCVSubtarget::getFLen ( ) const
inline

Definition at line 232 of file RISCVSubtarget.h.

Referenced by lowerBUILD_VECTOR().

◆ getFrameLowering()

const RISCVFrameLowering * llvm::RISCVSubtarget::getFrameLowering ( ) const
inlineoverride

◆ getInstrInfo()

◆ getInstructionSelector()

InstructionSelector * RISCVSubtarget::getInstructionSelector ( ) const
override

◆ getLegalizerInfo()

const LegalizerInfo * RISCVSubtarget::getLegalizerInfo ( ) const
override

Definition at line 132 of file RISCVSubtarget.cpp.

References Legalizer.

◆ getMaxBuildIntsCost()

unsigned RISCVSubtarget::getMaxBuildIntsCost ( ) const

Definition at line 148 of file RISCVSubtarget.cpp.

References RISCVMaxBuildIntsCost.

Referenced by lowerConstant().

◆ getMaxGluedStoresPerMemcpy()

unsigned llvm::RISCVSubtarget::getMaxGluedStoresPerMemcpy ( ) const
inline

Definition at line 402 of file RISCVSubtarget.h.

◆ getMaxInterleaveFactor()

unsigned llvm::RISCVSubtarget::getMaxInterleaveFactor ( ) const
inline

Definition at line 297 of file RISCVSubtarget.h.

References hasVInstructions().

◆ getMaxLMULForFixedLengthVectors()

unsigned RISCVSubtarget::getMaxLMULForFixedLengthVectors ( ) const

◆ getMaxLoadsPerMemcmp()

unsigned llvm::RISCVSubtarget::getMaxLoadsPerMemcmp ( bool OptSize) const
inline

Definition at line 416 of file RISCVSubtarget.h.

◆ getMaxPrefetchIterationsAhead()

unsigned llvm::RISCVSubtarget::getMaxPrefetchIterationsAhead ( ) const
inlineoverride

Definition at line 386 of file RISCVSubtarget.h.

◆ getMaxRVVVectorSizeInBits()

unsigned RISCVSubtarget::getMaxRVVVectorSizeInBits ( ) const
protected

Definition at line 159 of file RISCVSubtarget.cpp.

References assert(), hasVInstructions(), and llvm::report_fatal_error().

Referenced by getRealMaxVLen().

◆ getMaxStoresPerMemcpy()

unsigned llvm::RISCVSubtarget::getMaxStoresPerMemcpy ( bool OptSize) const
inline

Definition at line 406 of file RISCVSubtarget.h.

◆ getMaxStoresPerMemmove()

unsigned llvm::RISCVSubtarget::getMaxStoresPerMemmove ( bool OptSize) const
inline

Definition at line 411 of file RISCVSubtarget.h.

◆ getMaxStoresPerMemset()

unsigned llvm::RISCVSubtarget::getMaxStoresPerMemset ( bool OptSize) const
inline

Definition at line 397 of file RISCVSubtarget.h.

◆ getMinimumJumpTableEntries()

unsigned RISCVSubtarget::getMinimumJumpTableEntries ( ) const

Definition at line 212 of file RISCVSubtarget.cpp.

References RISCVMinimumJumpTableEntries.

◆ getMinPrefetchStride()

unsigned llvm::RISCVSubtarget::getMinPrefetchStride ( unsigned NumMemAccesses,
unsigned NumStridedMemAccesses,
unsigned NumPrefetches,
bool HasCall ) const
inlineoverride

Definition at line 380 of file RISCVSubtarget.h.

◆ getMinRVVVectorSizeInBits()

unsigned RISCVSubtarget::getMinRVVVectorSizeInBits ( ) const
protected

◆ getPostRASchedDirection()

MISched::Direction llvm::RISCVSubtarget::getPostRASchedDirection ( ) const
inline

Definition at line 421 of file RISCVSubtarget.h.

Referenced by overridePostRASchedPolicy().

◆ getPrefetchDistance()

unsigned llvm::RISCVSubtarget::getPrefetchDistance ( ) const
inlineoverride

Definition at line 377 of file RISCVSubtarget.h.

◆ getPrefFunctionAlignment()

Align llvm::RISCVSubtarget::getPrefFunctionAlignment ( ) const
inline

Definition at line 153 of file RISCVSubtarget.h.

◆ getPrefLoopAlignment()

Align llvm::RISCVSubtarget::getPrefLoopAlignment ( ) const
inline

Definition at line 156 of file RISCVSubtarget.h.

◆ getProcFamily()

RISCVProcFamilyEnum llvm::RISCVSubtarget::getProcFamily ( ) const
inline

Returns RISC-V processor family.

Avoid this function! CPU specifics should be kept local to this class and preferably modeled with SubtargetFeatures or properties in initializeProperties().

Definition at line 164 of file RISCVSubtarget.h.

◆ getRealMaxVLen()

unsigned llvm::RISCVSubtarget::getRealMaxVLen ( ) const
inline

Definition at line 249 of file RISCVSubtarget.h.

References getMaxRVVVectorSizeInBits().

Referenced by combineToVCPOP(), and getRealVLen().

◆ getRealMinVLen()

◆ getRealVLen()

std::optional< unsigned > llvm::RISCVSubtarget::getRealVLen ( ) const
inline

◆ getRegBankInfo()

const RISCVRegisterBankInfo * RISCVSubtarget::getRegBankInfo ( ) const
override

Definition at line 138 of file RISCVSubtarget.cpp.

References RegBankInfo.

Referenced by getInstructionSelector(), and llvm::RISCVCallLowering::lowerCall().

◆ getRegisterInfo()

◆ getSelectionDAGInfo()

const SelectionDAGTargetInfo * RISCVSubtarget::getSelectionDAGInfo ( ) const
override

Definition at line 113 of file RISCVSubtarget.cpp.

References TSInfo.

◆ getTailDupAggressiveThreshold()

unsigned llvm::RISCVSubtarget::getTailDupAggressiveThreshold ( ) const
inline

Definition at line 393 of file RISCVSubtarget.h.

◆ getTargetABI()

RISCVABI::ABI llvm::RISCVSubtarget::getTargetABI ( ) const
inline

Definition at line 272 of file RISCVSubtarget.h.

Referenced by llvm::CC_RISCV(), llvm::CC_RISCV_FastCC(), and CC_RISCVAssign2XLen().

◆ getTargetLowering()

const RISCVTargetLowering * llvm::RISCVSubtarget::getTargetLowering ( ) const
inlineoverride

◆ getVRGatherCostModel()

RISCVVRGatherCostModelEnum llvm::RISCVSubtarget::getVRGatherCostModel ( ) const
inline

Definition at line 166 of file RISCVSubtarget.h.

◆ getXLen()

◆ getXLenVT()

◆ hasBEXTILike()

bool llvm::RISCVSubtarget::hasBEXTILike ( ) const
inline

Definition at line 203 of file RISCVSubtarget.h.

Referenced by useInversedSetcc().

◆ hasCLZLike()

bool llvm::RISCVSubtarget::hasCLZLike ( ) const
inline

Definition at line 189 of file RISCVSubtarget.h.

◆ hasConditionalMoveFusion()

bool llvm::RISCVSubtarget::hasConditionalMoveFusion ( ) const
inline

Definition at line 209 of file RISCVSubtarget.h.

Referenced by combineSelectAndUse(), lowerSelectToBinOp(), and performSELECTCombine().

◆ hasCPOPLike()

bool llvm::RISCVSubtarget::hasCPOPLike ( ) const
inline

Definition at line 196 of file RISCVSubtarget.h.

◆ hasCTZLike()

bool llvm::RISCVSubtarget::hasCTZLike ( ) const
inline

Definition at line 193 of file RISCVSubtarget.h.

◆ hasCZEROLike()

bool llvm::RISCVSubtarget::hasCZEROLike ( ) const
inline

Definition at line 205 of file RISCVSubtarget.h.

Referenced by combineSelectAndUse(), lowerSelectToBinOp(), and useInversedSetcc().

◆ hasHalfFPLoadStoreMove()

bool llvm::RISCVSubtarget::hasHalfFPLoadStoreMove ( ) const
inline

Definition at line 185 of file RISCVSubtarget.h.

◆ hasOptimizedSegmentLoadStore()

bool llvm::RISCVSubtarget::hasOptimizedSegmentLoadStore ( unsigned NF) const
inline

Definition at line 301 of file RISCVSubtarget.h.

References llvm_unreachable.

◆ hasREV8Like()

bool llvm::RISCVSubtarget::hasREV8Like ( ) const
inline

Definition at line 199 of file RISCVSubtarget.h.

◆ hasShlAdd()

bool llvm::RISCVSubtarget::hasShlAdd ( int64_t ShAmt) const
inline

◆ hasStdExtCOrZca()

bool llvm::RISCVSubtarget::hasStdExtCOrZca ( ) const
inline

Definition at line 173 of file RISCVSubtarget.h.

References hasStdExtCOrZca().

Referenced by hasStdExtCOrZca().

◆ hasStdExtCOrZcd()

bool llvm::RISCVSubtarget::hasStdExtCOrZcd ( ) const
inline

Definition at line 174 of file RISCVSubtarget.h.

Referenced by isCompressibleLoad(), and isCompressibleStore().

◆ hasStdExtCOrZcfOrZce()

bool llvm::RISCVSubtarget::hasStdExtCOrZcfOrZce ( ) const
inline

Definition at line 175 of file RISCVSubtarget.h.

Referenced by isCompressibleLoad(), and isCompressibleStore().

◆ hasStdExtDOrZdinx()

bool llvm::RISCVSubtarget::hasStdExtDOrZdinx ( ) const
inline

Definition at line 180 of file RISCVSubtarget.h.

◆ hasStdExtFOrZfinx()

bool llvm::RISCVSubtarget::hasStdExtFOrZfinx ( ) const
inline

Definition at line 179 of file RISCVSubtarget.h.

◆ hasStdExtZfhminOrZhinxmin()

bool llvm::RISCVSubtarget::hasStdExtZfhminOrZhinxmin ( ) const
inline

Definition at line 182 of file RISCVSubtarget.h.

◆ hasStdExtZfhOrZhinx()

bool llvm::RISCVSubtarget::hasStdExtZfhOrZhinx ( ) const
inline

Definition at line 181 of file RISCVSubtarget.h.

Referenced by lowerFP_TO_INT(), lowerFP_TO_INT_SAT(), and lowerINT_TO_FP().

◆ hasStdExtZvl()

bool llvm::RISCVSubtarget::hasStdExtZvl ( ) const
inline

Definition at line 178 of file RISCVSubtarget.h.

◆ hasVInstructions()

◆ hasVInstructionsAnyF()

bool llvm::RISCVSubtarget::hasVInstructionsAnyF ( ) const
inline

Definition at line 295 of file RISCVSubtarget.h.

References hasVInstructionsF32().

◆ hasVInstructionsBF16Minimal()

bool llvm::RISCVSubtarget::hasVInstructionsBF16Minimal ( ) const
inline

Definition at line 291 of file RISCVSubtarget.h.

Referenced by isLegalElementTypeForRVV(), and useRVVForFixedLengthVectorVT().

◆ hasVInstructionsF16()

bool llvm::RISCVSubtarget::hasVInstructionsF16 ( ) const
inline

◆ hasVInstructionsF16Minimal()

bool llvm::RISCVSubtarget::hasVInstructionsF16Minimal ( ) const
inline

Definition at line 289 of file RISCVSubtarget.h.

Referenced by isPromotedOpNeedingSplit(), and useRVVForFixedLengthVectorVT().

◆ hasVInstructionsF32()

bool llvm::RISCVSubtarget::hasVInstructionsF32 ( ) const
inline

◆ hasVInstructionsF64()

bool llvm::RISCVSubtarget::hasVInstructionsF64 ( ) const
inline

Definition at line 293 of file RISCVSubtarget.h.

Referenced by isLegalElementTypeForRVV(), and useRVVForFixedLengthVectorVT().

◆ hasVInstructionsFullMultiply()

bool llvm::RISCVSubtarget::hasVInstructionsFullMultiply ( ) const
inline

Definition at line 296 of file RISCVSubtarget.h.

◆ hasVInstructionsI64()

bool llvm::RISCVSubtarget::hasVInstructionsI64 ( ) const
inline

◆ is64Bit()

◆ isRegisterReservedByUser()

bool llvm::RISCVSubtarget::isRegisterReservedByUser ( Register i) const
inlineoverride

Definition at line 278 of file RISCVSubtarget.h.

References assert(), and llvm::Register::id().

◆ isSoftFPABI()

bool llvm::RISCVSubtarget::isSoftFPABI ( ) const
inline

◆ isTargetAndroid()

bool llvm::RISCVSubtarget::isTargetAndroid ( ) const
inline

Definition at line 354 of file RISCVSubtarget.h.

◆ isTargetFuchsia()

bool llvm::RISCVSubtarget::isTargetFuchsia ( ) const
inline

Definition at line 355 of file RISCVSubtarget.h.

◆ isXRaySupported()

bool llvm::RISCVSubtarget::isXRaySupported ( ) const
inlineoverride

Definition at line 284 of file RISCVSubtarget.h.

◆ overridePostRASchedPolicy()

◆ overrideSchedPolicy()

◆ ParseSubtargetFeatures()

void llvm::RISCVSubtarget::ParseSubtargetFeatures ( StringRef CPU,
StringRef TuneCPU,
StringRef FS )

◆ useAA()

bool RISCVSubtarget::useAA ( ) const
override

Enable use of alias analysis during code generation (during MI scheduling, DAGCombine, etc.).

Definition at line 210 of file RISCVSubtarget.cpp.

References UseAA.

◆ useCCMovInsn()

bool RISCVSubtarget::useCCMovInsn ( ) const

Definition at line 253 of file RISCVSubtarget.cpp.

References UseCCMovInsn.

◆ useConstantPoolForLargeInts()

bool RISCVSubtarget::useConstantPoolForLargeInts ( ) const

Definition at line 144 of file RISCVSubtarget.cpp.

References RISCVDisableUsingConstantPoolForLargeInts.

Referenced by lowerConstant().

◆ useDFAforSMS()

bool llvm::RISCVSubtarget::useDFAforSMS ( ) const
inlineoverride

Definition at line 370 of file RISCVSubtarget.h.

◆ useLoadStorePairs()

bool RISCVSubtarget::useLoadStorePairs ( ) const

Definition at line 249 of file RISCVSubtarget.cpp.

References UseMIPSLoadStorePairsOpt.

◆ useRVVForFixedLengthVectors()

bool RISCVSubtarget::useRVVForFixedLengthVectors ( ) const

Member Data Documentation

◆ CallLoweringInfo

std::unique_ptr<CallLowering> llvm::RISCVSubtarget::CallLoweringInfo
mutableprotected

Definition at line 335 of file RISCVSubtarget.h.

Referenced by getCallLowering().

◆ InstSelector

std::unique_ptr<InstructionSelector> llvm::RISCVSubtarget::InstSelector
mutableprotected

Definition at line 336 of file RISCVSubtarget.h.

Referenced by getInstructionSelector().

◆ Legalizer

std::unique_ptr<LegalizerInfo> llvm::RISCVSubtarget::Legalizer
mutableprotected

Definition at line 337 of file RISCVSubtarget.h.

Referenced by getLegalizerInfo().

◆ RegBankInfo

std::unique_ptr<RISCVRegisterBankInfo> llvm::RISCVSubtarget::RegBankInfo
mutableprotected

Definition at line 338 of file RISCVSubtarget.h.

Referenced by getRegBankInfo().

◆ TSInfo

std::unique_ptr<const SelectionDAGTargetInfo> llvm::RISCVSubtarget::TSInfo
protected

Definition at line 332 of file RISCVSubtarget.h.

Referenced by getSelectionDAGInfo(), and RISCVSubtarget().


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