|
LLVM 24.0.0git
|
#include "llvm/ABI/TargetInfo.h"
Public Member Functions | |
| TargetInfo (TypeBuilder &Builder) | |
| virtual | ~TargetInfo ()=default |
| virtual void | computeInfo (FunctionInfo &FI) const =0 |
| Populate FI with the target's ABI-lowering decisions for each argument and return value. | |
| virtual bool | isPassByRef (const Type *Ty) const |
| virtual const ABICompatInfo & | getABICompatInfo () const =0 |
| Return this target's ABI compatibility flags. | |
| virtual unsigned | getAllocaAddrSpace () const |
| Address space in which indirect arguments are allocated (the target's alloca/stack space). | |
| virtual bool | hasInt128Type () const |
| Whether the target has a 128-bit integer type. Default true. | |
| virtual unsigned | getLongLongWidth () const |
| Width of long long in bits. Default 64. | |
Protected Member Functions | |
| LLVM_ABI RecordArgABI | getRecordArgABI (const RecordType *RT) const |
| LLVM_ABI RecordArgABI | getRecordArgABI (const Type *Ty) const |
| LLVM_ABI bool | isPromotableInteger (const IntegerType *IT) const |
| unsigned | getBitIntRegThreshold () const |
| Bit width above which a _BitInt cannot stay in registers. | |
| LLVM_ABI ArgInfo | getNaturalAlignIndirect (const Type *Ty, unsigned AddrSpace, bool ByVal=true) const |
| 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 const Type * | isSingleElementStruct (const Type *Ty) const |
| Returns the scalar a single-element struct reduces to, else null. | |
| LLVM_ABI bool | maybeCommonClassifyReturnType (FunctionInfo &FI) const |
| Apply rules for classifying return types that are common to all targets. | |
| virtual bool | isHomogeneousAggregateBaseType (const Type *Ty) const |
Return true if Ty is a valid base type for a homogeneous aggregate. | |
| 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 registers for this ABI. | |
| virtual bool | isZeroLengthBitfieldPermittedInHomogeneousAggregate () const |
| Return true if zero-length bitfields should be ignored when deciding whether an aggregate is homogeneous. | |
| virtual bool | isPermittedToBeHomogeneousAggregate (const RecordType *RT) const |
Return true if the C++ ABI permits RT to be a homogeneous aggregate. | |
| LLVM_ABI bool | isHomogeneousAggregate (const Type *Ty, const Type *&Base, uint64_t &Members) const |
Return true if Ty is an ELFv2-style homogeneous aggregate. | |
Protected Attributes | |
| TypeBuilder & | TB |
Definition at line 65 of file TargetInfo.h.
|
inlineexplicit |
Definition at line 70 of file TargetInfo.h.
References TB.
Referenced by llvm::abi::AArch64TargetInfo::AArch64TargetInfo(), llvm::abi::BPFTargetInfo::BPFTargetInfo(), and llvm::abi::X86_64TargetInfo::X86_64TargetInfo().
|
virtualdefault |
|
pure virtual |
Populate FI with the target's ABI-lowering decisions for each argument and return value.
Implemented in llvm::abi::AArch64TargetInfo, llvm::abi::BPFTargetInfo, and llvm::abi::DefaultTargetInfo.
|
pure virtual |
Return this target's ABI compatibility flags.
Targets with extra flags store a derived object and return that as an ABICompatInfo reference.
Implemented in llvm::abi::AArch64TargetInfo, llvm::abi::BPFTargetInfo, and llvm::abi::X86_64TargetInfo.
Referenced by isHomogeneousAggregate().
|
inlinevirtual |
Address space in which indirect arguments are allocated (the target's alloca/stack space).
Definition at line 85 of file TargetInfo.h.
Referenced by llvm::abi::DefaultTargetInfo::classifyArgumentType(), and llvm::abi::DefaultTargetInfo::classifyReturnType().
|
inlineprotected |
Bit width above which a _BitInt cannot stay in registers.
Definition at line 99 of file TargetInfo.h.
References getLongLongWidth(), and hasInt128Type().
Referenced by llvm::abi::DefaultTargetInfo::classifyArgumentType(), and llvm::abi::DefaultTargetInfo::classifyReturnType().
|
inlinevirtual |
Width of long long in bits. Default 64.
Definition at line 91 of file TargetInfo.h.
Referenced by getBitIntRegThreshold().
|
protected |
Definition at line 44 of file TargetInfo.cpp.
References llvm::abi::ArgInfo::getIndirect().
Referenced by llvm::abi::DefaultTargetInfo::classifyArgumentType(), and llvm::abi::DefaultTargetInfo::classifyReturnType().
|
protected |
Definition at line 49 of file TargetInfo.cpp.
References llvm::abi::RecordType::canPassInRegisters(), llvm::abi::RAA_Default, and llvm::abi::RAA_Indirect.
Referenced by llvm::abi::DefaultTargetInfo::classifyArgumentType(), and getRecordArgABI().
|
protected |
Definition at line 55 of file TargetInfo.cpp.
References llvm::dyn_cast(), getRecordArgABI(), and llvm::abi::RAA_Default.
|
inlinevirtual |
Whether the target has a 128-bit integer type. Default true.
Definition at line 88 of file TargetInfo.h.
Referenced by getBitIntRegThreshold().
Definition at line 17 of file TargetInfo.cpp.
References llvm::dyn_cast(), and isAggregateTypeForABI().
Referenced by llvm::abi::DefaultTargetInfo::classifyArgumentType(), llvm::abi::DefaultTargetInfo::classifyReturnType(), isAggregateTypeForABI(), and isSingleElementStruct().
|
protected |
Return true if Ty is an ELFv2-style homogeneous aggregate.
Base is set to the base element type and Members to the number of base elements.
Definition at line 152 of file TargetInfo.cpp.
References assert(), llvm::sampleprof::Base, llvm::dyn_cast(), getABICompatInfo(), llvm::ElementCount::getFixed(), llvm::abi::Type::isEmptyRecord(), isHomogeneousAggregate(), isHomogeneousAggregateBaseType(), isHomogeneousAggregateSmallEnough(), llvm::abi::ABICompatInfo::IsMatrixHA, isPermittedToBeHomogeneousAggregate(), isZeroLengthBitfieldPermittedInHomogeneousAggregate(), and TB.
Referenced by isHomogeneousAggregate().
|
inlineprotectedvirtual |
Return true if Ty is a valid base type for a homogeneous aggregate.
Definition at line 117 of file TargetInfo.h.
Referenced by isHomogeneousAggregate().
|
inlineprotectedvirtual |
Return true if a homogeneous aggregate with Members copies of Base is small enough to be passed in registers for this ABI.
Definition at line 123 of file TargetInfo.h.
References llvm::sampleprof::Base, and uint64_t.
Referenced by isHomogeneousAggregate().
Definition at line 77 of file TargetInfo.h.
|
inlineprotectedvirtual |
Return true if the C++ ABI permits RT to be a homogeneous aggregate.
Definition at line 135 of file TargetInfo.h.
Referenced by isHomogeneousAggregate().
|
protected |
Definition at line 37 of file TargetInfo.cpp.
References llvm::BitWidth, and IT.
Referenced by llvm::abi::DefaultTargetInfo::classifyArgumentType(), and llvm::abi::DefaultTargetInfo::classifyReturnType().
Returns the scalar a single-element struct reduces to, else null.
Definition at line 75 of file TargetInfo.cpp.
References llvm::sampleprof::Base, llvm::dyn_cast(), llvm::abi::Type::getSizeInBits(), isAggregateTypeForABI(), and isSingleElementStruct().
Referenced by isSingleElementStruct().
|
inlineprotectedvirtual |
Return true if zero-length bitfields should be ignored when deciding whether an aggregate is homogeneous.
Definition at line 130 of file TargetInfo.h.
Referenced by isHomogeneousAggregate().
|
protected |
Apply rules for classifying return types that are common to all targets.
Definition at line 132 of file TargetInfo.cpp.
References llvm::dyn_cast(), llvm::abi::ArgInfo::getIndirect(), llvm::abi::FunctionInfo::getReturnInfo(), and llvm::abi::FunctionInfo::getReturnType().
Referenced by llvm::abi::AArch64TargetInfo::computeInfo(), and llvm::abi::DefaultTargetInfo::computeInfo().
If Ty is a transparent union, return its first field type; otherwise return Ty unchanged.
Definition at line 64 of file TargetInfo.cpp.
References assert(), and llvm::dyn_cast().
Referenced by llvm::abi::DefaultTargetInfo::classifyArgumentType().
|
protected |
Definition at line 67 of file TargetInfo.h.
Referenced by llvm::abi::AArch64TargetInfo::AArch64TargetInfo(), isHomogeneousAggregate(), and TargetInfo().