clang 23.0.0git
SPIR.h
Go to the documentation of this file.
1//===--- SPIR.h - Declare SPIR and SPIR-V target feature support *- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file declares SPIR and SPIR-V TargetInfo objects.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_CLANG_LIB_BASIC_TARGETS_SPIR_H
14#define LLVM_CLANG_LIB_BASIC_TARGETS_SPIR_H
15
16#include "Targets.h"
22#include "llvm/Support/Compiler.h"
23#include "llvm/Support/VersionTuple.h"
24#include "llvm/TargetParser/Triple.h"
25#include <optional>
26
27namespace clang {
28namespace targets {
29
30// Used by both the SPIR and SPIR-V targets.
31static const unsigned SPIRDefIsPrivMap[] = {
32 0, // Default
33 1, // opencl_global
34 3, // opencl_local
35 2, // opencl_constant
36 0, // opencl_private
37 4, // opencl_generic
38 5, // opencl_global_device
39 6, // opencl_global_host
40 0, // cuda_device
41 0, // cuda_constant
42 0, // cuda_shared
43 // SYCL address space values for this map are dummy
44 0, // sycl_global
45 0, // sycl_global_device
46 0, // sycl_global_host
47 0, // sycl_local
48 0, // sycl_private
49 0, // ptr32_sptr
50 0, // ptr32_uptr
51 0, // ptr64
52 3, // hlsl_groupshared
53 12, // hlsl_constant
54 10, // hlsl_private
55 11, // hlsl_device
56 7, // hlsl_input
57 8, // hlsl_output
58 13, // hlsl_push_constant
59 // Wasm address space values for this target are dummy values,
60 // as it is only enabled for Wasm targets.
61 20, // wasm_funcref
62};
63
64// Used by both the SPIR and SPIR-V targets.
65static const unsigned SPIRDefIsGenMap[] = {
66 4, // Default
67 1, // opencl_global
68 3, // opencl_local
69 2, // opencl_constant
70 0, // opencl_private
71 4, // opencl_generic
72 5, // opencl_global_device
73 6, // opencl_global_host
74 // cuda_* address space mapping is intended for HIPSPV (HIP to SPIR-V
75 // translation). This mapping is enabled when the language mode is HIP.
76 1, // cuda_device
77 // cuda_constant pointer can be casted to default/"flat" pointer, but in
78 // SPIR-V casts between constant and generic pointers are not allowed. For
79 // this reason cuda_constant is mapped to SPIR-V CrossWorkgroup.
80 1, // cuda_constant
81 3, // cuda_shared
82 1, // sycl_global
83 5, // sycl_global_device
84 6, // sycl_global_host
85 3, // sycl_local
86 0, // sycl_private
87 0, // ptr32_sptr
88 0, // ptr32_uptr
89 0, // ptr64
90 3, // hlsl_groupshared
91 0, // hlsl_constant
92 10, // hlsl_private
93 11, // hlsl_device
94 7, // hlsl_input
95 8, // hlsl_output
96 13, // hlsl_push_constant
97 // Wasm address space values for this target are dummy values,
98 // as it is only enabled for Wasm targets.
99 20, // wasm_funcref
100};
101
102// Base class for SPIR and SPIR-V target info.
103class LLVM_LIBRARY_VISIBILITY BaseSPIRTargetInfo : public TargetInfo {
104 std::unique_ptr<TargetInfo> HostTarget;
105
106protected:
107 BaseSPIRTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
108 : TargetInfo(Triple) {
109 assert((Triple.isSPIR() || Triple.isSPIRV()) &&
110 "Invalid architecture for SPIR or SPIR-V.");
111 TLSSupported = false;
112 VLASupported = false;
113 LongWidth = LongAlign = 64;
116 HasFastHalfType = true;
117 HasFloat16 = true;
118 HasBFloat16 = true;
119 HasFullBFloat16 = true;
121 BFloat16Format = &llvm::APFloat::BFloat();
122 // Define available target features
123 // These must be defined in sorted order!
124 NoAsmVariants = true;
125
126 llvm::Triple HostTriple(Opts.HostTriple);
127 if (!HostTriple.isSPIR() && !HostTriple.isSPIRV() &&
128 HostTriple.getArch() != llvm::Triple::UnknownArch) {
129 HostTarget = AllocateTarget(llvm::Triple(Opts.HostTriple), Opts);
130
131 // Copy properties from host target.
132 BoolWidth = HostTarget->getBoolWidth();
133 BoolAlign = HostTarget->getBoolAlign();
134 IntWidth = HostTarget->getIntWidth();
135 IntAlign = HostTarget->getIntAlign();
136 HalfWidth = HostTarget->getHalfWidth();
137 HalfAlign = HostTarget->getHalfAlign();
138 FloatWidth = HostTarget->getFloatWidth();
139 FloatAlign = HostTarget->getFloatAlign();
140 DoubleWidth = HostTarget->getDoubleWidth();
141 DoubleAlign = HostTarget->getDoubleAlign();
142 LongWidth = HostTarget->getLongWidth();
143 LongAlign = HostTarget->getLongAlign();
144 LongLongWidth = HostTarget->getLongLongWidth();
145 LongLongAlign = HostTarget->getLongLongAlign();
147 HostTarget->getMinGlobalAlign(/* TypeSize = */ 0,
148 /* HasNonWeakDef = */ true);
149 NewAlign = HostTarget->getNewAlign();
151 HostTarget->getDefaultAlignForAttributeAligned();
152 IntMaxType = HostTarget->getIntMaxType();
153 WCharType = HostTarget->getWCharType();
154 WIntType = HostTarget->getWIntType();
155 Char16Type = HostTarget->getChar16Type();
156 Char32Type = HostTarget->getChar32Type();
157 Int64Type = HostTarget->getInt64Type();
158 SigAtomicType = HostTarget->getSigAtomicType();
159 ProcessIDType = HostTarget->getProcessIDType();
160
161 UseBitFieldTypeAlignment = HostTarget->useBitFieldTypeAlignment();
163 HostTarget->useZeroLengthBitfieldAlignment();
164 UseExplicitBitFieldAlignment = HostTarget->useExplicitBitFieldAlignment();
165 ZeroLengthBitfieldBoundary = HostTarget->getZeroLengthBitfieldBoundary();
166
167 // This is a bit of a lie, but it controls __GCC_ATOMIC_XXX_LOCK_FREE, and
168 // we need those macros to be identical on host and device, because (among
169 // other things) they affect which standard library classes are defined,
170 // and we need all classes to be defined on both the host and device.
171 MaxAtomicInlineWidth = HostTarget->getMaxAtomicInlineWidth();
172 }
173 }
174
175public:
176 // SPIR supports the half type and the only llvm intrinsic allowed in SPIR is
177 // memcpy as per section 3 of the SPIR spec.
178 bool useFP16ConversionIntrinsics() const override { return false; }
179
181 return {};
182 }
183
184 std::string_view getClobbers() const override { return ""; }
185
186 ArrayRef<const char *> getGCCRegNames() const override { return {}; }
187
188 bool validateAsmConstraint(const char *&Name,
189 TargetInfo::ConstraintInfo &info) const override {
190 return true;
191 }
192
194 return {};
195 }
196
200
201 std::optional<unsigned>
202 getDWARFAddressSpace(unsigned AddressSpace) const override {
203 return AddressSpace;
204 }
205
207 return (CC == CC_SpirFunction || CC == CC_DeviceKernel) ? CCCR_OK
208 : CCCR_Warning;
209 }
210
212 return CC_SpirFunction;
213 }
214
215 void setAddressSpaceMap(bool DefaultIsGeneric) {
216 AddrSpaceMap = DefaultIsGeneric ? &SPIRDefIsGenMap : &SPIRDefIsPrivMap;
217 }
218
220 const TargetInfo *Aux) override {
221 TargetInfo::adjust(Diags, Opts, Aux);
222 // FIXME: SYCL specification considers unannotated pointers and references
223 // to be pointing to the generic address space. See section 5.9.3 of
224 // SYCL 2020 specification.
225 // Currently, there is no way of representing SYCL's and HIP/CUDA's default
226 // address space language semantic along with the semantics of embedded C's
227 // default address space in the same address space map. Hence the map needs
228 // to be reset to allow mapping to the desired value of 'Default' entry for
229 // SYCL and HIP/CUDA.
231 /*DefaultIsGeneric=*/Opts.SYCLIsDevice ||
232 // The address mapping from HIP/CUDA language for device code is only
233 // defined for SPIR-V, and all Intel SPIR-V code should have the default
234 // AS as generic.
235 (getTriple().isSPIRV() &&
236 (Opts.CUDAIsDevice ||
237 getTriple().getVendor() == llvm::Triple::Intel)));
238 }
239
240 void setSupportedOpenCLOpts() override {
241 // Assume all OpenCL extensions and optional core features are supported
242 // for SPIR and SPIR-V since they are generic targets.
244 }
245
246 bool hasBitIntType() const override { return true; }
247
248 bool hasInt128Type() const override { return false; }
249};
250
251class LLVM_LIBRARY_VISIBILITY SPIRTargetInfo : public BaseSPIRTargetInfo {
252public:
253 SPIRTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
254 : BaseSPIRTargetInfo(Triple, Opts) {
255 assert(Triple.isSPIR() && "Invalid architecture for SPIR.");
256 assert(getTriple().getOS() == llvm::Triple::UnknownOS &&
257 "SPIR target must use unknown OS");
258 assert(getTriple().getEnvironment() == llvm::Triple::UnknownEnvironment &&
259 "SPIR target must use unknown environment type");
260 }
261
262 void getTargetDefines(const LangOptions &Opts,
263 MacroBuilder &Builder) const override;
264
265 bool hasFeature(StringRef Feature) const override {
266 return Feature == "spir";
267 }
268
269 bool checkArithmeticFenceSupported() const override { return true; }
270};
271
272class LLVM_LIBRARY_VISIBILITY SPIR32TargetInfo : public SPIRTargetInfo {
273public:
274 SPIR32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
275 : SPIRTargetInfo(Triple, Opts) {
276 assert(Triple.getArch() == llvm::Triple::spir &&
277 "Invalid architecture for 32-bit SPIR.");
281 // SPIR32 has support for atomic ops if atomic extension is enabled.
282 // Take the maximum because it's possible the Host supports wider types.
283 MaxAtomicInlineWidth = std::max<unsigned char>(MaxAtomicInlineWidth, 64);
284 resetDataLayout("e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-"
285 "v96:128-v192:256-v256:256-v512:512-v1024:1024-G1");
286 }
287
288 void getTargetDefines(const LangOptions &Opts,
289 MacroBuilder &Builder) const override;
290};
291
292class LLVM_LIBRARY_VISIBILITY SPIR64TargetInfo : public SPIRTargetInfo {
293public:
294 SPIR64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
295 : SPIRTargetInfo(Triple, Opts) {
296 assert(Triple.getArch() == llvm::Triple::spir64 &&
297 "Invalid architecture for 64-bit SPIR.");
301 // SPIR64 has support for atomic ops if atomic extension is enabled.
302 // Take the maximum because it's possible the Host supports wider types.
303 MaxAtomicInlineWidth = std::max<unsigned char>(MaxAtomicInlineWidth, 64);
304 resetDataLayout("e-i64:64-v16:16-v24:32-v32:32-v48:64-"
305 "v96:128-v192:256-v256:256-v512:512-v1024:1024-G1");
306 }
307
308 void getTargetDefines(const LangOptions &Opts,
309 MacroBuilder &Builder) const override;
310};
311
312class LLVM_LIBRARY_VISIBILITY BaseSPIRVTargetInfo : public BaseSPIRTargetInfo {
313public:
314 BaseSPIRVTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
315 : BaseSPIRTargetInfo(Triple, Opts) {
316 assert(Triple.isSPIRV() && "Invalid architecture for SPIR-V.");
317 }
318
319 llvm::SmallVector<Builtin::InfosShard> getTargetBuiltins() const override;
320
321 bool hasFeature(StringRef Feature) const override {
322 return Feature == "spirv";
323 }
324
325 virtual bool isAddressSpaceSupersetOf(LangAS A, LangAS B) const override {
326 // The generic space AS(4) is a superset of all the other address
327 // spaces used by the backend target except constant address space.
328 return A == B || ((A == LangAS::Default ||
330 toTargetAddressSpace(A) == /*Generic=*/4)) &&
332 (toTargetAddressSpace(B) <= /*Generic=*/4 &&
333 toTargetAddressSpace(B) != /*Constant=*/2));
334 }
335
336 void getTargetDefines(const LangOptions &Opts,
337 MacroBuilder &Builder) const override;
338};
339
340class LLVM_LIBRARY_VISIBILITY SPIRVTargetInfo : public BaseSPIRVTargetInfo {
341public:
342 SPIRVTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
343 : BaseSPIRVTargetInfo(Triple, Opts) {
344 assert(Triple.getArch() == llvm::Triple::spirv &&
345 "Invalid architecture for Logical SPIR-V.");
347
348 // SPIR-V IDs are represented with a single 32-bit word.
352 }
353
354 // SPIR-V targeting requires a fully specified Vulkan environment.
355 // SPIR-V requires the enviornment to be in a valid shader stage as well.
356 // Validate here before CreateTargetInfo() to emit a proper diagnostic.
357 bool validateTarget(DiagnosticsEngine &Diags) const override {
358 if (getTriple().getOS() != llvm::Triple::Vulkan ||
359 getTriple().getVulkanVersion() == llvm::VersionTuple(0)) {
360 Diags.Report(diag::err_target_spirv_requires_vulkan);
361 return false;
362 }
363 if (getTriple().getEnvironment() < llvm::Triple::Pixel ||
364 getTriple().getEnvironment() > llvm::Triple::Amplification) {
365 Diags.Report(diag::err_target_spirv_requires_shader_stage);
366 return false;
367 }
368 return true;
369 }
370
371 void getTargetDefines(const LangOptions &Opts,
372 MacroBuilder &Builder) const override;
373};
374
375class LLVM_LIBRARY_VISIBILITY SPIRV32TargetInfo : public BaseSPIRVTargetInfo {
376public:
377 SPIRV32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
378 : BaseSPIRVTargetInfo(Triple, Opts) {
379 assert(Triple.getArch() == llvm::Triple::spirv32 &&
380 "Invalid architecture for 32-bit SPIR-V.");
381 assert((getTriple().getOS() == llvm::Triple::UnknownOS ||
382 getTriple().getOS() == llvm::Triple::ChipStar) &&
383 "32-bit SPIR-V target must use unknown or chipstar OS");
384 assert(getTriple().getEnvironment() == llvm::Triple::UnknownEnvironment &&
385 "32-bit SPIR-V target must use unknown environment type");
389 // SPIR-V has core support for atomic ops, and Int32 is always available;
390 // we take the maximum because it's possible the Host supports wider types.
391 MaxAtomicInlineWidth = std::max<unsigned char>(MaxAtomicInlineWidth, 64);
393 }
394
395 void getTargetDefines(const LangOptions &Opts,
396 MacroBuilder &Builder) const override;
397};
398
399class LLVM_LIBRARY_VISIBILITY SPIRV64TargetInfo : public BaseSPIRVTargetInfo {
400public:
401 SPIRV64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
402 : BaseSPIRVTargetInfo(Triple, Opts) {
403 assert(Triple.getArch() == llvm::Triple::spirv64 &&
404 "Invalid architecture for 64-bit SPIR-V.");
405 assert((getTriple().getOS() == llvm::Triple::UnknownOS ||
406 getTriple().getOS() == llvm::Triple::ChipStar) &&
407 "64-bit SPIR-V target must use unknown or chipstar OS");
408 assert(getTriple().getEnvironment() == llvm::Triple::UnknownEnvironment &&
409 "64-bit SPIR-V target must use unknown environment type");
413 // SPIR-V has core support for atomic ops, and Int64 is always available;
414 // we take the maximum because it's possible the Host supports wider types.
415 MaxAtomicInlineWidth = std::max<unsigned char>(MaxAtomicInlineWidth, 64);
417 }
418
419 void getTargetDefines(const LangOptions &Opts,
420 MacroBuilder &Builder) const override;
421
422 const llvm::omp::GV &getGridValue() const override {
423 return llvm::omp::SPIRVGridValues;
424 }
425
426 std::optional<LangAS> getConstantAddressSpace() const override {
427 return ConstantAS;
428 }
430 const TargetInfo *Aux) override {
431 BaseSPIRVTargetInfo::adjust(Diags, Opts, Aux);
432 // opencl_constant will map to UniformConstant in SPIR-V
433 if (Opts.OpenCL)
434 ConstantAS = LangAS::opencl_constant;
435 }
436
437private:
438 // opencl_global will map to CrossWorkgroup in SPIR-V
439 LangAS ConstantAS = LangAS::opencl_global;
440};
441
442class LLVM_LIBRARY_VISIBILITY SPIRV64AMDGCNTargetInfo final
443 : public BaseSPIRVTargetInfo {
444public:
445 SPIRV64AMDGCNTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
446 : BaseSPIRVTargetInfo(Triple, Opts) {
447 assert(Triple.getArch() == llvm::Triple::spirv64 &&
448 "Invalid architecture for 64-bit AMDGCN SPIR-V.");
449 assert(Triple.getVendor() == llvm::Triple::VendorType::AMD &&
450 "64-bit AMDGCN SPIR-V target must use AMD vendor");
451 assert(getTriple().getOS() == llvm::Triple::OSType::AMDHSA &&
452 "64-bit AMDGCN SPIR-V target must use AMDHSA OS");
453 assert(getTriple().getEnvironment() == llvm::Triple::UnknownEnvironment &&
454 "64-bit SPIR-V target must use unknown environment type");
459
461
462 HasFastHalfType = true;
463 HasFloat16 = true;
464 HalfArgsAndReturns = true;
465
467 }
468
469 ArrayRef<const char *> getGCCRegNames() const override;
470
474
475 bool initFeatureMap(llvm::StringMap<bool> &Features, DiagnosticsEngine &Diags,
476 StringRef,
477 const std::vector<std::string> &) const override;
478
479 bool validateAsmConstraint(const char *&Name,
480 TargetInfo::ConstraintInfo &Info) const override;
481
482 std::string convertConstraint(const char *&Constraint) const override;
483
484 llvm::SmallVector<Builtin::InfosShard> getTargetBuiltins() const override;
485
486 void getTargetDefines(const LangOptions &Opts,
487 MacroBuilder &Builder) const override;
488
489 void setAuxTarget(const TargetInfo *Aux) override;
490
492 const TargetInfo *Aux) override {
493 TargetInfo::adjust(Diags, Opts, Aux);
494
496 }
497
498 bool hasInt128Type() const override { return TargetInfo::hasInt128Type(); }
499
500 // This is only needed for validating arguments passed to
501 // __builtin_amdgcn_processor_is
502 bool isValidCPUName(StringRef Name) const override;
503 void fillValidCPUList(SmallVectorImpl<StringRef> &Values) const override;
504};
505
506class LLVM_LIBRARY_VISIBILITY SPIRV64IntelTargetInfo final
507 : public SPIRV64TargetInfo {
508public:
509 SPIRV64IntelTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
510 : SPIRV64TargetInfo(Triple, Opts) {
511 assert(Triple.getVendor() == llvm::Triple::VendorType::Intel &&
512 "64-bit Intel SPIR-V target must use Intel vendor");
514 }
515};
516} // namespace targets
517} // namespace clang
518#endif // LLVM_CLANG_LIB_BASIC_TARGETS_SPIR_H
Provides definitions for the various language-specific address spaces.
Defines the Diagnostic-related interfaces.
static StringRef getTriple(const Command &Job)
Defines the clang::TargetOptions class.
Concrete class used by the front-end to report problems and issues.
Definition Diagnostic.h:233
DiagnosticBuilder Report(SourceLocation Loc, unsigned DiagID)
Issue the message to the client.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Exposes information about the current target.
Definition TargetInfo.h:227
TargetInfo(const llvm::Triple &T)
const llvm::Triple & getTriple() const
Returns the target triple of the primary target.
const LangASMap * AddrSpaceMap
Definition TargetInfo.h:260
BuiltinVaListKind
The different kinds of __builtin_va_list types defined by the target implementation.
Definition TargetInfo.h:334
@ CharPtrBuiltinVaList
typedef char* __builtin_va_list;
Definition TargetInfo.h:336
@ VoidPtrBuiltinVaList
typedef void* __builtin_va_list;
Definition TargetInfo.h:339
AtomicOptions AtomicOpts
Definition TargetInfo.h:313
virtual bool hasInt128Type() const
Determine whether the __int128 type is supported on this target.
Definition TargetInfo.h:679
virtual void adjust(DiagnosticsEngine &Diags, LangOptions &Opts, const TargetInfo *Aux)
Set forced language options.
unsigned char MaxAtomicPromoteWidth
Definition TargetInfo.h:253
void resetDataLayout(StringRef DL)
Set the data layout to the given string.
virtual void supportAllOpenCLOpts(bool V=true)
bool UseAddrSpaceMapMangling
Specify if mangling based on address space map should be used or not for language specific address sp...
Definition TargetInfo.h:386
unsigned char MaxAtomicInlineWidth
Definition TargetInfo.h:253
Options for controlling the target.
std::string HostTriple
When compiling for the device side, contains the triple used to compile for the host.
BuiltinVaListKind getBuiltinVaListKind() const override
Returns the kind of __builtin_va_list type that should be used with this target.
Definition SPIR.h:197
void adjust(DiagnosticsEngine &Diags, LangOptions &Opts, const TargetInfo *Aux) override
Set forced language options.
Definition SPIR.h:219
ArrayRef< const char * > getGCCRegNames() const override
Definition SPIR.h:186
bool validateAsmConstraint(const char *&Name, TargetInfo::ConstraintInfo &info) const override
Definition SPIR.h:188
bool hasInt128Type() const override
Determine whether the __int128 type is supported on this target.
Definition SPIR.h:248
llvm::SmallVector< Builtin::InfosShard > getTargetBuiltins() const override
Return information about target-specific builtins for the current primary target, and info about whic...
Definition SPIR.h:180
void setAddressSpaceMap(bool DefaultIsGeneric)
Definition SPIR.h:215
bool useFP16ConversionIntrinsics() const override
Check whether conversions to and from __fp16 should go through an integer bitcast with i16.
Definition SPIR.h:178
ArrayRef< TargetInfo::GCCRegAlias > getGCCRegAliases() const override
Definition SPIR.h:193
CallingConvCheckResult checkCallingConvention(CallingConv CC) const override
Determines whether a given calling convention is valid for the target.
Definition SPIR.h:206
std::optional< unsigned > getDWARFAddressSpace(unsigned AddressSpace) const override
Definition SPIR.h:202
BaseSPIRTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition SPIR.h:107
bool hasBitIntType() const override
Determine whether the _BitInt type is supported on this target.
Definition SPIR.h:246
void setSupportedOpenCLOpts() override
Set supported OpenCL extensions and optional core features.
Definition SPIR.h:240
std::string_view getClobbers() const override
Returns a string of target-specific clobbers, in LLVM format.
Definition SPIR.h:184
CallingConv getDefaultCallingConv() const override
Gets the default calling convention for the given target.
Definition SPIR.h:211
bool hasFeature(StringRef Feature) const override
Determine whether the given target has the given feature.
Definition SPIR.h:321
virtual bool isAddressSpaceSupersetOf(LangAS A, LangAS B) const override
Returns true if an address space can be safely converted to another.
Definition SPIR.h:325
BaseSPIRVTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition SPIR.h:314
SPIR32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition SPIR.h:274
SPIR64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition SPIR.h:294
SPIRTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition SPIR.h:253
bool checkArithmeticFenceSupported() const override
Controls if __arithmetic_fence is supported in the targeted backend.
Definition SPIR.h:269
bool hasFeature(StringRef Feature) const override
Determine whether the given target has the given feature.
Definition SPIR.h:265
SPIRV32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition SPIR.h:377
bool hasInt128Type() const override
Determine whether the __int128 type is supported on this target.
Definition SPIR.h:498
void adjust(DiagnosticsEngine &Diags, LangOptions &Opts, const TargetInfo *Aux) override
Set forced language options.
Definition SPIR.h:491
BuiltinVaListKind getBuiltinVaListKind() const override
Returns the kind of __builtin_va_list type that should be used with this target.
Definition SPIR.h:471
SPIRV64AMDGCNTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition SPIR.h:445
SPIRV64IntelTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition SPIR.h:509
std::optional< LangAS > getConstantAddressSpace() const override
Return an AST address space which can be used opportunistically for constant global memory.
Definition SPIR.h:426
void adjust(DiagnosticsEngine &Diags, LangOptions &Opts, const TargetInfo *Aux) override
Set forced language options.
Definition SPIR.h:429
SPIRV64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition SPIR.h:401
const llvm::omp::GV & getGridValue() const override
Definition SPIR.h:422
bool validateTarget(DiagnosticsEngine &Diags) const override
Check the target is valid after it is fully initialized.
Definition SPIR.h:357
SPIRVTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition SPIR.h:342
Defines the clang::TargetInfo interface.
static const unsigned SPIRDefIsPrivMap[]
Definition SPIR.h:31
static const unsigned SPIRDefIsGenMap[]
Definition SPIR.h:65
std::unique_ptr< clang::TargetInfo > AllocateTarget(const llvm::Triple &Triple, const clang::TargetOptions &Opts)
Definition Targets.cpp:111
The JSON file list parser is used to communicate input to InstallAPI.
bool isTargetAddressSpace(LangAS AS)
unsigned toTargetAddressSpace(LangAS AS)
LangAS
Defines the address space values used by the address space qualifier of QualType.
CallingConv
CallingConv - Specifies the calling convention that a function uses.
Definition Specifiers.h:279
@ CC_DeviceKernel
Definition Specifiers.h:293
@ CC_SpirFunction
Definition Specifiers.h:292
unsigned UseZeroLengthBitfieldAlignment
Whether zero length bitfields (e.g., int : 0;) force alignment of the next bitfield.
Definition TargetInfo.h:188
unsigned UseExplicitBitFieldAlignment
Whether explicit bit field alignment attributes are honored.
Definition TargetInfo.h:197
unsigned ZeroLengthBitfieldBoundary
If non-zero, specifies a fixed alignment value for bitfields that follow zero length bitfield,...
Definition TargetInfo.h:201
unsigned UseBitFieldTypeAlignment
Control whether the alignment of bit-field types is respected when laying out structures.
Definition TargetInfo.h:179
const llvm::fltSemantics * BFloat16Format
Definition TargetInfo.h:143
unsigned char DefaultAlignForAttributeAligned
Definition TargetInfo.h:134