25#define DEBUG_TYPE "nvptx-subtarget"
27#define GET_SUBTARGETINFO_TARGET_DESC
28#define GET_SUBTARGETINFO_CTOR
29#include "NVPTXGenSubtargetInfo.inc"
31#define OPTIONS_STRUCT_DEFS
32#include "NVPTXOptions.inc"
35 return C.getLibraryOptions().get<NVPTXOptions>();
47void NVPTXSubtarget::anchor() {}
72 case NVPTX::GK_SM_32_:
99 case NVPTX::GK_SM_90a:
101 case NVPTX::GK_SM_100:
102 case NVPTX::GK_SM_100a:
103 case NVPTX::GK_SM_101:
104 case NVPTX::GK_SM_101a:
105 case NVPTX::GK_SM_110:
106 case NVPTX::GK_SM_110a:
108 case NVPTX::GK_SM_120:
109 case NVPTX::GK_SM_120a:
111 case NVPTX::GK_SM_100f:
112 case NVPTX::GK_SM_101f:
113 case NVPTX::GK_SM_103:
114 case NVPTX::GK_SM_103f:
115 case NVPTX::GK_SM_103a:
116 case NVPTX::GK_SM_110f:
117 case NVPTX::GK_SM_120f:
118 case NVPTX::GK_SM_121:
119 case NVPTX::GK_SM_121f:
120 case NVPTX::GK_SM_121a:
122 case NVPTX::GK_SM_88:
124 case NVPTX::GK_SM_107:
125 case NVPTX::GK_SM_107f:
126 case NVPTX::GK_SM_107a:
137 case NVPTX::GK_SM_110:
139 case NVPTX::GK_SM_110f:
141 case NVPTX::GK_SM_110a:
161 Arch = NVPTX::GK_SM_20;
165 if (PTXVersion == 0) {
169 }
else if (PTXVersion < MinPTX) {
172 formatv(
"PTX version {0}.{1} does not support target '{2}'. "
173 "Minimum required PTX version is {3}.{4}. "
174 "Either remove the PTX version to use the default, "
175 "or increase it to at least {3}.{4}.",
176 PTXVersion / 10, PTXVersion % 10, RequestedCPU, MinPTX / 10,
197 return hasFeature(NVPTX::SM100) && !CLOpts.no_f32x2;
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
Module.h This file contains the declarations for the Module class.
static void ApplyFeatureFlag(FeatureBitset &Bits, StringRef Feature, ArrayRef< SubtargetFeatureKV > FeatureTable)
static bool hasFeature(StringRef Feature, const FeatureBitset &FeatureBits, ArrayRef< SubtargetFeatureKV > ProcFeatures)
static unsigned minPTXVersion(NVPTX::GPUKind Arch)
This is an important class for using LLVM in a threaded context.
A Module instance is used to store all the information related to an LLVM module.
const NVPTXOptions & getCLOpts() const
bool hasNativeBF16Support(unsigned Opcode) const
StringRef getTargetName() const
void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS)
~NVPTXSubtarget() override
bool hasF32x2Instructions() const
bool allowFP16Math() const
NVPTXSubtarget & initializeSubtargetDependencies(StringRef CPU, StringRef FS)
NVPTXSubtarget(const Triple &TT, StringRef CPU, StringRef FS, const NVPTXTargetMachine &TM)
This constructor initializes the data members to match that of the specified module.
Represent a constant reference to a string, i.e.
constexpr bool empty() const
Check if the string is empty.
Triple - Helper class for working with autoconf configuration names.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ SETCC
SetCC operator - This evaluates to a true value iff the condition is true.
@ FADD
Simple binary floating point operators.
@ SELECT
Select(COND, TRUEVAL, FALSEVAL).
@ FMINNUM_IEEE
FMINNUM_IEEE/FMAXNUM_IEEE - Same as FMINNUM/FMAXNUM, except that a signaling NaN operand deterministi...
@ SELECT_CC
Select with condition operator - This selects between a true value and a false value (ops #2 and #3) ...
@ FMINNUM
FMINNUM/FMAXNUM - Same semantics as the llvm.minnum/maxnum intrinsics.
@ FMINIMUM
FMINIMUM/FMAXIMUM - Same semantics as the llvm.minimum/maximum intrinsics.
LLVM_ABI GPUKind parseArch(StringRef CPU)
Parse CPU (e.g. "sm_90") into a GPUKind, or GK_NONE if unrecognized.
GPUKind
GPU kinds supported by the NVPTX target.
LLVM_ABI StringRef getArchName(GPUKind Kind)
Return the canonical processor name (e.g.
This is an optimization pass for GlobalISel generic memory operations.
auto formatv(bool Validate, const char *Fmt, Ts &&...Vals)
const NVPTXOptions & getNVPTXOptions(const LLVMContext &C)
LLVM_ABI void reportFatalUsageError(Error Err)
Report a fatal error that does not indicate a bug in LLVM.
Implement std::hash so that hash_code can be used in STL containers.