23 if (Ty->isInteger() || Ty->isFloat() || Ty->isPointer() || Ty->isVector())
30 if (AT->isMatrixType())
40 unsigned BitWidth =
IT->getSizeInBits().getFixedValue();
65 if (RT->isUnion() && RT->isTransparentUnion()) {
66 auto Fields = RT->getFields();
67 assert(!Fields.empty() &&
"transparent union cannot be empty");
68 return Fields.front().FieldType;
80 if (!RT->canPassInRegisters()) {
96bool isEmptyRecordForHA(
const Type *Ty) {
98 return RT && RT->isEmpty();
104 uint64_t &Members)
const {
107 if (!isMatrixHA && AT->isMatrixType())
109 uint64_t NElements = AT->getNumElements();
114 Members *= NElements;
116 if (RT->hasFlexibleArrayMember())
122 if (RT->isCXXRecord()) {
126 for (
const FieldInfo &BaseField : RT->getBaseClasses()) {
127 if (isEmptyRecordForHA(BaseField.FieldType))
130 uint64_t FldMembers = 0;
134 Members += FldMembers;
138 for (
const FieldInfo &FD : RT->getFields()) {
140 const Type *FT = FD.FieldType;
144 if (AT->isMatrixType())
146 if (AT->getNumElements() == 0)
148 FT = AT->getElementType();
150 if (isEmptyRecordForHA(FT))
154 FD.IsBitField && FD.BitFieldWidth == 0)
157 uint64_t FldMembers = 0;
162 RT->isUnion() ? std::max(Members, FldMembers) : Members + FldMembers;
169 if (
Base->getTypeAllocSize() * Members != Ty->getTypeAllocSize())
176 ElemTy = CT->getElementType();
190 assert(VT->isFixedLength() &&
191 "scalable vectors are never homogeneous aggregates");
193 VT->getElementType()->getSizeInBits().getFixedValue();
194 unsigned NumElements =
195 VT->getTypeAllocSize().getFixedValue() * 8 / EltSize;
196 if (NumElements != VT->getNumElements().getKnownMinValue())
197 Base =
TB.getVectorType(VT->getElementType(),
204 Base->getTypeAllocSize() !=
ElemTy->getTypeAllocSize())
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static cl::opt< ITMode > IT(cl::desc("IT block support"), cl::Hidden, cl::init(DefaultIT), cl::values(clEnumValN(DefaultIT, "arm-default-it", "Generate any type of IT block"), clEnumValN(RestrictedIT, "arm-restrict-it", "Disallow complex IT blocks")))
Target-specific ABI information and factory functions.
static constexpr ElementCount getFixed(ScalarTy MinVal)
Helper class to encapsulate information about how a specific type should be passed to or returned fro...
static ArgInfo getIndirect(Align Align, bool ByVal, unsigned AddrSpace=0, bool Realign=false)
Realign: the caller couldn't guarantee sufficient alignment - the callee must copy the argument to a ...
ArgInfo & getReturnInfo()
const Type * getReturnType() const
bool canPassInRegisters() const
LLVM_ABI ArgInfo getNaturalAlignIndirect(const Type *Ty, bool ByVal=true) const
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...
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 bool isZeroLengthBitfieldPermittedInHomogeneousAggregate() const
Return true if zero-length bitfields should be ignored when deciding whether an aggregate is homogene...
virtual bool isHomogeneousAggregateBaseType(const Type *Ty) const
Return true if Ty is a valid base type for a homogeneous aggregate.
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 RecordArgABI getRecordArgABI(const RecordType *RT) const
Represents the ABI-specific view of a type in LLVM.
@ RAA_Indirect
Pass it as a pointer to temporary memory.
@ RAA_Default
Pass it using the normal C aggregate rules for the ABI, potentially introducing extra copies and pass...
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
constexpr unsigned BitWidth
bool IsMatrixHA
Whether a matrix type may be the base type of a homogeneous aggregate.