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