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