21#define DEBUG_TYPE "nvptx-subtarget"
23#define GET_SUBTARGETINFO_TARGET_DESC
24#define GET_SUBTARGETINFO_CTOR
25#include "NVPTXGenSubtargetInfo.inc"
29 cl::desc(
"NVPTX Specific: Disable generation of f16 math ops."),
33 cl::desc(
"NVPTX Specific: Disable generation of "
34 "f32x2 instructions and registers."),
38void NVPTXSubtarget::anchor() {}
57 case NVPTX::GK_SM_32_:
84 case NVPTX::GK_SM_90a:
86 case NVPTX::GK_SM_100:
87 case NVPTX::GK_SM_100a:
88 case NVPTX::GK_SM_101:
89 case NVPTX::GK_SM_101a:
91 case NVPTX::GK_SM_120:
92 case NVPTX::GK_SM_120a:
94 case NVPTX::GK_SM_100f:
95 case NVPTX::GK_SM_101f:
96 case NVPTX::GK_SM_103:
97 case NVPTX::GK_SM_103f:
98 case NVPTX::GK_SM_103a:
99 case NVPTX::GK_SM_120f:
100 case NVPTX::GK_SM_121:
101 case NVPTX::GK_SM_121f:
102 case NVPTX::GK_SM_121a:
104 case NVPTX::GK_SM_88:
105 case NVPTX::GK_SM_110:
106 case NVPTX::GK_SM_110f:
107 case NVPTX::GK_SM_110a:
109 case NVPTX::GK_SM_107:
110 case NVPTX::GK_SM_107f:
111 case NVPTX::GK_SM_107a:
128 Arch = NVPTX::GK_SM_20;
132 if (PTXVersion == 0) {
135 }
else if (PTXVersion < MinPTX) {
138 formatv(
"PTX version {0}.{1} does not support target '{2}'. "
139 "Minimum required PTX version is {3}.{4}. "
140 "Either remove the PTX version to use the default, "
141 "or increase it to at least {3}.{4}.",
142 PTXVersion / 10, PTXVersion % 10, RequestedCPU, MinPTX / 10,
static bool hasFeature(StringRef Feature, const FeatureBitset &FeatureBits, ArrayRef< SubtargetFeatureKV > ProcFeatures)
static cl::opt< bool > NoF32x2("nvptx-no-f32x2", cl::Hidden, cl::desc("NVPTX Specific: Disable generation of " "f32x2 instructions and registers."), cl::init(false))
static unsigned minPTXVersion(NVPTX::GPUKind Arch)
static cl::opt< bool > NoF16Math("nvptx-no-f16-math", cl::Hidden, cl::desc("NVPTX Specific: Disable generation of f16 math ops."), cl::init(false))
bool hasNativeBF16Support(unsigned Opcode) const
void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS)
unsigned getPTXVersion() const
~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.
#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 - Perform floating-point minimumNumber or maximumNumber on two values,...
@ SELECT_CC
Select with condition operator - This selects between a true value and a false value (ops #2 and #3) ...
@ FMINNUM
FMINNUM/FMAXNUM - Perform floating-point minimum maximum on two values, following IEEE-754 definition...
@ FMINIMUM
FMINIMUM/FMAXIMUM - NaN-propagating minimum/maximum that also treat -0.0 as less than 0....
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.
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
auto formatv(bool Validate, const char *Fmt, Ts &&...Vals)
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.