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