27 unsigned DefaultAddrSpace;
31 bool KernelPassAggregatesIndirect;
33 ArgInfo classifyKernelArgumentType(
const Type *ArgTy)
const {
37 const Type *Ty = ArgTy;
39 AT && AT->getSizeInBits() == AT->getValueType()->getSizeInBits())
40 Ty = AT->getValueType();
42 PtrTy && PtrTy->getAddrSpace() == DefaultAddrSpace) {
43 const Type *Coerced =
TB.getPointerType(
44 PtrTy->getSizeInBits().getFixedValue(), PtrTy->getAlignment(),
62 bool KernelPassAggregatesIndirect)
64 KernelPassAggregatesIndirect(KernelPassAggregatesIndirect) {}
82 I.Info = IsKernel ? classifyKernelArgumentType(
I.ABIType)
87std::unique_ptr<TargetInfo>
89 bool KernelPassAggregatesIndirect) {
90 return std::make_unique<SPIRVTargetInfo>(TB, DefaultAddrSpace,
91 KernelPassAggregatesIndirect);
Default ABI classification shared by targets without special rules.
SPIR-V address space definition.
Target-specific ABI information and factory functions.
Helper class to encapsulate information about how a specific type should be passed to or returned fro...
static ArgInfo getDirect(const Type *T=nullptr, unsigned Offset=0, MaybeAlign Align=std::nullopt, bool CanBeFlattened=true)
Self-consistent classification that conforms to no particular ABI.
ArgInfo classifyArgumentType(const Type *Ty) const
ArgInfo classifyReturnType(const Type *RetTy) const
ArrayRef< ArgEntry > arguments() const
CallingConv::ID getCallingConvention() const
ArgInfo & getReturnInfo()
const Type * getReturnType() const
unsigned getSRetAddrSpace() const override
Address space of the sret pointer of a record that cannot be passed in registers (e....
bool hasInt128Type() const override
Whether the target has a 128-bit integer type. Default true.
const ABICompatInfo & getABICompatInfo() const override
Return this target's ABI compatibility flags.
SPIRVTargetInfo(TypeBuilder &Builder, unsigned DefaultAddrSpace, bool KernelPassAggregatesIndirect)
void computeInfo(FunctionInfo &FI) const override
Populate FI with the target's ABI-lowering decisions for each argument and return value.
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 ArgInfo getNaturalAlignIndirect(const Type *Ty, unsigned AddrSpace, bool ByVal=true) const
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...
@ SPIR_KERNEL
Used for SPIR kernel functions.
LLVM_ABI std::unique_ptr< TargetInfo > createSPIRVTargetInfo(TypeBuilder &TB, unsigned DefaultAddrSpace, bool KernelPassAggregatesIndirect=false)
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
Flags controlling ABI compatibility behaviour that applies to every target.