21 ArgInfo classifyReturnType(
const Type *RetTy)
const {
32 if (IntTy->isBitInt() && IntTy->getSizeInBits().getFixedValue() > 128)
39 ArgInfo classifyArgumentType(
const Type *ArgTy)
const {
41 if (RT->isTransparentUnion() && RT->getNumFields() > 0)
42 ArgTy = RT->getFields()[0].FieldType;
49 if (SizeInBits <= 128) {
51 if (SizeInBits <= 64) {
52 CoerceTy = TB.getIntegerType(
alignTo(SizeInBits, 8),
Align(8),
false);
54 const Type *RegTy = TB.getIntegerType(64,
Align(8),
false);
55 CoerceTy = TB.getArrayType(RegTy, 2, 128);
64 if (IntTy->isBitInt() && IntTy->getSizeInBits().getFixedValue() > 128)
80 I.Info = classifyArgumentType(
I.ABIType);
85 return std::make_unique<BPFTargetInfo>(TB);
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)
static ArgInfo getIgnore()
static ArgInfo getExtend(const Type *T)
void computeInfo(FunctionInfo &FI) const override
Populate FI with the target's ABI-lowering decisions for each argument and return value.
BPFTargetInfo(TypeBuilder &TB)
ArrayRef< ArgEntry > arguments() const
ArgInfo & getReturnInfo()
const Type * getReturnType() const
ArgInfo getNaturalAlignIndirect(const Type *Ty, bool ByVal=true) const
bool isPromotableInteger(const IntegerType *IT) const
bool isAggregateTypeForABI(const Type *Ty) const
TypeBuilder manages the lifecycle of ABI types using bump pointer allocation.
Represents the ABI-specific view of a type in LLVM.
TypeSize getSizeInBits() const
constexpr ScalarTy getFixedValue() const
This file defines the type system for the LLVMABI library, which mirrors ABI-relevant aspects of fron...
std::unique_ptr< TargetInfo > createBPFTargetInfo(TypeBuilder &TB)
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
constexpr uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
This struct is a compact representation of a valid (non-zero power of two) alignment.