14#ifndef LLVM_ABI_TARGETINFO_H
15#define LLVM_ABI_TARGETINFO_H
125 bool ByVal =
true)
const;
210 bool KernelPassAggregatesIndirect =
false);
222 bool Has64BitPointers,
const X86ABICompatInfo &Compat);
Represent a constant reference to an array (0 or more elements consecutively in memory),...
Helper class to encapsulate information about how a specific type should be passed to or returned fro...
LLVM_ABI const Type * isSingleElementStruct(const Type *Ty) const
Returns the scalar a single-element struct reduces to, else null.
unsigned getBitIntRegThreshold() const
Bit width above which a _BitInt cannot stay in registers.
virtual unsigned getLongLongWidth() const
Width of long long in bits. Default 64.
virtual bool isPermittedToBeHomogeneousAggregate(const RecordType *RT) const
Return true if the C++ ABI permits RT to be a homogeneous aggregate.
virtual const ABICompatInfo & getABICompatInfo() const =0
Return this target's ABI compatibility flags.
virtual bool isHomogeneousAggregateSmallEnough(const Type *Base, uint64_t Members) const
Return true if a homogeneous aggregate with Members copies of Base is small enough to be passed in re...
virtual unsigned getAllocaAddrSpace() const
Address space in which indirect arguments are allocated (the target's alloca/stack space).
virtual void computeInfo(FunctionInfo &FI) const =0
Populate FI with the target's ABI-lowering decisions for each argument and return value.
LLVM_ABI bool isHomogeneousAggregate(const Type *Ty, const Type *&Base, uint64_t &Members) const
Return true if Ty is an ELFv2-style homogeneous aggregate.
LLVM_ABI bool isPromotableInteger(const IntegerType *IT) const
virtual ~TargetInfo()=default
virtual bool isZeroLengthBitfieldPermittedInHomogeneousAggregate() const
Return true if zero-length bitfields should be ignored when deciding whether an aggregate is homogene...
virtual bool isPassByRef(const Type *Ty) const
TargetInfo(TypeBuilder &Builder)
virtual bool isHomogeneousAggregateBaseType(const Type *Ty) const
Return true if Ty is a valid base type for a homogeneous aggregate.
virtual bool hasInt128Type() const
Whether the target has a 128-bit integer type. Default true.
LLVM_ABI const Type * getStructOfTypes(ArrayRef< const Type * > Elems, bool Packed) const
A record with one field per element of Elems, each at offset 0.
LLVM_ABI bool maybeCommonClassifyReturnType(FunctionInfo &FI) const
Apply rules for classifying return types that are common to all targets.
LLVM_ABI bool isAggregateTypeForABI(const Type *Ty) const
LLVM_ABI const Type * useFirstFieldIfTransparentUnion(const Type *Ty) const
If Ty is a transparent union, return its first field type; otherwise return Ty unchanged.
LLVM_ABI ArgInfo getNaturalAlignIndirect(const Type *Ty, unsigned AddrSpace, bool ByVal=true) const
LLVM_ABI RecordArgABI getRecordArgABI(const RecordType *RT) const
LLVM_ABI const Type * convertTypeForMem(const Type *Ty) const
In-memory form of Ty.
virtual llvm::Align getMaxIntegerAlign() const
Alignment of the widest integer the target's data layout gives an alignment to.
LLVM_ABI const Type * getI8Array(uint64_t NumBytes) const
An array of NumBytes i8 elements, the padding element of a coerce-and-expand type.
virtual unsigned getSRetAddrSpace() const
Address space of the sret pointer of a record that cannot be passed in registers (e....
TypeBuilder manages the lifecycle of ABI types using bump pointer allocation.
Represents the ABI-specific view of a type in LLVM.
This file defines the type system for the LLVMABI library, which mirrors ABI-relevant aspects of fron...
LLVM_ABI std::unique_ptr< TargetInfo > createBPFTargetInfo(TypeBuilder &TB)
LLVM_ABI std::unique_ptr< TargetInfo > createX86_64TargetInfo(TypeBuilder &TB, X86AVXABILevel AVXLevel, bool Has64BitPointers, const X86ABICompatInfo &Compat)
X86AVXABILevel
The AVX ABI level for X86 targets.
LLVM_ABI std::unique_ptr< TargetInfo > createSPIRVTargetInfo(TypeBuilder &TB, unsigned DefaultAddrSpace, bool KernelPassAggregatesIndirect=false)
@ RAA_Indirect
Pass it as a pointer to temporary memory.
@ RAA_DirectInMemory
Pass it on the stack using its defined layout.
@ RAA_Default
Pass it using the normal C aggregate rules for the ABI, potentially introducing extra copies and pass...
LLVM_ABI std::unique_ptr< TargetInfo > createAArch64TargetInfo(TypeBuilder &TB, const AArch64ABIOptions &Opts)
SmallIntABICompatKind
How promotable integer arguments are passed on X86 (-mextend-small-integers).
@ Both
Compat with both. Extend in caller, don't assume in callee.
@ Platform
Compat with platform ABI (high bits unspecified).
@ Clang23
Compat with old Clang ABI (high bits zero/sign-extended).
LLVM_ABI std::unique_ptr< TargetInfo > createAMDGPUTargetInfo(TypeBuilder &TB, const AMDGPUABIOptions &Opts=AMDGPUABIOptions())
This is an optimization pass for GlobalISel generic memory operations.
This struct is a compact representation of a valid (non-zero power of two) alignment.
AArch64ABIOptions(AArch64ABIKind Kind)
AArch64ABIOptions()=default
Flags controlling ABI compatibility behaviour that applies to every target.
bool IsMatrixHA
Whether a matrix type may be the base type of a homogeneous aggregate.
unsigned PrivateAddrSpace
Address space of indirect arguments and the stack.
bool CoerceGenericPtrArgToGlobal
Coerce generic scalar-pointer kernel arguments to the global address space.
unsigned GenericAddrSpace
The language default address space.
unsigned ConstantAddrSpace
Address space of indirect kernel arguments.
bool ClassifyIntegerMMXAsSSE
SmallIntABICompatKind SmallIntABICompat
bool PassInt128VectorsInMem
bool ClassifyUnnamedBitFields
bool ReturnCXXRecordGreaterThan128InMem