13#ifndef LLVM_CLANG_LIB_BASIC_TARGETS_NVPTX_H
14#define LLVM_CLANG_LIB_BASIC_TARGETS_NVPTX_H
19#include "llvm/Support/Compiler.h"
20#include "llvm/Support/NVPTXAddrSpace.h"
21#include "llvm/TargetParser/Triple.h"
55 static const char *
const GCCRegNames[];
58 std::unique_ptr<TargetInfo> HostTarget;
62 unsigned TargetPointerWidth);
74 const std::vector<std::string> &FeaturesVec)
const override {
80 Features[
"ptx" + std::to_string(PTXVersion)] =
true;
93 llvm::NVPTXAS::ADDRESS_SPACE_GENERIC)) &&
150 Opts[
"cl_clang_storage_class_specifiers"] =
true;
151 Opts[
"__cl_clang_function_pointers"] =
true;
152 Opts[
"__cl_clang_variadic_functions"] =
true;
153 Opts[
"__cl_clang_function_scope_local_variables"] =
true;
154 Opts[
"__cl_clang_non_portable_kernel_param_types"] =
true;
155 Opts[
"__cl_clang_bitfields"] =
true;
157 Opts[
"cl_khr_fp64"] =
true;
158 Opts[
"__opencl_c_fp64"] =
true;
159 Opts[
"cl_khr_byte_addressable_store"] =
true;
160 Opts[
"cl_khr_global_int32_base_atomics"] =
true;
161 Opts[
"cl_khr_global_int32_extended_atomics"] =
true;
162 Opts[
"cl_khr_local_int32_base_atomics"] =
true;
163 Opts[
"cl_khr_local_int32_extended_atomics"] =
true;
165 Opts[
"__opencl_c_images"] =
true;
166 Opts[
"__opencl_c_3d_image_writes"] =
true;
167 Opts[
"cl_khr_3d_image_writes"] =
true;
169 Opts[
"__opencl_c_generic_address_space"] =
true;
173 return llvm::omp::NVPTXGridValues;
182 std::optional<unsigned>
196 return HostTarget->checkCallingConvention(CC);
static bool hasFeature(StringRef Feature, const LangOptions &LangOpts, const TargetInfo &Target)
Determine whether a translation unit built using the current language options has the given feature.
Defines the clang::TargetOptions class.
Concrete class used by the front-end to report problems and issues.
The type of a lookup table which maps from language-specific address spaces to target-specific ones.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
TargetInfo(const llvm::Triple &T)
BuiltinVaListKind
The different kinds of __builtin_va_list types defined by the target implementation.
@ CharPtrBuiltinVaList
typedef char* __builtin_va_list;
llvm::StringMap< bool > & getSupportedOpenCLOpts()
Get supported OpenCL extensions and optional core features.
virtual bool initFeatureMap(llvm::StringMap< bool > &Features, DiagnosticsEngine &Diags, StringRef CPU, const std::vector< std::string > &FeatureVec) const
Initialize the map with the default set of target features for the CPU this should include all legal ...
Options for controlling the target.
bool hasBitIntType() const override
Determine whether the _BitInt type is supported on this target.
BuiltinVaListKind getBuiltinVaListKind() const override
Returns the kind of __builtin_va_list type that should be used with this target.
OffloadArch getGPU() const
virtual bool isAddressSpaceSupersetOf(LangAS A, LangAS B) const override
Returns true if an address space can be safely converted to another.
NVPTXTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts, unsigned TargetPointerWidth)
void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override
===-— Other target property query methods -----------------------—===//
ArrayRef< TargetInfo::GCCRegAlias > getGCCRegAliases() const override
void fillValidCPUList(SmallVectorImpl< StringRef > &Values) const override
Fill a SmallVectorImpl with the valid values to setCPU.
bool isCLZForZeroUndef() const override
The __builtin_clz* and __builtin_ctz* built-in functions are specified to have undefined results for ...
bool validateAsmConstraint(const char *&Name, TargetInfo::ConstraintInfo &Info) const override
bool hasBFloat16Type() const override
Determine whether the _BFloat16 type is supported on this target.
std::string_view getClobbers() const override
Returns a string of target-specific clobbers, in LLVM format.
llvm::SmallVector< Builtin::InfosShard > getTargetBuiltins() const override
Return information about target-specific builtins for the current primary target, and info about whic...
std::optional< unsigned > getDWARFAddressSpace(unsigned AddressSpace) const override
const llvm::omp::GV & getGridValue() const override
CallingConvCheckResult checkCallingConvention(CallingConv CC) const override
Determines whether a given calling convention is valid for the target.
bool setCPU(StringRef Name) override
Target the specified CPU.
bool isValidCPUName(StringRef Name) const override
Determine whether this TargetInfo supports the given CPU name.
bool initFeatureMap(llvm::StringMap< bool > &Features, DiagnosticsEngine &Diags, StringRef CPU, const std::vector< std::string > &FeaturesVec) const override
Initialize the map with the default set of target features for the CPU this should include all legal ...
void setSupportedOpenCLOpts() override
Set supported OpenCL extensions and optional core features.
Defines the clang::TargetInfo interface.
static constexpr LangASMap NVPTXAddrSpaceMap
static const int NVPTXDWARFAddrSpaceMap[]
The DWARF address class.
The JSON file list parser is used to communicate input to InstallAPI.
bool isTargetAddressSpace(LangAS AS)
unsigned toTargetAddressSpace(LangAS AS)
OffloadArch StringToOffloadArch(llvm::StringRef S)
LangAS
Defines the address space values used by the address space qualifier of QualType.
const char * OffloadArchToString(OffloadArch A)
CallingConv
CallingConv - Specifies the calling convention that a function uses.
__packed_splat4 __packed_splat2 __packed_splat8 __packed_splat4 __packed_splat2 __packed_splat4 __packed_splat2 __packed_splat8 __packed_splat4 uint32_t