24#define PROC(ENUM, NAME, DEFAULT_MARCH, FAST_UNALIGN) CK_##ENUM,
25#define TUNE_PROC(ENUM, NAME) CK_##ENUM,
26#include "llvm/TargetParser/RISCVTargetParserDef.inc"
37#define PROC(ENUM, NAME, DEFAULT_MARCH, FAST_UNALIGN) \
38 {NAME, DEFAULT_MARCH, FAST_UNALIGN},
39#include "llvm/TargetParser/RISCVTargetParserDef.inc"
51 return Info &&
Info->FastUnalignedAccess;
59 return Info->is64Bit() == IsRV64;
63 std::optional<CPUKind> Kind =
66 #include "llvm/TargetParser/RISCVTargetParserDef.inc"
67 .Default(std::nullopt);
80 return Info->DefaultMarch;
85 if (IsRV64 ==
C.is64Bit())
92 if (IsRV64 ==
C.is64Bit())
95#define TUNE_PROC(ENUM, NAME) Values.emplace_back(StringRef(NAME));
96#include "llvm/TargetParser/RISCVTargetParserDef.inc"
104 if (MarchFromCPU ==
"")
107 EnabledFeatures.
clear();
114 std::vector<std::string> FeatStrings =
115 (*RII)->toFeatures(
false);
116 for (
const auto &
F : FeatStrings)
124namespace RISCVVType {
137 unsigned VLMULBits =
static_cast<unsigned>(VLMUL);
139 unsigned VTypeI = (VSEWBits << 3) | (VLMULBits & 0x7);
156 return std::make_pair(1 <<
static_cast<unsigned>(VLMUL),
false);
160 return std::make_pair(1 << (8 -
static_cast<unsigned>(VLMUL)),
true);
165 unsigned Sew =
getSEW(VType);
195 LMul = Fractional ? (8 / LMul) : (LMul * 8);
197 assert(SEW >= 8 &&
"Unexpected SEW value");
198 return (SEW * 8) / LMul;
201std::optional<RISCVII::VLMUL>
204 unsigned EMULFixedPoint = (EEW * 8) / Ratio;
205 bool Fractional = EMULFixedPoint < 8;
206 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, bool IgnoreUnknown=false)
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)
A wrapper around a string literal that serves as a proxy for constructing global tables of StringRefs...
StringRef - Represent a constant reference to a string, i.e.
bool starts_with(StringRef Prefix) const
Check if this string starts with the given Prefix.
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)
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[]
bool hasFastUnalignedAccess(StringRef CPU)
StringRef getMArchFromMcpu(StringRef CPU)
bool parseCPU(StringRef CPU, bool IsRV64)
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.
StringLiteral DefaultMarch