Go to the documentation of this file.
14 #ifndef LLVM_CLANG_BASIC_TARGETINFO_H
15 #define LLVM_CLANG_BASIC_TARGETINFO_H
25 #include "llvm/ADT/APFloat.h"
26 #include "llvm/ADT/APInt.h"
27 #include "llvm/ADT/ArrayRef.h"
28 #include "llvm/ADT/IntrusiveRefCntPtr.h"
29 #include "llvm/ADT/SmallSet.h"
30 #include "llvm/ADT/StringMap.h"
31 #include "llvm/ADT/StringRef.h"
32 #include "llvm/ADT/Triple.h"
33 #include "llvm/Frontend/OpenMP/OMPGridValues.h"
34 #include "llvm/IR/DerivedTypes.h"
35 #include "llvm/Support/DataTypes.h"
36 #include "llvm/Support/Error.h"
37 #include "llvm/Support/VersionTuple.h"
48 class DiagnosticsEngine;
61 return Duplicate == Other.Duplicate &&
CPU == Other.CPU &&
67 namespace Builtin {
struct Info; }
77 LLVM_MARK_AS_BITMASK_ENUM(
Ibm128)
207 std::shared_ptr<TargetOptions> TargetOpts;
275 const std::shared_ptr<TargetOptions> &Opts);
281 assert(TargetOpts &&
"Missing target options");
351 llvm_unreachable(
"Invalid SizeType");
397 llvm_unreachable(
"Unexpected signed integer type");
419 bool IsSigned)
const;
627 return std::min<size_t>(*
MaxBitIntWidth, llvm::IntegerType::MAX_INT_BITS);
755 llvm_unreachable(
"ibm128 not implemented on this target");
760 llvm_unreachable(
"bfloat not implemented on this target");
765 return LangOptions::FPEvalMethodKind::FEM_Source;
788 return AtomicSizeInBits <= AlignmentInBits &&
791 llvm::isPowerOf2_64(AtomicSizeInBits /
getCharWidth()));
950 virtual std::optional<std::pair<unsigned, unsigned>>
1006 bool ReturnCanonical =
false)
const;
1095 for (
int Exact : Exacts)
1126 bool &HasSizeMismatch)
const {
1127 HasSizeMismatch =
false;
1136 ConstraintInfo &info)
const;
1162 unsigned &Index)
const;
1169 if (*Constraint ==
'p')
1177 return std::nullopt;
1196 return std::nullopt;
1229 return getTriple().isWindowsMSVCEnvironment() ||
1238 (
getTriple().isWindowsItaniumEnvironment() &&
1239 getTriple().getVendor() == llvm::Triple::SCEI);
1259 const std::vector<std::string> &FeatureVec)
const;
1262 virtual StringRef
getABI()
const {
return StringRef(); }
1318 StringRef Name)
const {
1319 return Features.lookup(Name);
1326 bool Enabled)
const {
1327 Features[Name] = Enabled;
1360 StringRef &Err)
const {
1424 "cpu_specific Multiversioning not implemented on this target");
1431 "cpu_specific Multiversioning not implemented on this target");
1440 "cpu_specific Multiversioning not implemented on this target");
1446 return std::nullopt;
1451 assert(
RegParmMax < 7 &&
"RegParmMax value is larger than AST can handle");
1473 getTriple().getArch() == llvm::Triple::aarch64);
1529 llvm_unreachable(
"getGridValue not implemented on this target");
1618 #define OPENCLEXTNAME(Ext) \
1619 setFeatureEnabled(getTargetOpts().OpenCLFeaturesMap, #Ext, V);
1620 #include "clang/Basic/OpenCLExtensions.def"
1625 for (
const auto &Ext :
getTargetOpts().OpenCLExtensionsAsWritten) {
1626 bool IsPrefixed = (Ext[0] ==
'+' || Ext[0] ==
'-');
1627 std::string Name = IsPrefixed ? Ext.substr(1) : Ext;
1628 bool V = IsPrefixed ? Ext[0] ==
'+' :
true;
1630 if (Name ==
"all") {
1665 return std::nullopt;
1700 : std::optional<VersionTuple>();
1718 return std::nullopt;
1724 void CheckFixedPointBits()
const;
unsigned char PointerAlign
std::string DataLayoutString
virtual bool isNan2008() const
Returns true if NaN encoding is IEEE 754-2008.
bool isRenderScriptTarget() const
Returns true for RenderScript.
SignReturnAddressScopeKind
@ PNaClABIBuiltinVaList
__builtin_va_list as defined by the PNaCl ABI: http://www.chromium.org/nativeclient/pnacl/bitcode-abi...
const char * getDataLayoutString() const
bool allowsMemory() const
LangOptions::SignReturnAddressKeyKind SignKey
bool isTargetAddressSpace(LangAS AS)
virtual bool allowHalfArgsAndReturns() const
Whether half args and returns are supported.
unsigned getShortFractWidth() const
getShortFractWidth/Align - Return the size of 'signed short _Fract' and 'unsigned short _Fract' for t...
virtual unsigned getVtblPtrAddressSpace() const
unsigned char LargeArrayAlign
unsigned getMaxVectorAlign() const
Return the maximum vector alignment supported for the given target.
const char *const Register
IntType getProcessIDType() const
__DEVICE__ int max(int __a, int __b)
unsigned getWCharAlign() const
const llvm::fltSemantics & getLongDoubleFormat() const
YAML serialization mapping.
virtual bool isCLZForZeroUndef() const
The __builtin_clz* and __builtin_ctz* built-in functions are specified to have undefined results for ...
VersionTuple PlatformMinVersion
unsigned char ShortFractAlign
virtual const char * getClobbers() const =0
Returns a string of target-specific clobbers, in LLVM format.
unsigned getRegParmMax() const
virtual bool isValidGCCRegisterName(StringRef Name) const
Returns whether the passed in string is a valid register name according to GCC.
const std::string & getName() const
virtual bool supportsExtendIntArgs() const
Whether the option -fextend-arguments={32,64} is supported on the target.
unsigned getAccumIBits() const
unsigned getLongAccumIBits() const
virtual BuiltinVaListKind getBuiltinVaListKind() const =0
Returns the kind of __builtin_va_list type that should be used with this target.
const char * getTypeConstantSuffix(IntType T) const
Return the constant suffix for the specified integer type enum.
virtual CallingConvCheckResult checkCallingConvention(CallingConv CC) const
Determines whether a given calling convention is valid for the target.
unsigned UseExplicitBitFieldAlignment
Whether explicit bit field alignment attributes are honored.
const llvm::fltSemantics & getDoubleFormat() const
virtual bool validateConstraintModifier(StringRef, char, unsigned, std::string &) const
virtual void fillValidCPUList(SmallVectorImpl< StringRef > &Values) const
Fill a SmallVectorImpl with the valid values to setCPU.
@ X86_64ABIBuiltinVaList
__builtin_va_list as defined by the x86-64 ABI: http://refspecs.linuxbase.org/elf/x86_64-abi-0....
unsigned getLongWidth() const
getLongWidth/Align - Return the size of 'signed long' and 'unsigned long' for this target,...
unsigned getIbm128Align() const
unsigned getSuitableAlign() const
Return the alignment that is the largest alignment ever used for any scalar/SIMD data type on the tar...
virtual ParsedTargetAttr parseTargetAttr(StringRef Str) const
unsigned char LongLongAlign
unsigned getNewAlign() const
Return the largest alignment for which a suitably-sized allocation with '::operator new(size_t)' is g...
unsigned getUnsignedLongAccumScale() const
getUnsignedLongAccumScale/IBits - Return the number of fractional/integral bits in a 'unsigned long _...
unsigned char DoubleAlign
const char * getUserLabelPrefix() const
Returns the default value of the USER_LABEL_PREFIX macro, which is the prefix given to user symbols b...
virtual unsigned getExnObjectAlignment() const
Return the alignment (in bits) of the thrown exception object.
unsigned char LongAccumScale
unsigned HasAlignMac68kSupport
unsigned getUnsignedShortAccumIBits() const
bool useAddressSpaceMapMangling() const
Specify if mangling based on address space map should be used or not for language specific address sp...
virtual bool hasProtectedVisibility() const
Does this target support "protected" visibility?
unsigned MaxAlignedAttribute
If non-zero, specifies a maximum alignment to truncate alignment specified in the aligned attribute o...
Contains information gathered from parsing the contents of TargetAttr.
virtual bool checkCFProtectionReturnSupported(DiagnosticsEngine &Diags) const
Check if the target supports CFProtection return.
bool useLeadingZeroLengthBitfield() const
Check whether zero length bitfield alignment is respected if they are leading members.
std::optional< llvm::Triple > DarwinTargetVariantTriple
virtual bool hasLongDoubleType() const
Determine whether the long double type is supported on this target.
unsigned getHalfWidth() const
getHalfWidth/Align/Format - Return the size/align/format of 'half'.
unsigned getDefaultAlignForAttributeAligned() const
Return the default alignment for attribute((aligned)) on this target, to be used if no alignment valu...
unsigned getLongDoubleAlign() const
static bool isTypeSigned(IntType T)
Returns true if the type is signed; false otherwise.
virtual StringRef getABI() const
Get the ABI currently in use.
unsigned UseZeroLengthBitfieldAlignment
Whether zero length bitfields (e.g., int : 0;) force alignment of the next bitfield.
virtual const char * getBFloat16Mangling() const
Return the mangled code of bfloat.
uint64_t getPointerAlign(LangAS AddrSpace) const
StringRef BranchProtection
Concrete class used by the front-end to report problems and issues.
TargetCXXABI getCXXABI() const
Get the C++ ABI currently in use.
const llvm::VersionTuple & getSDKVersion() const
Exposes information about the current target.
bool useObjCFP2RetForComplexLongDouble() const
Check whether _Complex long double should use the "fp2ret" flavor of Objective-C message passing on t...
unsigned getFloatAlign() const
unsigned char DefaultAlignForAttributeAligned
virtual bool setCPU(const std::string &Name)
Target the specified CPU.
virtual CallingConvKind getCallingConvKind(bool ClangABICompat4) const
@ VoidPtrBuiltinVaList
typedef void* __builtin_va_list;
virtual bool hasFloat16Type() const
Determine whether the _Float16 type is supported on this target.
const char *const Names[5]
bool useBitFieldTypeAlignment() const
Check whether the alignment of bit-field types is respected when laying out structures.
unsigned char BFloat16Width
virtual void adjust(DiagnosticsEngine &Diags, LangOptions &Opts)
Set forced language options.
virtual bool getFeatureDepOptions(StringRef Feature, std::string &Options) const
Returns true if feature has an impact on target code generation and get its dependent options in seco...
@ None
No signing for any function.
unsigned getBoolWidth() const
Return the size of '_Bool' and C++ 'bool' for this target, in bits.
unsigned getFractScale() const
getFractScale - Return the number of fractional bits in a 'signed _Fract' type.
unsigned getLongAccumWidth() const
getLongAccumWidth/Align - Return the size of 'signed long _Accum' and 'unsigned long _Accum' for this...
unsigned getCharWidth() const
virtual bool hasFeature(StringRef Feature) const
Determine whether the given target has the given feature.
virtual bool validateAsmConstraint(const char *&Name, TargetInfo::ConstraintInfo &info) const =0
unsigned IsRenderScriptTarget
uint32_t getARMCDECoprocMask() const
For ARM targets returns a mask defining which coprocessors are configured as Custom Datapath.
virtual std::optional< LangAS > getConstantAddressSpace() const
Return an AST address space which can be used opportunistically for constant global memory.
virtual bool validateCpuSupports(StringRef Name) const
unsigned getUnsignedShortAccumScale() const
getUnsignedShortAccumScale/IBits - Return the number of fractional/integral bits in a 'unsigned short...
unsigned getLongLongWidth() const
getLongLongWidth/Align - Return the size of 'signed long long' and 'unsigned long long' for this targ...
virtual LangAS getOpenCLBuiltinAddressSpace(unsigned AS) const
Map from the address space field in builtin description strings to the language address space.
const char *const Aliases[5]
unsigned char Float128Align
unsigned getLongAlign() const
bool UseAddrSpaceMapMangling
Specify if mangling based on address space map should be used or not for language specific address sp...
unsigned char ShortFractWidth
unsigned getMaxOpenCLWorkGroupSize() const
virtual void setSupportedOpenCLOpts()
Set supported OpenCL extensions and optional core features.
unsigned AllowAMDGPUUnsafeFPAtomics
BuiltinVaListKind
The different kinds of __builtin_va_list types defined by the target implementation.
unsigned getShortAccumWidth() const
getShortAccumWidth/Align - Return the size of 'signed short _Accum' and 'unsigned short _Accum' for t...
virtual bool hasInt128Type() const
Determine whether the __int128 type is supported on this target.
unsigned char LongAccumAlign
unsigned char MaxAtomicPromoteWidth
bool allowAMDGPUUnsafeFPAtomics() const
Returns whether or not the AMDGPU unsafe floating point atomics are allowed.
const llvm::fltSemantics * FloatFormat
const llvm::fltSemantics * BFloat16Format
IntType getUInt64Type() const
@ AKey
Return address signing uses APIA key.
unsigned ARMCDECoprocMask
virtual bool checkCFProtectionBranchSupported(DiagnosticsEngine &Diags) const
Check if the target supports CFProtection branch.
virtual StringRef getConstraintRegister(StringRef Constraint, StringRef Expression) const
Extracts a register from the passed constraint (if it is a single-register constraint) and the asm la...
unsigned getMaxAtomicInlineWidth() const
Return the maximum width lock-free atomic operation which can be inlined given the supported features...
unsigned getLongDoubleWidth() const
getLongDoubleWidth/Align/Format - Return the size/align/format of 'long double'.
unsigned getShortAlign() const
Return the alignment of 'signed short' and 'unsigned short' for this target.
unsigned HasAArch64SVETypes
unsigned getFractAlign() const
llvm::StringMap< bool > & getSupportedOpenCLOpts()
Get supported OpenCL extensions and optional core features.
void setHasMatchingInput()
bool useSignedCharForObjCBool() const
Check if the Objective-C built-in boolean type should be signed char.
virtual bool hasBitIntType() const
Determine whether the _BitInt type is supported on this target.
bool useObjCFPRetForRealType(FloatModeKind T) const
Check whether the given real type should use the "fpret" flavor of Objective-C message passing on thi...
virtual const char * getLongDoubleMangling() const
Return the mangled code of long double.
IntType getSignedSizeType() const
unsigned getTypeAlign(IntType T) const
Return the alignment (in bits) of the specified integer type enum.
unsigned getLongLongAlign() const
virtual unsigned getRegisterWidth() const
Return the "preferred" register width on this target.
bool useZeroLengthBitfieldAlignment() const
Check whether zero length bitfields should force alignment of the next member.
IntType getIntPtrType() const
virtual char CPUSpecificManglingCharacter(StringRef Name) const
virtual CallingConv getDefaultCallingConv() const
Gets the default calling convention for the given target and declaration context.
virtual bool allowsLargerPreferedTypeAlignment() const
Whether target allows to overalign ABI-specified preferred alignment.
unsigned getTargetAddressSpace(LangAS AS) const
unsigned getFloatWidth() const
getFloatWidth/Align/Format - Return the size/align/format of 'float'.
unsigned char ShortAccumAlign
unsigned char LongFractWidth
const llvm::fltSemantics * Float128Format
bool isLittleEndian() const
unsigned[(unsigned) LangAS::FirstTargetAddressSpace] LangASMap
The type of a lookup table which maps from language-specific address spaces to target-specific ones.
unsigned getLongFractScale() const
getLongFractScale - Return the number of fractional bits in a 'signed long _Fract' type.
unsigned getChar32Align() const
unsigned getAccumScale() const
getAccumScale/IBits - Return the number of fractional/integral bits in a 'signed _Accum' type.
FloatModeKind getRealTypeByWidth(unsigned BitWidth, FloatModeKind ExplicitType) const
Return floating point type with specified width.
void setRequiresImmediate(int Min, int Max)
unsigned char LongFractAlign
unsigned toTargetAddressSpace(LangAS AS)
StringRef getNormalizedGCCRegisterName(StringRef Name, bool ReturnCanonical=false) const
Returns the "normalized" GCC register name.
TargetInfo(const llvm::Triple &T)
virtual uint64_t getPointerWidthV(LangAS AddrSpace) const
IntType getChar32Type() const
unsigned getUnsignedAccumIBits() const
const std::optional< VersionTuple > getDarwinTargetVariantSDKVersion() const
Returns the version of the darwin target variant SDK which was used during the compilation if one was...
uint64_t getPointerWidth(LangAS AddrSpace) const
Return the width of pointers on this target, for the specified address space.
virtual std::optional< std::string > getTargetID() const
Returns the target ID if supported.
unsigned char LongLongWidth
unsigned getFloat128Align() const
const char * getMCountName() const
Returns the name of the mcount instrumentation function.
void noSignedCharForObjCBool()
unsigned getUnsignedAccumScale() const
getUnsignedAccumScale/IBits - Return the number of fractional/integral bits in a 'unsigned _Accum' ty...
FPEvalMethodKind
Possible float expression evaluation method choices.
virtual bool initFeatureMap(llvm::StringMap< bool > &Features, DiagnosticsEngine &Diags, StringRef CPU, const std::vector< std::string > &FeatureVec) const
Initialize the map with the default set of target features for the CPU this should include all legal ...
unsigned getMaxTLSAlign() const
Return the maximum alignment (in bits) of a TLS variable.
bool operator==(const ParsedTargetAttr &Other) const
virtual bool isValidCPUName(StringRef Name) const
brief Determine whether this TargetInfo supports the given CPU name.
unsigned UseLeadingZeroLengthBitfield
Whether zero length bitfield alignment is respected if they are the leading members.
virtual bool hasFloat128Type() const
Determine whether the __float128 type is supported on this target.
unsigned char Ibm128Align
virtual uint64_t getMaxPointerWidth() const
Return the maximum width of pointers on this target.
VersionTuple getPlatformMinVersion() const
Retrieve the minimum desired version of the platform, to which the program should be compiled.
unsigned getWCharWidth() const
getWCharWidth/Align - Return the size of 'wchar_t' for this target, in bits.
unsigned getLongAccumAlign() const
unsigned getMaxAlignedAttribute() const
Get the maximum alignment in bits for a static variable with aligned attribute.
virtual ArrayRef< GCCRegAlias > getGCCRegAliases() const =0
virtual bool validateCpuIs(StringRef Name) const
virtual ArrayRef< Builtin::Info > getTargetBuiltins() const =0
Return information about target-specific builtins for the current primary target, and info about whic...
LangAS getLangASFromTargetAS(unsigned TargetAS)
virtual const char * getIbm128Mangling() const
Return the mangled code of __ibm128.
const llvm::fltSemantics & getFloatFormat() const
CallingConv
CallingConv - Specifies the calling convention that a function uses.
unsigned RealTypeUsesObjCFPRetMask
virtual bool setFPMath(StringRef Name)
Use the specified unit for FP math.
virtual uint64_t getNullPointerValue(LangAS AddrSpace) const
Get integer value for null pointer.
virtual bool isValidTuneCPUName(StringRef Name) const
brief Determine whether this TargetInfo supports the given CPU name for
void resetDataLayout(StringRef DL, const char *UserLabelPrefix="")
const llvm::fltSemantics & getFloat128Format() const
bool isTLSSupported() const
Whether the target supports thread-local storage.
virtual bool supportsTargetAttributeTune() const
brief Determine whether this TargetInfo supports tune in target attribute.
virtual LangAS getCUDABuiltinAddressSpace(unsigned AS) const
Map from the address space field in builtin description strings to the language address space.
static TargetInfo * CreateTargetInfo(DiagnosticsEngine &Diags, const std::shared_ptr< TargetOptions > &Opts)
Construct a target for the given options.
const llvm::fltSemantics & getHalfFormat() const
virtual unsigned getUnwindWordWidth() const
virtual IntType getLeastIntTypeByWidth(unsigned BitWidth, bool IsSigned) const
Return the smallest integer type with at least the specified width.
virtual bool validateCPUSpecificCPUDispatch(StringRef Name) const
unsigned getDoubleWidth() const
getDoubleWidth/Align/Format - Return the size/align/format of 'double'.
const std::string & getConstraintStr() const
unsigned char ShortAccumWidth
IntType getUnsignedPtrDiffType(LangAS AddrSpace) const
CodeGenOptions - Track various options which control how the code is optimized and passed to the back...
virtual size_t getMaxBitIntWidth() const
virtual bool validateOutputSize(const llvm::StringMap< bool > &FeatureMap, StringRef, unsigned) const
virtual LangAS getOpenCLTypeAddrSpace(OpenCLTypeKind TK) const
Get address space for OpenCL type.
const llvm::Triple * getDarwinTargetVariantTriple() const
Returns the darwin target variant triple, the variant of the deployment target for which the code is ...
@ AAPCSABIBuiltinVaList
__builtin_va_list as defined by ARM AAPCS ABI http://infocenter.arm.com
unsigned getLongAccumScale() const
getLongAccumScale/IBits - Return the number of fractional/integral bits in a 'signed long _Accum' typ...
unsigned char BFloat16Align
unsigned getAccumWidth() const
getAccumWidth/Align - Return the size of 'signed _Accum' and 'unsigned _Accum' for this target,...
virtual bool validateBranchProtection(StringRef Spec, StringRef Arch, BranchProtectionInfo &BPI, StringRef &Err) const
Determine if this TargetInfo supports the given branch protection specification.
const llvm::fltSemantics * Ibm128Format
bool BranchTargetEnforcement
std::string ConstraintStr
bool isVLASupported() const
Whether target supports variable-length arrays.
unsigned getLongFractWidth() const
getLongFractWidth/Align - Return the size of 'signed long _Fract' and 'unsigned long _Fract' for this...
LangAS
Defines the address space values used by the address space qualifier of QualType.
virtual bool defaultsToAIXPowerAlignment() const
Whether target defaults to the power alignment rules of AIX.
virtual bool hasIbm128Type() const
Determine whether the __ibm128 type is supported on this target.
unsigned getInt128Align() const
getInt128Align() - Returns the alignment of Int128.
const llvm::Triple & getTriple() const
Returns the target triple of the primary target.
virtual bool areDefaultedSMFStillPOD(const LangOptions &) const
Controls whether explicitly defaulted (= default) special member functions disqualify something from ...
IntType getSizeType() const
struct clang::TargetInfo::ConstraintInfo::@178 ImmRange
IntType getUInt16Type() const
virtual void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const =0
===-— Other target property query methods -----------------------—===//
bool allowsRegister() const
IntType getInt16Type() const
unsigned getBoolAlign() const
Return the alignment of '_Bool' and C++ 'bool' for this target.
const char * UserLabelPrefix
bool hasAlignMac68kSupport() const
Check whether this target support '#pragma options align=mac68k'.
IntType getUIntPtrType() const
unsigned getBFloat16Width() const
getBFloat16Width/Align/Format - Return the size/align/format of '__bf16'.
virtual void setFeatureEnabled(llvm::StringMap< bool > &Features, StringRef Name, bool Enabled) const
Enable or disable a specific target feature; the feature name must be valid.
TargetOptions & getTargetOpts() const
Retrieve the target options.
bool ForceEnableInt128
If given, enables support for __int128_t and __uint128_t types.
void setRequiresImmediate(llvm::ArrayRef< int > Exacts)
static const char * getTypeName(IntType T)
Return the user string for the specified integer type enum.
std::optional< unsigned > MaxBitIntWidth
bool validateInputConstraint(MutableArrayRef< ConstraintInfo > OutputConstraints, ConstraintInfo &info) const
virtual unsigned multiVersionFeatureCost() const
unsigned getUnsignedFractScale() const
getUnsignedFractScale - Return the number of fractional bits in a 'unsigned _Fract' type.
virtual bool hasBuiltinAtomic(uint64_t AtomicSizeInBits, uint64_t AlignmentInBits) const
Returns true if the given target supports lock-free atomic operations at the specified width and alig...
virtual bool validateTarget(DiagnosticsEngine &Diags) const
Check the target is valid after it is fully initialized.
bool hasMatchingInput() const
Return true if this output operand has a matching (tied) input operand.
unsigned getIntMaxTWidth() const
Return the size of intmax_t and uintmax_t for this target, in bits.
bool isValidClobber(StringRef Name) const
Returns whether the passed in string is a valid clobber in an inline asm statement.
virtual std::optional< unsigned > getCPUCacheLineSize() const
unsigned char DoubleWidth
unsigned getChar32Width() const
getChar32Width/Align - Return the size of 'char32_t' for this target, in bits.
const LangASMap * AddrSpaceMap
unsigned getShortAccumScale() const
getShortAccumScale/IBits - Return the number of fractional/integral bits in a 'signed short _Accum' t...
unsigned getShortAccumAlign() const
IntType getWIntType() const
bool hasTiedOperand() const
Return true if this input operand is a matching constraint that ties it to an output operand.
virtual void adjustTargetOptions(const CodeGenOptions &CGOpts, TargetOptions &TargetOpts) const
Adjust target options based on codegen options.
const llvm::fltSemantics * LongDoubleFormat
virtual const char * getFloat128Mangling() const
Return the mangled code of __float128.
virtual std::optional< std::string > handleAsmEscapedChar(char C) const
Replace some escaped characters with another string based on target-specific rules.
unsigned getChar16Width() const
getChar16Width/Align - Return the size of 'char16_t' for this target, in bits.
@ CharPtrBuiltinVaList
typedef char* __builtin_va_list;
virtual void getCPUSpecificCPUDispatchFeatures(StringRef Name, llvm::SmallVectorImpl< StringRef > &Features) const
unsigned getIbm128Width() const
getIbm128Width/Align/Format - Return the size/align/format of '__ibm128'.
bool hasNoAsmVariants() const
Return true if {|} are normal characters in the asm string.
unsigned char ShortAccumScale
virtual unsigned getMinGlobalAlign(uint64_t) const
getMinGlobalAlign - Return the minimum alignment of a global variable, unless its alignment is explic...
virtual std::optional< std::pair< unsigned, unsigned > > getVScaleRange(const LangOptions &LangOpts) const
Returns target-specific min and max values VScale_Range.
virtual bool checkArithmeticFenceSupported() const
Controls if __arithmetic_fence is supported in the targeted backend.
virtual bool validateOpenCLTarget(const LangOptions &Opts, DiagnosticsEngine &Diags) const
Check that OpenCL target has valid options setting based on OpenCL version.
unsigned getUnsignedLongAccumIBits() const
unsigned getTiedOperand() const
IntType getUIntMaxType() const
unsigned MaxOpenCLWorkGroupSize
virtual const char * getStaticInitSectionSpecifier() const
Return the section to use for C++ static initialization functions.
virtual void supportAllOpenCLOpts(bool V=true)
IntType getIntMaxType() const
const llvm::fltSemantics * DoubleFormat
unsigned char MaxAtomicInlineWidth
unsigned char Int128Align
virtual void setCommandLineOpenCLOpts()
Set supported OpenCL extensions as written on command line.
unsigned getZeroLengthBitfieldBoundary() const
Get the fixed alignment value in bits for a member that follows a zero length bitfield.
unsigned getFloat128Width() const
getFloat128Width/Align/Format - Return the size/align/format of '__float128'.
virtual bool hasPS4DLLImportExport() const
virtual void fillValidTuneCPUList(SmallVectorImpl< StringRef > &Values) const
Fill a SmallVectorImpl with the valid values for tuning CPU.
virtual bool hasSjLjLowering() const
Controls if __builtin_longjmp / __builtin_setjmp can be lowered to llvm.eh.sjlj.longjmp / llvm....
unsigned getFractWidth() const
getFractWidth/Align - Return the size of 'signed _Fract' and 'unsigned _Fract' for this target,...
unsigned getBFloat16Align() const
void setRequiresImmediate()
const LangASMap & getAddressSpaceMap() const
const llvm::StringMap< bool > & getSupportedOpenCLOpts() const
Get const supported OpenCL extensions and optional core features.
virtual bool validateInputSize(const llvm::StringMap< bool > &FeatureMap, StringRef, unsigned) const
const llvm::fltSemantics & getIbm128Format() const
unsigned getIntAlign() const
unsigned UseBitFieldTypeAlignment
Control whether the alignment of bit-field types is respected when laying out structures.
bool useExplicitBitFieldAlignment() const
Check whether explicit bitfield alignment attributes should be.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Fields controlling how types are laid out in memory; these may need to be copied for targets like AMD...
virtual IntType getIntTypeByWidth(unsigned BitWidth, bool IsSigned) const
Return integer type with specified width.
unsigned getLargeArrayMinWidth() const
IntType
===-— Target Data Type Query Methods ----------------------------—===//
unsigned getShortAccumIBits() const
IntType getChar16Type() const
virtual bool handleTargetFeatures(std::vector< std::string > &Features, DiagnosticsEngine &Diags)
Perform initialization based on the user configured set of features (e.g., +sse4).
unsigned getShortWidth() const
Return the size of 'signed short' and 'unsigned short' for this target, in bits.
bool doUnsignedFixedPointTypesHavePadding() const
In the event this target uses the same number of fractional bits for its unsigned types as it does wi...
unsigned getChar16Align() const
virtual unsigned multiVersionSortPriority(StringRef Name) const
virtual bool isValidFeatureName(StringRef Feature) const
Determine whether this TargetInfo supports the given feature.
virtual const llvm::omp::GV & getGridValue() const
virtual void setMaxAtomicWidth()
Set the maximum inline or promote width lock-free atomic operation for the given target.
const llvm::fltSemantics * HalfFormat
OpenCLTypeKind
OpenCL type kinds.
std::vector< std::string > Features
void setRequiresImmediate(int Exact)
unsigned ComplexLongDoubleUsesFP2Ret
unsigned getDoubleAlign() const
unsigned getTypeWidth(IntType T) const
Return the width (in bits) of the specified integer type enum.
llvm::VersionTuple DarwinTargetVariantSDKVersion
The version of the darwin target variant SDK which was used during the compilation.
virtual bool hasStrictFP() const
Determine whether constrained floating point is supported on this target.
bool supportsIFunc() const
Identify whether this target supports IFuncs.
static const char * getTypeFormatModifier(IntType T)
Return the printf format modifier for the specified integer type enum.
virtual void setAuxTarget(const TargetInfo *Aux)
unsigned getMaxAtomicPromoteWidth() const
Return the maximum width lock-free atomic operation which will ever be supported for the given target...
virtual bool allowDebugInfoForExternalRef() const
Whether target allows debuginfo types for decl only variables/functions.
virtual uint64_t getPointerAlignV(LangAS AddrSpace) const
virtual bool hasFeatureEnabled(const llvm::StringMap< bool > &Features, StringRef Name) const
Check if target has a given feature enabled.
virtual std::optional< unsigned > getDWARFAddressSpace(unsigned AddressSpace) const
unsigned char MinGlobalAlign
unsigned char LongAccumWidth
IntType getSigAtomicType() const
bool requiresImmediateConstant() const
bool PaddingOnUnsignedFixedPoint
StringRef getPlatformName() const
Retrieve the name of the platform as it is used in the availability attribute.
bool supportsMultiVersioning() const
Identify whether this target supports multiversioning of functions, which requires support for cpu_su...
unsigned getUnsignedShortFractScale() const
getUnsignedShortFractScale - Return the number of fractional bits in a 'unsigned short _Fract' type.
unsigned getLargeArrayAlign() const
virtual ArrayRef< const char * > getGCCRegNames() const =0
unsigned getCharAlign() const
virtual std::string convertConstraint(const char *&Constraint) const
virtual int getEHDataRegisterNumber(unsigned RegNo) const
Return the register number that __builtin_eh_return_regno would return with the specified argument.
bool isValidAsmImmediate(const llvm::APInt &Value) const
unsigned getShortFractAlign() const
bool hasAArch64SVETypes() const
Returns whether or not the AArch64 SVE built-in types are available on this target.
virtual bool supportSourceEvalMethod() const
unsigned short SuitableAlign
llvm::VersionTuple SDKVersion
The version of the SDK which was used during the compilation.
unsigned getAccumAlign() const
IntType getInt64Type() const
unsigned getShortFractScale() const
getShortFractScale - Return the number of fractional bits in a 'signed short _Fract' type.
unsigned getHalfAlign() const
virtual bool hasLegalHalfType() const
Determine whether _Float16 is supported on this target.
Options for controlling the target.
const llvm::fltSemantics & getBFloat16Format() const
unsigned getLongFractAlign() const
unsigned char SSERegParmMax
virtual LangOptions::FPEvalMethodKind getFPEvalMethod() const
Return the value for the C99 FLT_EVAL_METHOD macro.
virtual ArrayRef< AddlRegName > getGCCAddlRegNames() const
void setTiedOperand(unsigned N, ConstraintInfo &Output)
Indicate that this is an input operand that is tied to the specified output operand.
virtual bool setABI(const std::string &Name)
Use the specified ABI.
virtual bool isSPRegName(StringRef) const
virtual bool hasBFloat16Type() const
Determine whether the _BFloat16 type is supported on this target.
@ AArch64ABIBuiltinVaList
__builtin_va_list as defined by the AArch64 ABI http://infocenter.arm.com/help/topic/com....
virtual bool shouldDLLImportComdatSymbols() const
Does this target aim for semantic compatibility with Microsoft C++ code using dllimport/export attrib...
IntType getPtrDiffType(LangAS AddrSpace) const
llvm::SmallSet< int, 4 > ImmSet
unsigned char PointerWidth
virtual enum IntType getPtrDiffTypeV(LangAS AddrSpace) const
@ PowerABIBuiltinVaList
__builtin_va_list as defined by the Power ABI: https://www.power.org /resources/downloads/Power-Arch-...
IntType getWCharType() const
bool resolveSymbolicName(const char *&Name, ArrayRef< ConstraintInfo > OutputConstraints, unsigned &Index) const
virtual bool validateGlobalRegisterVariable(StringRef RegName, unsigned RegSize, bool &HasSizeMismatch) const
Validate register name used for global register variables.
unsigned HasBuiltinMSVaList
unsigned ZeroLengthBitfieldBoundary
If non-zero, specifies a fixed alignment value for bitfields that follow zero length bitfield,...
virtual bool hasFPReturn() const
Determine whether return of a floating point value is supported on this target.
unsigned char LargeArrayMinWidth
unsigned char LongDoubleWidth
The basic abstraction for the target C++ ABI.
ConstraintInfo(StringRef ConstraintStr, StringRef Name)
unsigned getIntWidth() const
getIntWidth/Align - Return the size of 'signed int' and 'unsigned int' for this target,...
llvm::StringMap< bool > OpenCLFeaturesMap
Supported OpenCL extensions and optional core features.
bool validateOutputConstraint(ConstraintInfo &Info) const
virtual bool isBranchProtectionSupportedArch(StringRef Arch) const
Determine if the Architecture in this TargetInfo supports branch protection.
unsigned UseSignedCharForObjCBool
Whether Objective-C's built-in boolean type should be signed char.
void copyAuxTarget(const TargetInfo *Aux)
Copy type and layout related info.
virtual StringRef getCPUSpecificTuneName(StringRef Name) const
unsigned char LongDoubleAlign
virtual bool useFP16ConversionIntrinsics() const
Check whether llvm intrinsics such as llvm.convert.to.fp16 should be used to convert to and from __fp...
bool isSEHTrySupported() const
Whether the target supports SEH __try.
bool hasBuiltinMSVaList() const
Returns whether or not type __builtin_ms_va_list type is available on this target.
unsigned getUnsignedLongFractScale() const
getUnsignedLongFractScale - Return the number of fractional bits in a 'unsigned long _Fract' type.
static IntType getCorrespondingUnsignedType(IntType T)
bool hasRISCVVTypes() const
Returns whether or not the RISC-V V built-in types are available on this target.
LangOptions::SignReturnAddressScopeKind SignReturnAddr