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"
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.
324 return A == B || ((A == LangAS::Default ||
326 toTargetAddressSpace(A) == /*Generic=*/4)) &&
328 toTargetAddressSpace(B) <= /*Generic=*/4);
329 }
330
331 void getTargetDefines(const LangOptions &Opts,
332 MacroBuilder &Builder) const override;
333};
334
335class LLVM_LIBRARY_VISIBILITY SPIRVTargetInfo : public BaseSPIRVTargetInfo {
336public:
337 SPIRVTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
338 : BaseSPIRVTargetInfo(Triple, Opts) {
339 assert(Triple.getArch() == llvm::Triple::spirv &&
340 "Invalid architecture for Logical SPIR-V.");
341 assert(Triple.getOS() == llvm::Triple::Vulkan &&
342 Triple.getVulkanVersion() != llvm::VersionTuple(0) &&
343 "Logical SPIR-V requires a valid Vulkan environment.");
344 assert(Triple.getEnvironment() >= llvm::Triple::Pixel &&
345 Triple.getEnvironment() <= llvm::Triple::Amplification &&
346 "Logical SPIR-V environment must be a valid shader stage.");
348
349 // SPIR-V IDs are represented with a single 32-bit word.
352 }
353
354 void getTargetDefines(const LangOptions &Opts,
355 MacroBuilder &Builder) const override;
356};
357
358class LLVM_LIBRARY_VISIBILITY SPIRV32TargetInfo : public BaseSPIRVTargetInfo {
359public:
360 SPIRV32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
361 : BaseSPIRVTargetInfo(Triple, Opts) {
362 assert(Triple.getArch() == llvm::Triple::spirv32 &&
363 "Invalid architecture for 32-bit SPIR-V.");
364 assert(getTriple().getOS() == llvm::Triple::UnknownOS &&
365 "32-bit SPIR-V target must use unknown OS");
366 assert(getTriple().getEnvironment() == llvm::Triple::UnknownEnvironment &&
367 "32-bit SPIR-V target must use unknown environment type");
371 // SPIR-V has core support for atomic ops, and Int32 is always available;
372 // we take the maximum because it's possible the Host supports wider types.
373 MaxAtomicInlineWidth = std::max<unsigned char>(MaxAtomicInlineWidth, 32);
375 }
376
377 void getTargetDefines(const LangOptions &Opts,
378 MacroBuilder &Builder) const override;
379};
380
381class LLVM_LIBRARY_VISIBILITY SPIRV64TargetInfo : public BaseSPIRVTargetInfo {
382public:
383 SPIRV64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
384 : BaseSPIRVTargetInfo(Triple, Opts) {
385 assert(Triple.getArch() == llvm::Triple::spirv64 &&
386 "Invalid architecture for 64-bit SPIR-V.");
387 assert(getTriple().getOS() == llvm::Triple::UnknownOS &&
388 "64-bit SPIR-V target must use unknown OS");
389 assert(getTriple().getEnvironment() == llvm::Triple::UnknownEnvironment &&
390 "64-bit SPIR-V target must use unknown environment type");
394 // SPIR-V has core support for atomic ops, and Int64 is always available;
395 // we take the maximum because it's possible the Host supports wider types.
396 MaxAtomicInlineWidth = std::max<unsigned char>(MaxAtomicInlineWidth, 64);
398 }
399
400 void getTargetDefines(const LangOptions &Opts,
401 MacroBuilder &Builder) const override;
402
403 const llvm::omp::GV &getGridValue() const override {
404 return llvm::omp::SPIRVGridValues;
405 }
406
407 std::optional<LangAS> getConstantAddressSpace() const override {
408 return ConstantAS;
409 }
411 const TargetInfo *Aux) override {
412 BaseSPIRVTargetInfo::adjust(Diags, Opts, Aux);
413 // opencl_constant will map to UniformConstant in SPIR-V
414 if (Opts.OpenCL)
415 ConstantAS = LangAS::opencl_constant;
416 }
417
418private:
419 // opencl_global will map to CrossWorkgroup in SPIR-V
420 LangAS ConstantAS = LangAS::opencl_global;
421};
422
423class LLVM_LIBRARY_VISIBILITY SPIRV64AMDGCNTargetInfo final
424 : public BaseSPIRVTargetInfo {
425public:
426 SPIRV64AMDGCNTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
427 : BaseSPIRVTargetInfo(Triple, Opts) {
428 assert(Triple.getArch() == llvm::Triple::spirv64 &&
429 "Invalid architecture for 64-bit AMDGCN SPIR-V.");
430 assert(Triple.getVendor() == llvm::Triple::VendorType::AMD &&
431 "64-bit AMDGCN SPIR-V target must use AMD vendor");
432 assert(getTriple().getOS() == llvm::Triple::OSType::AMDHSA &&
433 "64-bit AMDGCN SPIR-V target must use AMDHSA OS");
434 assert(getTriple().getEnvironment() == llvm::Triple::UnknownEnvironment &&
435 "64-bit SPIR-V target must use unknown environment type");
440
442
443 HasFastHalfType = true;
444 HasFloat16 = true;
445 HalfArgsAndReturns = true;
446
448 }
449
450 ArrayRef<const char *> getGCCRegNames() const override;
451
455
456 bool initFeatureMap(llvm::StringMap<bool> &Features, DiagnosticsEngine &Diags,
457 StringRef,
458 const std::vector<std::string> &) const override;
459
460 bool validateAsmConstraint(const char *&Name,
461 TargetInfo::ConstraintInfo &Info) const override;
462
463 std::string convertConstraint(const char *&Constraint) const override;
464
465 llvm::SmallVector<Builtin::InfosShard> getTargetBuiltins() const override;
466
467 void getTargetDefines(const LangOptions &Opts,
468 MacroBuilder &Builder) const override;
469
470 void setAuxTarget(const TargetInfo *Aux) override;
471
473 const TargetInfo *Aux) override {
474 TargetInfo::adjust(Diags, Opts, Aux);
475 }
476
477 bool hasInt128Type() const override { return TargetInfo::hasInt128Type(); }
478};
479
480class LLVM_LIBRARY_VISIBILITY SPIRV64IntelTargetInfo final
481 : public SPIRV64TargetInfo {
482public:
483 SPIRV64IntelTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
484 : SPIRV64TargetInfo(Triple, Opts) {
485 assert(Triple.getVendor() == llvm::Triple::VendorType::Intel &&
486 "64-bit Intel SPIR-V target must use Intel vendor");
488 }
489};
490} // namespace targets
491} // namespace clang
492#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 llvm intrinsics such as llvm.convert.to.fp16 should be used to convert to and from __fp...
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:360
bool hasInt128Type() const override
Determine whether the __int128 type is supported on this target.
Definition SPIR.h:477
void adjust(DiagnosticsEngine &Diags, LangOptions &Opts, const TargetInfo *Aux) override
Set forced language options.
Definition SPIR.h:472
BuiltinVaListKind getBuiltinVaListKind() const override
Returns the kind of __builtin_va_list type that should be used with this target.
Definition SPIR.h:452
SPIRV64AMDGCNTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition SPIR.h:426
SPIRV64IntelTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition SPIR.h:483
std::optional< LangAS > getConstantAddressSpace() const override
Return an AST address space which can be used opportunistically for constant global memory.
Definition SPIR.h:407
void adjust(DiagnosticsEngine &Diags, LangOptions &Opts, const TargetInfo *Aux) override
Set forced language options.
Definition SPIR.h:410
SPIRV64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition SPIR.h:383
const llvm::omp::GV & getGridValue() const override
Definition SPIR.h:403
SPIRVTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition SPIR.h:337
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