23#define PROC(ENUM, NAME, DEFAULT_MARCH, FAST_SCALAR_UNALIGN, \
24 FAST_VECTOR_UNALIGN, MVENDORID, MARCHID, MIMPID) \
26#define TUNE_PROC(ENUM, NAME) CK_##ENUM,
27#include "llvm/TargetParser/RISCVTargetParserDef.inc"
31#define PROC(ENUM, NAME, DEFAULT_MARCH, FAST_SCALAR_UNALIGN, \
32 FAST_VECTOR_UNALIGN, MVENDORID, MARCHID, MIMPID) \
36 FAST_SCALAR_UNALIGN, \
37 FAST_VECTOR_UNALIGN, \
38 {MVENDORID, MARCHID, MIMPID}, \
40#include "llvm/TargetParser/RISCVTargetParserDef.inc"
52 return Info &&
Info->FastScalarUnalignedAccess;
57 return Info &&
Info->FastVectorUnalignedAccess;
62 return Model.MVendorID != 0 && Model.MArchID != 0 && Model.MImpID != 0;
77 return Info->is64Bit() == IsRV64;
81 std::optional<CPUKind> Kind =
84 #include "llvm/TargetParser/RISCVTargetParserDef.inc"
85 .Default(std::nullopt);
98 return Info->DefaultMarch;
103 if (IsRV64 ==
C.is64Bit())
110 if (IsRV64 ==
C.is64Bit())
113#define TUNE_PROC(ENUM, NAME) Values.emplace_back(StringRef(NAME));
114#include "llvm/TargetParser/RISCVTargetParserDef.inc"
122 if (MarchFromCPU ==
"")
125 EnabledFeatures.
clear();
132 std::vector<std::string> FeatStrings =
133 (*RII)->toFeatures(
false);
134 for (
const auto &
F : FeatStrings)
141namespace RISCVExtensionBitmaskTable {
142#define GET_RISCVExtensionBitmaskTable_IMPL
143#include "llvm/TargetParser/RISCVTargetParserDef.inc"
149 bool operator()(
const RISCVExtensionBitmaskTable::RISCVExtensionBitmask &
LHS,
151 return StringRef(
LHS.Name) <
RHS;
158namespace RISCVVType {
171 unsigned VLMULBits =
static_cast<unsigned>(VLMUL);
173 unsigned VTypeI = (VSEWBits << 3) | (VLMULBits & 0x7);
190 return std::make_pair(1 <<
static_cast<unsigned>(VLMUL),
false);
194 return std::make_pair(1 << (8 -
static_cast<unsigned>(VLMUL)),
true);
199 unsigned Sew =
getSEW(VType);
229 LMul = Fractional ? (8 / LMul) : (LMul * 8);
231 assert(SEW >= 8 &&
"Unexpected SEW value");
232 return (SEW * 8) / LMul;
235std::optional<RISCVII::VLMUL>
238 unsigned EMULFixedPoint = (EEW * 8) / Ratio;
239 bool Fractional = EMULFixedPoint < 8;
240 unsigned EMUL = Fractional ? 8 / EMULFixedPoint : EMULFixedPoint / 8;
Analysis containing CSE Info
#define TUNE_PROC(ENUM, NAME)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file defines the SmallVector class.
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
static llvm::Expected< std::unique_ptr< RISCVISAInfo > > parseArchString(StringRef Arch, bool EnableExperimentalExtension, bool ExperimentalExtensionVersionCheck=true)
Parse RISC-V ISA info from arch string.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
reference emplace_back(ArgTypes &&... Args)
void push_back(const T &Elt)
StringRef - Represent a constant reference to a string, i.e.
A switch()-like statement whose cases are string literals.
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ C
The default llvm calling convention, compatible with C.
static bool isTailAgnostic(unsigned VType)
static RISCVII::VLMUL getVLMUL(unsigned VType)
std::pair< unsigned, bool > decodeVLMUL(RISCVII::VLMUL VLMUL)
unsigned getSEWLMULRatio(unsigned SEW, RISCVII::VLMUL VLMul)
static bool isValidLMUL(unsigned LMUL, bool Fractional)
static RISCVII::VLMUL encodeLMUL(unsigned LMUL, bool Fractional)
static bool isMaskAgnostic(unsigned VType)
static unsigned encodeSEW(unsigned SEW)
static bool isValidSEW(unsigned SEW)
void printVType(unsigned VType, raw_ostream &OS)
unsigned encodeVTYPE(RISCVII::VLMUL VLMUL, unsigned SEW, bool TailAgnostic, bool MaskAgnostic)
static unsigned getSEW(unsigned VType)
std::optional< RISCVII::VLMUL > getSameRatioLMUL(unsigned SEW, RISCVII::VLMUL VLMUL, unsigned EEW)
bool hasFastVectorUnalignedAccess(StringRef CPU)
void getFeaturesForCPU(StringRef CPU, SmallVectorImpl< std::string > &EnabledFeatures, bool NeedPlus=false)
void fillValidTuneCPUArchList(SmallVectorImpl< StringRef > &Values, bool IsRV64)
static const CPUInfo * getCPUInfoByName(StringRef CPU)
constexpr CPUInfo RISCVCPUInfo[]
CPUModel getCPUModel(StringRef CPU)
StringRef getMArchFromMcpu(StringRef CPU)
bool parseCPU(StringRef CPU, bool IsRV64)
bool hasFastScalarUnalignedAccess(StringRef CPU)
bool hasValidCPUModel(StringRef CPU)
bool parseTuneCPU(StringRef CPU, bool IsRV64)
void fillValidCPUArchList(SmallVectorImpl< StringRef > &Values, bool IsRV64)
This is an optimization pass for GlobalISel generic memory operations.
bool errorToBool(Error Err)
Helper for converting an Error to a bool.