21#define DEBUG_TYPE "nvptx-subtarget"
23#define GET_SUBTARGETINFO_ENUM
24#define GET_SUBTARGETINFO_TARGET_DESC
25#define GET_SUBTARGETINFO_CTOR
26#include "NVPTXGenSubtargetInfo.inc"
30 cl::desc(
"NVPTX Specific: Disable generation of f16 math ops."),
34 cl::desc(
"NVPTX Specific: Disable generation of "
35 "f32x2 instructions and registers."),
39void NVPTXSubtarget::anchor() {}
43 TargetName = std::string(CPU);
53 if (PTXVersion == 0) {
61 const std::string &FS,
66 TSInfo = std::make_unique<NVPTXSelectionDAGInfo>();
84 if (SMVer == 101 || SM == 101)
88 !(PTXVer >= 90 && SMVer == 101);
102 return SMVer == SM &&
105 !(PTXVer >= 90 && SMVer == 101);
114 return SmVersion >= 100 && PTXVersion >= 86 && !
NoF32x2;
132 case ISD::FNEARBYINT:
134 case ISD::FROUNDEVEN:
140 case ISD::FMAXNUM_IEEE:
141 case ISD::FMINNUM_IEEE:
150 std::string
const &FailureMessage)
const {
155 "NVPTX SM architecture \"{}\" and PTX version \"{}\" do not support {}. "
156 "Requires SM >= 90 and PTX >= 78.",
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 cl::opt< bool > NoF16Math("nvptx-no-f16-math", cl::Hidden, cl::desc("NVPTX Specific: Disable generation of f16 math ops."), cl::init(false))
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
void failIfClustersUnsupported(std::string const &FailureMessage) const
bool hasPTXWithAccelSMs(unsigned PTXVersion, ArrayRef< unsigned > SMVersions) const
std::string getTargetName() const
void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS)
unsigned getPTXVersion() const
~NVPTXSubtarget() override
bool hasNativeBF16Support(int Opcode) const
unsigned int getFullSmVersion() const
unsigned int getSmVersion() const
bool hasFamilySpecificFeatures() const
bool hasPTXWithFamilySMs(unsigned PTXVersion, ArrayRef< unsigned > SMVersions) const
bool hasF32x2Instructions() const
unsigned int getSmFamilyVersion() const
bool allowFP16Math() const
NVPTXSubtarget(const Triple &TT, const std::string &CPU, const std::string &FS, const NVPTXTargetMachine &TM)
This constructor initializes the data members to match that of the specified module.
bool hasArchAccelFeatures() const
NVPTXSubtarget & initializeSubtargetDependencies(StringRef CPU, StringRef FS)
const SelectionDAGTargetInfo * getSelectionDAGInfo() const override
Targets can subclass this to parameterize the SelectionDAG lowering and instruction selection process...
StringRef - Represent a constant reference to a string, i.e.
Triple - Helper class for working with autoconf configuration names.
@ 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).
@ SELECT_CC
Select with condition operator - This selects between a true value and a false value (ops #2 and #3) ...
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.
auto formatv(bool Validate, const char *Fmt, Ts &&...Vals)
LLVM_ABI void report_fatal_error(Error Err, bool gen_crash_diag=true)