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 useMIPSLoadStorePairs () const
bool useMIPSCCMovInsn () 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 hasVInstructionsBF16 () const
bool hasVInstructionsAnyF () const
bool hasVInstructionsFullMultiply () const
unsigned getMaxInterleaveFactor () const
bool hasOptimizedSegmentLoadStore (unsigned NF) const
bool enablePExtCodeGen () 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 106 of file RISCVSubtarget.cpp.

References TSInfo.

◆ ~RISCVSubtarget()

RISCVSubtarget::~RISCVSubtarget ( )
overridedefault

Member Function Documentation

◆ enableMachinePipeliner()

bool RISCVSubtarget::enableMachinePipeliner ( ) const
override

Definition at line 216 of file RISCVSubtarget.cpp.

◆ enableMachineScheduler()

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

Definition at line 148 of file RISCVSubtarget.h.

◆ enablePExtCodeGen()

bool RISCVSubtarget::enablePExtCodeGen ( ) const

Definition at line 156 of file RISCVSubtarget.cpp.

References EnablePExtCodeGen.

Referenced by lowerBUILD_VECTOR(), and performTRUNCATECombine().

◆ enablePostRAScheduler()

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

Definition at line 150 of file RISCVSubtarget.h.

◆ enableSubRegLiveness()

bool RISCVSubtarget::enableSubRegLiveness ( ) const
override

Definition at line 214 of file RISCVSubtarget.cpp.

◆ enableWritePrefetching()

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

Definition at line 393 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 263 of file RISCVSubtarget.h.

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

◆ getCacheLineSize()

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

Definition at line 378 of file RISCVSubtarget.h.

◆ getCallLowering()

const CallLowering * RISCVSubtarget::getCallLowering ( ) const
override

Definition at line 125 of file RISCVSubtarget.cpp.

References CallLoweringInfo, and getTargetLowering().

◆ getDLenFactor()

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

Definition at line 328 of file RISCVSubtarget.h.

◆ getELen()

◆ getFLen()

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

Definition at line 231 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 140 of file RISCVSubtarget.cpp.

References Legalizer.

◆ getMaxBuildIntsCost()

unsigned RISCVSubtarget::getMaxBuildIntsCost ( ) const

Definition at line 160 of file RISCVSubtarget.cpp.

References RISCVMaxBuildIntsCost.

Referenced by lowerConstant().

◆ getMaxGluedStoresPerMemcpy()

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

Definition at line 406 of file RISCVSubtarget.h.

◆ getMaxInterleaveFactor()

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

Definition at line 299 of file RISCVSubtarget.h.

References hasVInstructions().

◆ getMaxLMULForFixedLengthVectors()

unsigned RISCVSubtarget::getMaxLMULForFixedLengthVectors ( ) const

◆ getMaxLoadsPerMemcmp()

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

Definition at line 420 of file RISCVSubtarget.h.

◆ getMaxPrefetchIterationsAhead()

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

Definition at line 390 of file RISCVSubtarget.h.

◆ getMaxRVVVectorSizeInBits()

unsigned RISCVSubtarget::getMaxRVVVectorSizeInBits ( ) const
protected

Definition at line 171 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 410 of file RISCVSubtarget.h.

◆ getMaxStoresPerMemmove()

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

Definition at line 415 of file RISCVSubtarget.h.

◆ getMaxStoresPerMemset()

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

Definition at line 401 of file RISCVSubtarget.h.

◆ getMinimumJumpTableEntries()

unsigned RISCVSubtarget::getMinimumJumpTableEntries ( ) const

Definition at line 224 of file RISCVSubtarget.cpp.

References RISCVMinimumJumpTableEntries.

◆ getMinPrefetchStride()

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

Definition at line 384 of file RISCVSubtarget.h.

◆ getMinRVVVectorSizeInBits()

unsigned RISCVSubtarget::getMinRVVVectorSizeInBits ( ) const
protected

◆ getPostRASchedDirection()

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

Definition at line 425 of file RISCVSubtarget.h.

Referenced by overridePostRASchedPolicy().

◆ getPrefetchDistance()

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

Definition at line 381 of file RISCVSubtarget.h.

◆ getPrefFunctionAlignment()

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

Definition at line 152 of file RISCVSubtarget.h.

◆ getPrefLoopAlignment()

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

Definition at line 155 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 163 of file RISCVSubtarget.h.

◆ getRealMaxVLen()

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

Definition at line 248 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 146 of file RISCVSubtarget.cpp.

References RegBankInfo.

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

◆ getRegisterInfo()

◆ getSelectionDAGInfo()

const SelectionDAGTargetInfo * RISCVSubtarget::getSelectionDAGInfo ( ) const
override

Definition at line 121 of file RISCVSubtarget.cpp.

References TSInfo.

◆ getTailDupAggressiveThreshold()

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

Definition at line 397 of file RISCVSubtarget.h.

◆ getTargetABI()

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

Definition at line 271 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 165 of file RISCVSubtarget.h.

◆ getXLen()

◆ getXLenVT()

◆ hasBEXTILike()

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

Definition at line 202 of file RISCVSubtarget.h.

Referenced by useInversedSetcc().

◆ hasCLZLike()

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

Definition at line 188 of file RISCVSubtarget.h.

◆ hasConditionalMoveFusion()

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

Definition at line 208 of file RISCVSubtarget.h.

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

◆ hasCPOPLike()

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

Definition at line 195 of file RISCVSubtarget.h.

◆ hasCTZLike()

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

Definition at line 192 of file RISCVSubtarget.h.

◆ hasCZEROLike()

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

◆ hasHalfFPLoadStoreMove()

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

Definition at line 184 of file RISCVSubtarget.h.

◆ hasOptimizedSegmentLoadStore()

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

Definition at line 303 of file RISCVSubtarget.h.

References llvm_unreachable.

◆ hasREV8Like()

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

Definition at line 198 of file RISCVSubtarget.h.

◆ hasShlAdd()

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

◆ hasStdExtCOrZca()

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

Definition at line 172 of file RISCVSubtarget.h.

References hasStdExtCOrZca().

Referenced by hasStdExtCOrZca().

◆ hasStdExtCOrZcd()

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

Definition at line 173 of file RISCVSubtarget.h.

Referenced by isCompressibleLoad(), and isCompressibleStore().

◆ hasStdExtCOrZcfOrZce()

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

Definition at line 174 of file RISCVSubtarget.h.

Referenced by isCompressibleLoad(), and isCompressibleStore().

◆ hasStdExtDOrZdinx()

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

Definition at line 179 of file RISCVSubtarget.h.

◆ hasStdExtFOrZfinx()

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

Definition at line 178 of file RISCVSubtarget.h.

◆ hasStdExtZfhminOrZhinxmin()

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

Definition at line 181 of file RISCVSubtarget.h.

◆ hasStdExtZfhOrZhinx()

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

Definition at line 180 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 177 of file RISCVSubtarget.h.

◆ hasVInstructions()

◆ hasVInstructionsAnyF()

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

Definition at line 297 of file RISCVSubtarget.h.

References hasVInstructionsF32().

◆ hasVInstructionsBF16()

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

Definition at line 295 of file RISCVSubtarget.h.

Referenced by isPromotedOpNeedingSplit(), and lowerScalarSplat().

◆ hasVInstructionsBF16Minimal()

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

◆ hasVInstructionsF16()

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

Definition at line 289 of file RISCVSubtarget.h.

Referenced by isPromotedOpNeedingSplit(), and lowerVECTOR_SHUFFLEAsVSlide1().

◆ hasVInstructionsF16Minimal()

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

◆ hasVInstructionsF32()

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

◆ hasVInstructionsF64()

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

Definition at line 294 of file RISCVSubtarget.h.

Referenced by isLegalElementTypeForRVV(), and useRVVForFixedLengthVectorVT().

◆ hasVInstructionsFullMultiply()

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

Definition at line 298 of file RISCVSubtarget.h.

◆ hasVInstructionsI64()

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

◆ is64Bit()

◆ isRegisterReservedByUser()

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

Definition at line 277 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 358 of file RISCVSubtarget.h.

◆ isTargetFuchsia()

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

Definition at line 359 of file RISCVSubtarget.h.

◆ isXRaySupported()

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

Definition at line 283 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 222 of file RISCVSubtarget.cpp.

References UseAA.

◆ useConstantPoolForLargeInts()

bool RISCVSubtarget::useConstantPoolForLargeInts ( ) const

Definition at line 152 of file RISCVSubtarget.cpp.

References RISCVDisableUsingConstantPoolForLargeInts.

Referenced by lowerConstant().

◆ useDFAforSMS()

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

Definition at line 374 of file RISCVSubtarget.h.

◆ useMIPSCCMovInsn()

bool RISCVSubtarget::useMIPSCCMovInsn ( ) const

Definition at line 265 of file RISCVSubtarget.cpp.

References UseMIPSCCMovInsn.

◆ useMIPSLoadStorePairs()

bool RISCVSubtarget::useMIPSLoadStorePairs ( ) const

Definition at line 261 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 339 of file RISCVSubtarget.h.

Referenced by getCallLowering().

◆ InstSelector

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

Definition at line 340 of file RISCVSubtarget.h.

Referenced by getInstructionSelector().

◆ Legalizer

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

Definition at line 341 of file RISCVSubtarget.h.

Referenced by getLegalizerInfo().

◆ RegBankInfo

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

Definition at line 342 of file RISCVSubtarget.h.

Referenced by getRegBankInfo().

◆ TSInfo

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

Definition at line 336 of file RISCVSubtarget.h.

Referenced by getSelectionDAGInfo(), and RISCVSubtarget().


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