clang 23.0.0git
SPIR.h
Go to the documentation of this file.
1//===--- SPIR.h - Declare SPIR and SPIR-V target feature support *- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file declares SPIR and SPIR-V TargetInfo objects.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_CLANG_LIB_BASIC_TARGETS_SPIR_H
14#define LLVM_CLANG_LIB_BASIC_TARGETS_SPIR_H
15
16#include "Targets.h"
22#include "llvm/Support/Compiler.h"
23#include "llvm/Support/VersionTuple.h"
24#include "llvm/TargetParser/Triple.h"
25#include <optional>
26
27namespace clang {
28namespace targets {
29
30// Used by both the SPIR and SPIR-V targets.
31static const unsigned SPIRDefIsPrivMap[] = {
32 0, // Default
33 1, // opencl_global
34 3, // opencl_local
35 2, // opencl_constant
36 0, // opencl_private
37 4, // opencl_generic
38 5, // opencl_global_device
39 6, // opencl_global_host
40 0, // cuda_device
41 0, // cuda_constant
42 0, // cuda_shared
43 // SYCL address space values for this map are dummy
44 0, // sycl_global
45 0, // sycl_global_device
46 0, // sycl_global_host
47 0, // sycl_local
48 0, // sycl_private
49 0, // ptr32_sptr
50 0, // ptr32_uptr
51 0, // ptr64
52 3, // hlsl_groupshared
53 12, // hlsl_constant
54 10, // hlsl_private
55 11, // hlsl_device
56 7, // hlsl_input
57 8, // hlsl_output
58 13, // hlsl_push_constant
59 // Wasm address space values for this target are dummy values,
60 // as it is only enabled for Wasm targets.
61 20, // wasm_funcref
62};
63
64// Used by both the SPIR and SPIR-V targets.
65static const unsigned SPIRDefIsGenMap[] = {
66 4, // Default
67 1, // opencl_global
68 3, // opencl_local
69 2, // opencl_constant
70 0, // opencl_private
71 4, // opencl_generic
72 5, // opencl_global_device
73 6, // opencl_global_host
74 // cuda_* address space mapping is intended for HIPSPV (HIP to SPIR-V
75 // translation). This mapping is enabled when the language mode is HIP.
76 1, // cuda_device
77 // cuda_constant pointer can be casted to default/"flat" pointer, but in
78 // SPIR-V casts between constant and generic pointers are not allowed. For
79 // this reason cuda_constant is mapped to SPIR-V CrossWorkgroup.
80 1, // cuda_constant
81 3, // cuda_shared
82 1, // sycl_global
83 5, // sycl_global_device
84 6, // sycl_global_host
85 3, // sycl_local
86 0, // sycl_private
87 0, // ptr32_sptr
88 0, // ptr32_uptr
89 0, // ptr64
90 3, // hlsl_groupshared
91 0, // hlsl_constant
92 10, // hlsl_private
93 11, // hlsl_device
94 7, // hlsl_input
95 8, // hlsl_output
96 13, // hlsl_push_constant
97 // Wasm address space values for this target are dummy values,
98 // as it is only enabled for Wasm targets.
99 20, // wasm_funcref
100};
101
102// Base class for SPIR and SPIR-V target info.
103class LLVM_LIBRARY_VISIBILITY BaseSPIRTargetInfo : public TargetInfo {
104 std::unique_ptr<TargetInfo> HostTarget;
105
106protected:
107 BaseSPIRTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
108 : TargetInfo(Triple) {
109 assert((Triple.isSPIR() || Triple.isSPIRV()) &&
110 "Invalid architecture for SPIR or SPIR-V.");
111 TLSSupported = false;
112 VLASupported = false;
113 LongWidth = LongAlign = 64;
116 HasFastHalfType = true;
117 HasFloat16 = true;
118 HasBFloat16 = true;
119 HasFullBFloat16 = true;
121 BFloat16Format = &llvm::APFloat::BFloat();
122 // Define available target features
123 // These must be defined in sorted order!
124 NoAsmVariants = true;
125
126 llvm::Triple HostTriple(Opts.HostTriple);
127 if (!HostTriple.isSPIR() && !HostTriple.isSPIRV() &&
128 HostTriple.getArch() != llvm::Triple::UnknownArch) {
129 HostTarget = AllocateTarget(llvm::Triple(Opts.HostTriple), Opts);
130
131 // Copy properties from host target.
132 BoolWidth = HostTarget->getBoolWidth();
133 BoolAlign = HostTarget->getBoolAlign();
134 IntWidth = HostTarget->getIntWidth();
135 IntAlign = HostTarget->getIntAlign();
136 HalfWidth = HostTarget->getHalfWidth();
137 HalfAlign = HostTarget->getHalfAlign();
138 FloatWidth = HostTarget->getFloatWidth();
139 FloatAlign = HostTarget->getFloatAlign();
140 DoubleWidth = HostTarget->getDoubleWidth();
141 DoubleAlign = HostTarget->getDoubleAlign();
142 LongWidth = HostTarget->getLongWidth();
143 LongAlign = HostTarget->getLongAlign();
144 LongLongWidth = HostTarget->getLongLongWidth();
145 LongLongAlign = HostTarget->getLongLongAlign();
147 HostTarget->getMinGlobalAlign(/* TypeSize = */ 0,
148 /* HasNonWeakDef = */ true);
149 NewAlign = HostTarget->getNewAlign();
151 HostTarget->getDefaultAlignForAttributeAligned();
152 IntMaxType = HostTarget->getIntMaxType();
153 WCharType = HostTarget->getWCharType();
154 WIntType = HostTarget->getWIntType();
155 Char16Type = HostTarget->getChar16Type();
156 Char32Type = HostTarget->getChar32Type();
157 Int64Type = HostTarget->getInt64Type();
158 SigAtomicType = HostTarget->getSigAtomicType();
159 ProcessIDType = HostTarget->getProcessIDType();
160
161 UseBitFieldTypeAlignment = HostTarget->useBitFieldTypeAlignment();
163 HostTarget->useZeroLengthBitfieldAlignment();
164 UseExplicitBitFieldAlignment = HostTarget->useExplicitBitFieldAlignment();
165 ZeroLengthBitfieldBoundary = HostTarget->getZeroLengthBitfieldBoundary();
166
167 // This is a bit of a lie, but it controls __GCC_ATOMIC_XXX_LOCK_FREE, and
168 // we need those macros to be identical on host and device, because (among
169 // other things) they affect which standard library classes are defined,
170 // and we need all classes to be defined on both the host and device.
171 MaxAtomicInlineWidth = HostTarget->getMaxAtomicInlineWidth();
172 }
173 }
174
175public:
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, 64);
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.");
343
344 // SPIR-V IDs are represented with a single 32-bit word.
348 }
349
350 // SPIR-V targeting requires a fully specified Vulkan environment.
351 // SPIR-V requires the enviornment to be in a valid shader stage as well.
352 // Validate here before CreateTargetInfo() to emit a proper diagnostic.
353 bool validateTarget(DiagnosticsEngine &Diags) const override {
354 if (getTriple().getOS() != llvm::Triple::Vulkan ||
355 getTriple().getVulkanVersion() == llvm::VersionTuple(0)) {
356 Diags.Report(diag::err_target_spirv_requires_vulkan);
357 return false;
358 }
359 if (getTriple().getEnvironment() != llvm::Triple::UnknownEnvironment &&
360 (getTriple().getEnvironment() < llvm::Triple::Pixel ||
361 getTriple().getEnvironment() > llvm::Triple::Amplification)) {
362 Diags.Report(diag::err_target_spirv_invalid_shader_stage);
363 return false;
364 }
365 return true;
366 }
367
368 void getTargetDefines(const LangOptions &Opts,
369 MacroBuilder &Builder) const override;
370};
371
372class LLVM_LIBRARY_VISIBILITY SPIRV32TargetInfo : public BaseSPIRVTargetInfo {
373public:
374 SPIRV32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
375 : BaseSPIRVTargetInfo(Triple, Opts) {
376 assert(Triple.getArch() == llvm::Triple::spirv32 &&
377 "Invalid architecture for 32-bit SPIR-V.");
378 assert((getTriple().getOS() == llvm::Triple::UnknownOS ||
379 getTriple().getOS() == llvm::Triple::ChipStar ||
380 getTriple().getOS() == llvm::Triple::Vulkan) &&
381 "32-bit SPIR-V target must use unknown, chipstar, or vulkan OS");
382 assert(getTriple().getEnvironment() == llvm::Triple::UnknownEnvironment &&
383 "32-bit SPIR-V target must use unknown environment type");
387 // SPIR-V has core support for atomic ops, and Int32 is always available;
388 // we take the maximum because it's possible the Host supports wider types.
389 MaxAtomicInlineWidth = std::max<unsigned char>(MaxAtomicInlineWidth, 64);
391 }
392
393 void getTargetDefines(const LangOptions &Opts,
394 MacroBuilder &Builder) const override;
395};
396
397class LLVM_LIBRARY_VISIBILITY SPIRV64TargetInfo : public BaseSPIRVTargetInfo {
398public:
399 SPIRV64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
400 : BaseSPIRVTargetInfo(Triple, Opts) {
401 assert(Triple.getArch() == llvm::Triple::spirv64 &&
402 "Invalid architecture for 64-bit SPIR-V.");
403 assert((getTriple().getOS() == llvm::Triple::UnknownOS ||
404 getTriple().getOS() == llvm::Triple::ChipStar ||
405 getTriple().getOS() == llvm::Triple::Vulkan) &&
406 "64-bit SPIR-V target must use unknown, chipstar, or vulkan OS");
407 assert(getTriple().getEnvironment() == llvm::Triple::UnknownEnvironment &&
408 "64-bit SPIR-V target must use unknown environment type");
412 // SPIR-V has core support for atomic ops, and Int64 is always available;
413 // we take the maximum because it's possible the Host supports wider types.
414 MaxAtomicInlineWidth = std::max<unsigned char>(MaxAtomicInlineWidth, 64);
416 }
417
418 void getTargetDefines(const LangOptions &Opts,
419 MacroBuilder &Builder) const override;
420
421 const llvm::omp::GV &getGridValue() const override {
422 return llvm::omp::SPIRVGridValues;
423 }
424
425 std::optional<LangAS> getConstantAddressSpace() const override {
426 return ConstantAS;
427 }
429 const TargetInfo *Aux) override {
430 BaseSPIRVTargetInfo::adjust(Diags, Opts, Aux);
431 // opencl_constant will map to UniformConstant in SPIR-V
432 if (Opts.OpenCL)
433 ConstantAS = LangAS::opencl_constant;
434 }
435
436private:
437 // opencl_global will map to CrossWorkgroup in SPIR-V
438 LangAS ConstantAS = LangAS::opencl_global;
439};
440
441class LLVM_LIBRARY_VISIBILITY SPIRV64AMDGCNTargetInfo final
442 : public BaseSPIRVTargetInfo {
443public:
444 SPIRV64AMDGCNTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
445 : BaseSPIRVTargetInfo(Triple, Opts) {
446 assert(Triple.getArch() == llvm::Triple::spirv64 &&
447 "Invalid architecture for 64-bit AMDGCN SPIR-V.");
448 assert(Triple.getVendor() == llvm::Triple::VendorType::AMD &&
449 "64-bit AMDGCN SPIR-V target must use AMD vendor");
450 assert(getTriple().getOS() == llvm::Triple::OSType::AMDHSA &&
451 "64-bit AMDGCN SPIR-V target must use AMDHSA OS");
452 assert(getTriple().getEnvironment() == llvm::Triple::UnknownEnvironment &&
453 "64-bit SPIR-V target must use unknown environment type");
458
460
461 HasFastHalfType = true;
462 HasFloat16 = true;
463 HalfArgsAndReturns = true;
464
466 }
467
468 ArrayRef<const char *> getGCCRegNames() const override;
469
473
474 bool initFeatureMap(llvm::StringMap<bool> &Features, DiagnosticsEngine &Diags,
475 StringRef,
476 const std::vector<std::string> &) const override;
477
478 bool validateAsmConstraint(const char *&Name,
479 TargetInfo::ConstraintInfo &Info) const override;
480
481 std::string convertConstraint(const char *&Constraint) const override;
482
483 llvm::SmallVector<Builtin::InfosShard> getTargetBuiltins() const override;
484
485 void getTargetDefines(const LangOptions &Opts,
486 MacroBuilder &Builder) const override;
487
488 void setAuxTarget(const TargetInfo *Aux) override;
489
491 const TargetInfo *Aux) override {
492 TargetInfo::adjust(Diags, Opts, Aux);
493
495 }
496
497 bool hasInt128Type() const override { return TargetInfo::hasInt128Type(); }
498
499 // This is only needed for validating arguments passed to
500 // __builtin_amdgcn_processor_is
501 bool isValidCPUName(StringRef Name) const override;
502 void fillValidCPUList(SmallVectorImpl<StringRef> &Values) const override;
503};
504
505class LLVM_LIBRARY_VISIBILITY SPIRV64IntelTargetInfo final
506 : public SPIRV64TargetInfo {
507public:
508 SPIRV64IntelTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
509 : SPIRV64TargetInfo(Triple, Opts) {
510 assert(Triple.getVendor() == llvm::Triple::VendorType::Intel &&
511 "64-bit Intel SPIR-V target must use Intel vendor");
513 }
514};
515} // namespace targets
516} // namespace clang
517#endif // LLVM_CLANG_LIB_BASIC_TARGETS_SPIR_H
Provides definitions for the various language-specific address spaces.
Defines the Diagnostic-related interfaces.
static StringRef getTriple(const Command &Job)
Defines the clang::TargetOptions class.
Concrete class used by the front-end to report problems and issues.
Definition Diagnostic.h:234
DiagnosticBuilder Report(SourceLocation Loc, unsigned DiagID)
Issue the message to the client.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Exposes information about the current target.
Definition TargetInfo.h:227
TargetInfo(const llvm::Triple &T)
const llvm::Triple & getTriple() const
Returns the target triple of the primary target.
const LangASMap * AddrSpaceMap
Definition TargetInfo.h:260
BuiltinVaListKind
The different kinds of __builtin_va_list types defined by the target implementation.
Definition TargetInfo.h:337
@ CharPtrBuiltinVaList
typedef char* __builtin_va_list;
Definition TargetInfo.h:339
@ VoidPtrBuiltinVaList
typedef void* __builtin_va_list;
Definition TargetInfo.h:342
AtomicOptions AtomicOpts
Definition TargetInfo.h:316
virtual bool hasInt128Type() const
Determine whether the __int128 type is supported on this target.
Definition TargetInfo.h:682
virtual void adjust(DiagnosticsEngine &Diags, LangOptions &Opts, const TargetInfo *Aux)
Set forced language options.
unsigned char MaxAtomicPromoteWidth
Definition TargetInfo.h:253
void resetDataLayout(StringRef DL)
Set the data layout to the given string.
virtual void supportAllOpenCLOpts(bool V=true)
bool UseAddrSpaceMapMangling
Specify if mangling based on address space map should be used or not for language specific address sp...
Definition TargetInfo.h:389
unsigned char MaxAtomicInlineWidth
Definition TargetInfo.h:253
Options for controlling the target.
std::string HostTriple
When compiling for the device side, contains the triple used to compile for the host.
BuiltinVaListKind getBuiltinVaListKind() const override
Returns the kind of __builtin_va_list type that should be used with this target.
Definition SPIR.h: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
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:107
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:374
bool hasInt128Type() const override
Determine whether the __int128 type is supported on this target.
Definition SPIR.h:497
void adjust(DiagnosticsEngine &Diags, LangOptions &Opts, const TargetInfo *Aux) override
Set forced language options.
Definition SPIR.h:490
BuiltinVaListKind getBuiltinVaListKind() const override
Returns the kind of __builtin_va_list type that should be used with this target.
Definition SPIR.h:470
SPIRV64AMDGCNTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition SPIR.h:444
SPIRV64IntelTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition SPIR.h:508
std::optional< LangAS > getConstantAddressSpace() const override
Return an AST address space which can be used opportunistically for constant global memory.
Definition SPIR.h:425
void adjust(DiagnosticsEngine &Diags, LangOptions &Opts, const TargetInfo *Aux) override
Set forced language options.
Definition SPIR.h:428
SPIRV64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition SPIR.h:399
const llvm::omp::GV & getGridValue() const override
Definition SPIR.h:421
bool validateTarget(DiagnosticsEngine &Diags) const override
Check the target is valid after it is fully initialized.
Definition SPIR.h:353
SPIRVTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition SPIR.h:338
Defines the clang::TargetInfo interface.
static const unsigned SPIRDefIsPrivMap[]
Definition SPIR.h:31
static const unsigned SPIRDefIsGenMap[]
Definition SPIR.h:65
std::unique_ptr< clang::TargetInfo > AllocateTarget(const llvm::Triple &Triple, const clang::TargetOptions &Opts)
Definition Targets.cpp:111
The JSON file list parser is used to communicate input to InstallAPI.
bool isTargetAddressSpace(LangAS AS)
unsigned toTargetAddressSpace(LangAS AS)
LangAS
Defines the address space values used by the address space qualifier of QualType.
CallingConv
CallingConv - Specifies the calling convention that a function uses.
Definition Specifiers.h:279
@ CC_DeviceKernel
Definition Specifiers.h:293
@ CC_SpirFunction
Definition Specifiers.h:292
unsigned UseZeroLengthBitfieldAlignment
Whether zero length bitfields (e.g., int : 0;) force alignment of the next bitfield.
Definition TargetInfo.h:188
unsigned UseExplicitBitFieldAlignment
Whether explicit bit field alignment attributes are honored.
Definition TargetInfo.h:197
unsigned ZeroLengthBitfieldBoundary
If non-zero, specifies a fixed alignment value for bitfields that follow zero length bitfield,...
Definition TargetInfo.h:201
unsigned UseBitFieldTypeAlignment
Control whether the alignment of bit-field types is respected when laying out structures.
Definition TargetInfo.h:179
const llvm::fltSemantics * BFloat16Format
Definition TargetInfo.h:143
unsigned char DefaultAlignForAttributeAligned
Definition TargetInfo.h:134