Lines Matching refs:Ty
57 static ABIArgInfo coerceToIntArray(QualType Ty, in coerceToIntArray() argument
61 const uint64_t Size = Context.getTypeSize(Ty); in coerceToIntArray()
62 const uint64_t Alignment = Context.getTypeAlign(Ty); in coerceToIntArray()
86 ABIArgInfo ABIInfo::getNaturalAlignIndirect(QualType Ty, bool ByVal, in getNaturalAlignIndirect() argument
89 return ABIArgInfo::getIndirect(getContext().getTypeAlignInChars(Ty), ByVal, in getNaturalAlignIndirect()
94 ABIInfo::getNaturalAlignIndirectInReg(QualType Ty, bool Realign) const { in getNaturalAlignIndirectInReg() argument
95 return ABIArgInfo::getIndirectInReg(getContext().getTypeAlignInChars(Ty), in getNaturalAlignIndirectInReg()
100 QualType Ty) const { in EmitMSVAArg()
109 bool ABIInfo::isPromotableIntegerTypeForABI(QualType Ty) const { in isPromotableIntegerTypeForABI()
110 if (Ty->isPromotableIntegerType()) in isPromotableIntegerTypeForABI()
113 if (const auto *EIT = Ty->getAs<BitIntType>()) in isPromotableIntegerTypeForABI()
183 QualType Ty = FI.getReturnType(); in classifyReturnType() local
185 if (const auto *RT = Ty->getAs<RecordType>()) in classifyReturnType()
188 FI.getReturnInfo() = Info.getNaturalAlignIndirect(Ty); in classifyReturnType()
197 static QualType useFirstFieldIfTransparentUnion(QualType Ty) { in useFirstFieldIfTransparentUnion() argument
198 if (const RecordType *UT = Ty->getAsUnionType()) { in useFirstFieldIfTransparentUnion()
205 return Ty; in useFirstFieldIfTransparentUnion()
234 bool ABIInfo::isHomogeneousAggregateBaseType(QualType Ty) const { in isHomogeneousAggregateBaseType()
254 if (llvm::Type *Ty = getCoerceToType()) in dump() local
255 Ty->print(OS); in dump()
405 QualType Ty, CharUnits SlotSize, in complexTempStructure() argument
428 Address Temp = CGF.CreateMemTemp(Ty, "vacplx"); in complexTempStructure()
429 CGF.EmitStoreOfComplex({Real, Imag}, CGF.MakeAddrLValue(Temp, Ty), in complexTempStructure()
682 Address EmitVAArgInstr(CodeGenFunction &CGF, Address VAListAddr, QualType Ty, in EmitVAArgInstr() argument
702 auto TyInfo = CGF.getContext().getTypeInfoInChars(Ty); in EmitVAArgInstr()
705 llvm::Type *ElementTy = CGF.ConvertTypeForMem(Ty); in EmitVAArgInstr()
723 Address Temp = CGF.CreateMemTemp(Ty, "varet"); in EmitVAArgInstr()
725 CGF.ConvertTypeForMem(Ty)); in EmitVAArgInstr()
750 QualType Ty) const override { in EmitVAArg()
751 return EmitVAArgInstr(CGF, VAListAddr, Ty, classifyArgumentType(Ty)); in EmitVAArg()
761 ABIArgInfo DefaultABIInfo::classifyArgumentType(QualType Ty) const { in classifyArgumentType()
762 Ty = useFirstFieldIfTransparentUnion(Ty); in classifyArgumentType()
764 if (isAggregateTypeForABI(Ty)) { in classifyArgumentType()
767 if (CGCXXABI::RecordArgABI RAA = getRecordArgABI(Ty, getCXXABI())) in classifyArgumentType()
768 return getNaturalAlignIndirect(Ty, RAA == CGCXXABI::RAA_DirectInMemory); in classifyArgumentType()
770 return getNaturalAlignIndirect(Ty); in classifyArgumentType()
774 if (const EnumType *EnumTy = Ty->getAs<EnumType>()) in classifyArgumentType()
775 Ty = EnumTy->getDecl()->getIntegerType(); in classifyArgumentType()
778 if (const auto *EIT = Ty->getAs<BitIntType>()) in classifyArgumentType()
783 return getNaturalAlignIndirect(Ty); in classifyArgumentType()
785 return (isPromotableIntegerTypeForABI(Ty) ? ABIArgInfo::getExtend(Ty) in classifyArgumentType()
834 ABIArgInfo classifyArgumentType(QualType Ty) const;
847 QualType Ty) const override;
898 ABIArgInfo WebAssemblyABIInfo::classifyArgumentType(QualType Ty) const { in classifyArgumentType()
899 Ty = useFirstFieldIfTransparentUnion(Ty); in classifyArgumentType()
901 if (isAggregateTypeForABI(Ty)) { in classifyArgumentType()
904 if (auto RAA = getRecordArgABI(Ty, getCXXABI())) in classifyArgumentType()
905 return getNaturalAlignIndirect(Ty, RAA == CGCXXABI::RAA_DirectInMemory); in classifyArgumentType()
907 if (isEmptyRecord(getContext(), Ty, true)) in classifyArgumentType()
912 if (const Type *SeltTy = isSingleElementStruct(Ty, getContext())) in classifyArgumentType()
916 const RecordType *RT = Ty->getAs<RecordType>(); in classifyArgumentType()
931 return defaultInfo.classifyArgumentType(Ty); in classifyArgumentType()
958 QualType Ty) const { in EmitVAArg()
959 bool IsIndirect = isAggregateTypeForABI(Ty) && in EmitVAArg()
960 !isEmptyRecord(getContext(), Ty, true) && in EmitVAArg()
961 !isSingleElementStruct(Ty, getContext()); in EmitVAArg()
962 return emitVoidPtrVAArg(CGF, VAListAddr, Ty, IsIndirect, in EmitVAArg()
963 getContext().getTypeInfoInChars(Ty), in EmitVAArg()
984 Address VAListAddr, QualType Ty) const override;
1002 QualType Ty) const { in EmitVAArg()
1009 return EmitVAArgInstr(CGF, VAListAddr, Ty, ABIArgInfo::getDirect()); in EmitVAArg()
1013 ABIArgInfo PNaClABIInfo::classifyArgumentType(QualType Ty) const { in classifyArgumentType()
1014 if (isAggregateTypeForABI(Ty)) { in classifyArgumentType()
1015 if (CGCXXABI::RecordArgABI RAA = getRecordArgABI(Ty, getCXXABI())) in classifyArgumentType()
1016 return getNaturalAlignIndirect(Ty, RAA == CGCXXABI::RAA_DirectInMemory); in classifyArgumentType()
1017 return getNaturalAlignIndirect(Ty); in classifyArgumentType()
1018 } else if (const EnumType *EnumTy = Ty->getAs<EnumType>()) { in classifyArgumentType()
1020 Ty = EnumTy->getDecl()->getIntegerType(); in classifyArgumentType()
1021 } else if (Ty->isFloatingType()) { in classifyArgumentType()
1024 } else if (const auto *EIT = Ty->getAs<BitIntType>()) { in classifyArgumentType()
1028 return getNaturalAlignIndirect(Ty); in classifyArgumentType()
1032 return (isPromotableIntegerTypeForABI(Ty) ? ABIArgInfo::getExtend(Ty) in classifyArgumentType()
1069 llvm::Type* Ty) { in X86AdjustInlineAsmType() argument
1073 if (IsMMXCons && Ty->isVectorTy()) { in X86AdjustInlineAsmType()
1074 if (cast<llvm::VectorType>(Ty)->getPrimitiveSizeInBits().getFixedSize() != in X86AdjustInlineAsmType()
1084 return Ty; in X86AdjustInlineAsmType()
1089 static bool isX86VectorTypeForVectorCall(ASTContext &Context, QualType Ty) { in isX86VectorTypeForVectorCall() argument
1090 if (const BuiltinType *BT = Ty->getAs<BuiltinType>()) { in isX86VectorTypeForVectorCall()
1099 } else if (const VectorType *VT = Ty->getAs<VectorType>()) { in isX86VectorTypeForVectorCall()
1159 bool isHomogeneousAggregateBaseType(QualType Ty) const override { in isHomogeneousAggregateBaseType()
1161 return isX86VectorTypeForVectorCall(getContext(), Ty); in isHomogeneousAggregateBaseType()
1164 bool isHomogeneousAggregateSmallEnough(const Type *Ty, in isHomogeneousAggregateSmallEnough() argument
1170 bool shouldReturnTypeInRegister(QualType Ty, ASTContext &Context) const;
1174 ABIArgInfo getIndirectResult(QualType Ty, bool ByVal, CCState &State) const;
1176 ABIArgInfo getIndirectReturnResult(QualType Ty, CCState &State) const;
1179 unsigned getTypeStackAlignInBytes(QualType Ty, unsigned Align) const;
1181 Class classify(QualType Ty) const;
1187 bool updateFreeRegs(QualType Ty, CCState &State) const;
1189 bool shouldAggregateUseDirect(QualType Ty, CCState &State, bool &InReg,
1191 bool shouldPrimitiveUseInReg(QualType Ty, CCState &State) const;
1193 bool canExpandIndirectArgument(QualType Ty) const;
1208 QualType Ty) const override;
1262 llvm::Type* Ty) const override { in adjustInlineAsmType()
1263 return X86AdjustInlineAsmType(CGF, Constraint, Ty); in adjustInlineAsmType()
1376 bool X86_32ABIInfo::shouldReturnTypeInRegister(QualType Ty, in shouldReturnTypeInRegister() argument
1378 uint64_t Size = Context.getTypeSize(Ty); in shouldReturnTypeInRegister()
1385 if (Ty->isVectorType()) { in shouldReturnTypeInRegister()
1396 if (Ty->getAs<BuiltinType>() || Ty->hasPointerRepresentation() || in shouldReturnTypeInRegister()
1397 Ty->isAnyComplexType() || Ty->isEnumeralType() || in shouldReturnTypeInRegister()
1398 Ty->isBlockPointerType() || Ty->isMemberPointerType()) in shouldReturnTypeInRegister()
1402 if (const ConstantArrayType *AT = Context.getAsConstantArrayType(Ty)) in shouldReturnTypeInRegister()
1406 const RecordType *RT = Ty->getAs<RecordType>(); in shouldReturnTypeInRegister()
1425 static bool is32Or64BitBasicType(QualType Ty, ASTContext &Context) { in is32Or64BitBasicType() argument
1427 if (const ComplexType *CTy = Ty->getAs<ComplexType>()) in is32Or64BitBasicType()
1428 Ty = CTy->getElementType(); in is32Or64BitBasicType()
1433 if (!Ty->getAs<BuiltinType>() && !Ty->hasPointerRepresentation() && in is32Or64BitBasicType()
1434 !Ty->isEnumeralType() && !Ty->isBlockPointerType()) in is32Or64BitBasicType()
1437 uint64_t Size = Context.getTypeSize(Ty); in is32Or64BitBasicType()
1478 bool X86_32ABIInfo::canExpandIndirectArgument(QualType Ty) const { in canExpandIndirectArgument()
1480 const RecordType *RT = Ty->getAs<RecordType>(); in canExpandIndirectArgument()
1504 return Size == getContext().getTypeSize(Ty); in canExpandIndirectArgument()
1615 static bool isSIMDVectorType(ASTContext &Context, QualType Ty) { in isSIMDVectorType() argument
1616 return Ty->getAs<VectorType>() && Context.getTypeSize(Ty) == 128; in isSIMDVectorType()
1619 static bool isRecordWithSIMDVectorType(ASTContext &Context, QualType Ty) { in isRecordWithSIMDVectorType() argument
1620 const RecordType *RT = Ty->getAs<RecordType>(); in isRecordWithSIMDVectorType()
1644 unsigned X86_32ABIInfo::getTypeStackAlignInBytes(QualType Ty, in getTypeStackAlignInBytes() argument
1656 if (Ty->isVectorType() && (Align == 16 || Align == 32 || Align == 64)) in getTypeStackAlignInBytes()
1666 if (Align >= 16 && (isSIMDVectorType(getContext(), Ty) || in getTypeStackAlignInBytes()
1667 isRecordWithSIMDVectorType(getContext(), Ty))) in getTypeStackAlignInBytes()
1673 ABIArgInfo X86_32ABIInfo::getIndirectResult(QualType Ty, bool ByVal, in getIndirectResult() argument
1679 return getNaturalAlignIndirectInReg(Ty); in getIndirectResult()
1681 return getNaturalAlignIndirect(Ty, false); in getIndirectResult()
1685 unsigned TypeAlign = getContext().getTypeAlign(Ty) / 8; in getIndirectResult()
1686 unsigned StackAlign = getTypeStackAlignInBytes(Ty, TypeAlign); in getIndirectResult()
1697 X86_32ABIInfo::Class X86_32ABIInfo::classify(QualType Ty) const { in classify()
1698 const Type *T = isSingleElementStruct(Ty, getContext()); in classify()
1700 T = Ty.getTypePtr(); in classify()
1710 bool X86_32ABIInfo::updateFreeRegs(QualType Ty, CCState &State) const { in updateFreeRegs() argument
1712 Class C = classify(Ty); in updateFreeRegs()
1717 unsigned Size = getContext().getTypeSize(Ty); in updateFreeRegs()
1741 bool X86_32ABIInfo::shouldAggregateUseDirect(QualType Ty, CCState &State, in shouldAggregateUseDirect() argument
1747 if (IsWin32StructABI && isAggregateTypeForABI(Ty)) in shouldAggregateUseDirect()
1753 if (!updateFreeRegs(Ty, State)) in shouldAggregateUseDirect()
1762 if (getContext().getTypeSize(Ty) <= 32 && State.FreeRegs) in shouldAggregateUseDirect()
1771 bool X86_32ABIInfo::shouldPrimitiveUseInReg(QualType Ty, CCState &State) const { in shouldPrimitiveUseInReg() argument
1772 if (!updateFreeRegs(Ty, State)) in shouldPrimitiveUseInReg()
1781 if (getContext().getTypeSize(Ty) > 32) in shouldPrimitiveUseInReg()
1784 return (Ty->isIntegralOrEnumerationType() || Ty->isPointerType() || in shouldPrimitiveUseInReg()
1785 Ty->isReferenceType()); in shouldPrimitiveUseInReg()
1805 const QualType &Ty = Args[I].type; in runVectorCallFirstPass() local
1806 if ((Ty->isVectorType() || Ty->isBuiltinType()) && in runVectorCallFirstPass()
1807 isHomogeneousAggregate(Ty, Base, NumElts)) { in runVectorCallFirstPass()
1817 ABIArgInfo X86_32ABIInfo::classifyArgumentType(QualType Ty, in classifyArgumentType() argument
1824 Ty = useFirstFieldIfTransparentUnion(Ty); in classifyArgumentType()
1825 TypeInfo TI = getContext().getTypeInfo(Ty); in classifyArgumentType()
1828 const RecordType *RT = Ty->getAs<RecordType>(); in classifyArgumentType()
1832 return getIndirectResult(Ty, false, State); in classifyArgumentType()
1844 isHomogeneousAggregate(Ty, Base, NumElts)) { in classifyArgumentType()
1853 if (Ty->isBuiltinType() || Ty->isVectorType()) in classifyArgumentType()
1857 return getIndirectResult(Ty, /*ByVal=*/false, State); in classifyArgumentType()
1860 if (isAggregateTypeForABI(Ty)) { in classifyArgumentType()
1864 return getIndirectResult(Ty, true, State); in classifyArgumentType()
1867 if (!IsWin32StructABI && isEmptyRecord(getContext(), Ty, true)) in classifyArgumentType()
1874 if (shouldAggregateUseDirect(Ty, State, InReg, NeedsPadding)) { in classifyArgumentType()
1888 return getIndirectResult(Ty, /*ByVal=*/false, State); in classifyArgumentType()
1897 canExpandIndirectArgument(Ty)) in classifyArgumentType()
1901 return getIndirectResult(Ty, true, State); in classifyArgumentType()
1904 if (const VectorType *VT = Ty->getAs<VectorType>()) { in classifyArgumentType()
1913 return getIndirectResult(Ty, /*ByVal=*/false, State); in classifyArgumentType()
1925 if (IsX86_MMXType(CGT.ConvertType(Ty))) in classifyArgumentType()
1932 if (const EnumType *EnumTy = Ty->getAs<EnumType>()) in classifyArgumentType()
1933 Ty = EnumTy->getDecl()->getIntegerType(); in classifyArgumentType()
1935 bool InReg = shouldPrimitiveUseInReg(Ty, State); in classifyArgumentType()
1937 if (isPromotableIntegerTypeForABI(Ty)) { in classifyArgumentType()
1939 return ABIArgInfo::getExtendInReg(Ty); in classifyArgumentType()
1940 return ABIArgInfo::getExtend(Ty); in classifyArgumentType()
1943 if (const auto *EIT = Ty->getAs<BitIntType>()) { in classifyArgumentType()
1949 return getIndirectResult(Ty, /*ByVal=*/false, State); in classifyArgumentType()
2044 llvm::Type *Ty = llvm::Type::getInt8Ty(getVMContext()); in addFieldToArgStruct() local
2045 Ty = llvm::ArrayType::get(Ty, NumBytes.getQuantity()); in addFieldToArgStruct()
2046 FrameFields.push_back(Ty); in addFieldToArgStruct()
2116 Address VAListAddr, QualType Ty) const { in EmitVAArg()
2118 auto TypeInfo = getContext().getTypeInfoInChars(Ty); in EmitVAArg()
2125 getTypeStackAlignInBytes(Ty, TypeInfo.Align.getQuantity())); in EmitVAArg()
2127 return emitVoidPtrVAArg(CGF, VAListAddr, Ty, /*Indirect*/ false, in EmitVAArg()
2321 llvm::Type *GetByteVectorType(QualType Ty) const;
2331 ABIArgInfo getIndirectReturnResult(QualType Ty) const;
2338 ABIArgInfo getIndirectResult(QualType Ty, unsigned freeIntRegs) const;
2342 ABIArgInfo classifyArgumentType(QualType Ty, unsigned freeIntRegs,
2347 ABIArgInfo classifyRegCallStructType(QualType Ty, unsigned &NeededInt,
2351 ABIArgInfo classifyRegCallStructTypeImpl(QualType Ty, unsigned &NeededInt,
2355 bool IsIllegalVectorType(QualType Ty) const;
2420 QualType Ty) const override;
2422 QualType Ty) const override;
2447 QualType Ty) const override;
2449 bool isHomogeneousAggregateBaseType(QualType Ty) const override { in isHomogeneousAggregateBaseType()
2451 return isX86VectorTypeForVectorCall(getContext(), Ty); in isHomogeneousAggregateBaseType()
2454 bool isHomogeneousAggregateSmallEnough(const Type *Ty, in isHomogeneousAggregateSmallEnough() argument
2470 ABIArgInfo classify(QualType Ty, unsigned &FreeSSERegs, bool IsReturnType,
2472 ABIArgInfo reclassifyHvaArgForVectorCall(QualType Ty, unsigned &FreeSSERegs,
2509 llvm::Type* Ty) const override { in adjustInlineAsmType()
2510 return X86AdjustInlineAsmType(CGF, Constraint, Ty); in adjustInlineAsmType()
2525 if (getABIInfo().isPassedUsingAVXType(it->Ty)) { in isNoProtoCallVariadic()
2585 QualType Ty, StringRef Feature, in checkAVXParamFeature() argument
2591 << IsArgument << Ty << Feature; in checkAVXParamFeature()
2596 << IsArgument << Ty << Feature; in checkAVXParamFeature()
2606 const llvm::StringMap<bool> &CalleeMap, QualType Ty, in checkAVXParam() argument
2608 uint64_t Size = Ctx.getTypeSize(Ty); in checkAVXParam()
2610 return checkAVXParamFeature(Diag, CallLoc, CallerMap, CalleeMap, Ty, in checkAVXParam()
2614 return checkAVXParamFeature(Diag, CallLoc, CallerMap, CalleeMap, Ty, "avx", in checkAVXParam()
2640 QualType Ty = Arg.getType(); in checkFunctionCallABI() local
2644 Ty = Callee->getParamDecl(ArgIndex)->getType(); in checkFunctionCallABI()
2647 CalleeMap, Ty, /*IsArgument*/ true)) in checkFunctionCallABI()
2848 void X86_64ABIInfo::classify(QualType Ty, uint64_t OffsetBase, Class &Lo, in classify() argument
2863 if (const BuiltinType *BT = Ty->getAs<BuiltinType>()) { in classify()
2894 if (const EnumType *ET = Ty->getAs<EnumType>()) { in classify()
2900 if (Ty->hasPointerRepresentation()) { in classify()
2905 if (Ty->isMemberPointerType()) { in classify()
2906 if (Ty->isMemberFunctionPointerType()) { in classify()
2928 if (const VectorType *VT = Ty->getAs<VectorType>()) { in classify()
2996 if (const ComplexType *CT = Ty->getAs<ComplexType>()) { in classify()
2999 uint64_t Size = getContext().getTypeSize(Ty); in classify()
3032 if (const auto *EITy = Ty->getAs<BitIntType>()) { in classify()
3041 if (const ConstantArrayType *AT = getContext().getAsConstantArrayType(Ty)) { in classify()
3044 uint64_t Size = getContext().getTypeSize(Ty); in classify()
3088 if (const RecordType *RT = Ty->getAs<RecordType>()) { in classify()
3089 uint64_t Size = getContext().getTypeSize(Ty); in classify()
3217 ABIArgInfo X86_64ABIInfo::getIndirectReturnResult(QualType Ty) const { in getIndirectReturnResult()
3220 if (!isAggregateTypeForABI(Ty)) { in getIndirectReturnResult()
3222 if (const EnumType *EnumTy = Ty->getAs<EnumType>()) in getIndirectReturnResult()
3223 Ty = EnumTy->getDecl()->getIntegerType(); in getIndirectReturnResult()
3225 if (Ty->isBitIntType()) in getIndirectReturnResult()
3226 return getNaturalAlignIndirect(Ty); in getIndirectReturnResult()
3228 return (isPromotableIntegerTypeForABI(Ty) ? ABIArgInfo::getExtend(Ty) in getIndirectReturnResult()
3232 return getNaturalAlignIndirect(Ty); in getIndirectReturnResult()
3235 bool X86_64ABIInfo::IsIllegalVectorType(QualType Ty) const { in IsIllegalVectorType()
3236 if (const VectorType *VecTy = Ty->getAs<VectorType>()) { in IsIllegalVectorType()
3251 ABIArgInfo X86_64ABIInfo::getIndirectResult(QualType Ty, in getIndirectResult() argument
3261 if (!isAggregateTypeForABI(Ty) && !IsIllegalVectorType(Ty) && in getIndirectResult()
3262 !Ty->isBitIntType()) { in getIndirectResult()
3264 if (const EnumType *EnumTy = Ty->getAs<EnumType>()) in getIndirectResult()
3265 Ty = EnumTy->getDecl()->getIntegerType(); in getIndirectResult()
3267 return (isPromotableIntegerTypeForABI(Ty) ? ABIArgInfo::getExtend(Ty) in getIndirectResult()
3271 if (CGCXXABI::RecordArgABI RAA = getRecordArgABI(Ty, getCXXABI())) in getIndirectResult()
3272 return getNaturalAlignIndirect(Ty, RAA == CGCXXABI::RAA_DirectInMemory); in getIndirectResult()
3276 unsigned Align = std::max(getContext().getTypeAlign(Ty) / 8, 8U); in getIndirectResult()
3300 uint64_t Size = getContext().getTypeSize(Ty); in getIndirectResult()
3314 llvm::Type *X86_64ABIInfo::GetByteVectorType(QualType Ty) const { in GetByteVectorType()
3317 if (const Type *InnerTy = isSingleElementStruct(Ty, getContext())) in GetByteVectorType()
3318 Ty = QualType(InnerTy, 0); in GetByteVectorType()
3320 llvm::Type *IRType = CGT.ConvertType(Ty); in GetByteVectorType()
3327 uint64_t Size = getContext().getTypeSize(Ty); in GetByteVectorType()
3339 uint64_t Size = getContext().getTypeSize(Ty); in GetByteVectorType()
3355 static bool BitsContainNoUserData(QualType Ty, unsigned StartBit, in BitsContainNoUserData() argument
3360 unsigned TySize = (unsigned)Context.getTypeSize(Ty); in BitsContainNoUserData()
3364 if (const ConstantArrayType *AT = Context.getAsConstantArrayType(Ty)) { in BitsContainNoUserData()
3383 if (const RecordType *RT = Ty->getAs<RecordType>()) { in BitsContainNoUserData()
3758 X86_64ABIInfo::classifyArgumentType(QualType Ty, unsigned freeIntRegs, in classifyArgumentType() argument
3761 Ty = useFirstFieldIfTransparentUnion(Ty); in classifyArgumentType()
3764 classify(Ty, 0, Lo, Hi, isNamedArg, IsRegCall); in classifyArgumentType()
3792 if (getRecordArgABI(Ty, getCXXABI()) == CGCXXABI::RAA_Indirect) in classifyArgumentType()
3794 return getIndirectResult(Ty, freeIntRegs); in classifyArgumentType()
3807 ResType = GetINTEGERTypeAtOffset(CGT.ConvertType(Ty), 0, Ty, 0); in classifyArgumentType()
3813 if (const EnumType *EnumTy = Ty->getAs<EnumType>()) in classifyArgumentType()
3814 Ty = EnumTy->getDecl()->getIntegerType(); in classifyArgumentType()
3816 if (Ty->isIntegralOrEnumerationType() && in classifyArgumentType()
3817 isPromotableIntegerTypeForABI(Ty)) in classifyArgumentType()
3818 return ABIArgInfo::getExtend(Ty); in classifyArgumentType()
3827 llvm::Type *IRType = CGT.ConvertType(Ty); in classifyArgumentType()
3828 ResType = GetSSETypeAtOffset(IRType, 0, Ty, 0); in classifyArgumentType()
3849 HighPart = GetINTEGERTypeAtOffset(CGT.ConvertType(Ty), 8, Ty, 8); in classifyArgumentType()
3859 HighPart = GetSSETypeAtOffset(CGT.ConvertType(Ty), 8, Ty, 8); in classifyArgumentType()
3872 ResType = GetByteVectorType(Ty); in classifyArgumentType()
3886 X86_64ABIInfo::classifyRegCallStructTypeImpl(QualType Ty, unsigned &NeededInt, in classifyRegCallStructTypeImpl() argument
3889 auto RT = Ty->getAs<RecordType>(); in classifyRegCallStructTypeImpl()
3893 return getIndirectReturnResult(Ty); in classifyRegCallStructTypeImpl()
3899 return getIndirectReturnResult(Ty); in classifyRegCallStructTypeImpl()
3907 return getIndirectReturnResult(Ty); in classifyRegCallStructTypeImpl()
3919 return getIndirectReturnResult(Ty); in classifyRegCallStructTypeImpl()
3927 return getIndirectReturnResult(Ty); in classifyRegCallStructTypeImpl()
3943 X86_64ABIInfo::classifyRegCallStructType(QualType Ty, unsigned &NeededInt, in classifyRegCallStructType() argument
3951 return classifyRegCallStructTypeImpl(Ty, NeededInt, NeededSSE, in classifyRegCallStructType()
4039 Address VAListAddr, QualType Ty) { in EmitX86_64VAArgFromMemory() argument
4049 CharUnits Align = CGF.getContext().getTypeAlignInChars(Ty); in EmitX86_64VAArgFromMemory()
4056 llvm::Type *LTy = CGF.ConvertTypeForMem(Ty); in EmitX86_64VAArgFromMemory()
4066 uint64_t SizeInBytes = (CGF.getContext().getTypeSize(Ty) + 7) / 8; in EmitX86_64VAArgFromMemory()
4078 QualType Ty) const { in EmitVAArg()
4088 Ty = getContext().getCanonicalType(Ty); in EmitVAArg()
4089 ABIArgInfo AI = classifyArgumentType(Ty, 0, neededInt, neededSSE, in EmitVAArg()
4095 return EmitX86_64VAArgFromMemory(CGF, VAListAddr, Ty); in EmitVAArg()
4146 llvm::Type *LTy = CGF.ConvertTypeForMem(Ty); in EmitVAArg()
4155 Address Tmp = CGF.CreateMemTemp(Ty); in EmitVAArg()
4191 auto TInfo = getContext().getTypeInfoInChars(Ty); in EmitVAArg()
4198 Address Tmp = CGF.CreateMemTemp(Ty); in EmitVAArg()
4225 Address Tmp = CGF.CreateMemTemp(Ty); in EmitVAArg()
4255 Address MemAddr = EmitX86_64VAArgFromMemory(CGF, VAListAddr, Ty); in EmitVAArg()
4266 QualType Ty) const { in EmitMSVAArg()
4269 uint64_t Width = getContext().getTypeSize(Ty); in EmitMSVAArg()
4272 return emitVoidPtrVAArg(CGF, VAListAddr, Ty, IsIndirect, in EmitMSVAArg()
4273 CGF.getContext().getTypeInfoInChars(Ty), in EmitMSVAArg()
4279 QualType Ty, unsigned &FreeSSERegs, const ABIArgInfo ¤t) const { in reclassifyHvaArgForVectorCall() argument
4283 if (!Ty->isBuiltinType() && !Ty->isVectorType() && in reclassifyHvaArgForVectorCall()
4284 isHomogeneousAggregate(Ty, Base, NumElts) && FreeSSERegs >= NumElts) { in reclassifyHvaArgForVectorCall()
4291 ABIArgInfo WinX86_64ABIInfo::classify(QualType Ty, unsigned &FreeSSERegs, in classify() argument
4295 if (Ty->isVoidType()) in classify()
4298 if (const EnumType *EnumTy = Ty->getAs<EnumType>()) in classify()
4299 Ty = EnumTy->getDecl()->getIntegerType(); in classify()
4301 TypeInfo Info = getContext().getTypeInfo(Ty); in classify()
4305 const RecordType *RT = Ty->getAs<RecordType>(); in classify()
4309 return getNaturalAlignIndirect(Ty, RAA == CGCXXABI::RAA_DirectInMemory); in classify()
4313 return getNaturalAlignIndirect(Ty, /*ByVal=*/false); in classify()
4322 isHomogeneousAggregate(Ty, Base, NumElts)) { in classify()
4326 if (IsReturnType || Ty->isBuiltinType() || Ty->isVectorType()) in classify()
4333 (IsReturnType || Ty->isBuiltinType() || Ty->isVectorType())) { in classify()
4338 } else if (!Ty->isBuiltinType() && !Ty->isVectorType()) { in classify()
4345 if (Ty->isMemberPointerType()) { in classify()
4348 llvm::Type *LLTy = CGT.ConvertType(Ty); in classify()
4353 if (RT || Ty->isAnyComplexType() || Ty->isMemberPointerType()) { in classify()
4357 return getNaturalAlignIndirect(Ty, /*ByVal=*/false); in classify()
4363 if (const BuiltinType *BT = Ty->getAs<BuiltinType>()) { in classify()
4368 return ABIArgInfo::getExtend(Ty); in classify()
4398 if (Ty->isBitIntType()) { in classify()
4468 QualType Ty) const { in EmitVAArg()
4471 uint64_t Width = getContext().getTypeSize(Ty); in EmitVAArg()
4474 return emitVoidPtrVAArg(CGF, VAListAddr, Ty, IsIndirect, in EmitVAArg()
4475 CGF.getContext().getTypeInfoInChars(Ty), in EmitVAArg()
4547 CharUnits getParamTypeAlignment(QualType Ty) const;
4553 bool isPromotableTypeForABI(QualType Ty) const;
4556 ABIArgInfo classifyArgumentType(QualType Ty) const;
4567 QualType Ty) const override;
4588 bool AIXABIInfo::isPromotableTypeForABI(QualType Ty) const { in isPromotableTypeForABI()
4590 if (const EnumType *EnumTy = Ty->getAs<EnumType>()) in isPromotableTypeForABI()
4591 Ty = EnumTy->getDecl()->getIntegerType(); in isPromotableTypeForABI()
4594 if (Ty->isPromotableIntegerType()) in isPromotableTypeForABI()
4603 if (const BuiltinType *BT = Ty->getAs<BuiltinType>()) in isPromotableTypeForABI()
4632 ABIArgInfo AIXABIInfo::classifyArgumentType(QualType Ty) const { in classifyArgumentType()
4633 Ty = useFirstFieldIfTransparentUnion(Ty); in classifyArgumentType()
4635 if (Ty->isAnyComplexType()) in classifyArgumentType()
4638 if (Ty->isVectorType()) in classifyArgumentType()
4641 if (isAggregateTypeForABI(Ty)) { in classifyArgumentType()
4644 if (CGCXXABI::RecordArgABI RAA = getRecordArgABI(Ty, getCXXABI())) in classifyArgumentType()
4645 return getNaturalAlignIndirect(Ty, RAA == CGCXXABI::RAA_DirectInMemory); in classifyArgumentType()
4647 CharUnits CCAlign = getParamTypeAlignment(Ty); in classifyArgumentType()
4648 CharUnits TyAlign = getContext().getTypeAlignInChars(Ty); in classifyArgumentType()
4654 return (isPromotableTypeForABI(Ty) ? ABIArgInfo::getExtend(Ty) in classifyArgumentType()
4658 CharUnits AIXABIInfo::getParamTypeAlignment(QualType Ty) const { in getParamTypeAlignment()
4660 if (const ComplexType *CTy = Ty->getAs<ComplexType>()) in getParamTypeAlignment()
4661 Ty = CTy->getElementType(); in getParamTypeAlignment()
4663 if (Ty->isVectorType()) in getParamTypeAlignment()
4667 if (isRecordWithSIMDVectorType(getContext(), Ty)) in getParamTypeAlignment()
4674 QualType Ty) const { in EmitVAArg()
4676 auto TypeInfo = getContext().getTypeInfoInChars(Ty); in EmitVAArg()
4677 TypeInfo.Align = getParamTypeAlignment(Ty); in EmitVAArg()
4688 if (const ComplexType *CTy = Ty->getAs<ComplexType>()) { in EmitVAArg()
4691 return complexTempStructure(CGF, VAListAddr, Ty, SlotSize, EltSize, CTy); in EmitVAArg()
4694 return emitVoidPtrVAArg(CGF, VAListAddr, Ty, /*Indirect*/ false, TypeInfo, in EmitVAArg()
4710 CharUnits getParamTypeAlignment(QualType Ty) const;
4728 QualType Ty) const override;
4751 CharUnits PPC32_SVR4_ABIInfo::getParamTypeAlignment(QualType Ty) const { in getParamTypeAlignment()
4753 if (const ComplexType *CTy = Ty->getAs<ComplexType>()) in getParamTypeAlignment()
4754 Ty = CTy->getElementType(); in getParamTypeAlignment()
4756 if (Ty->isVectorType()) in getParamTypeAlignment()
4757 return CharUnits::fromQuantity(getContext().getTypeSize(Ty) == 128 ? 16 in getParamTypeAlignment()
4763 if (const Type *EltType = isSingleElementStruct(Ty, getContext())) { in getParamTypeAlignment()
4806 QualType Ty) const { in EmitVAArg()
4808 auto TI = getContext().getTypeInfoInChars(Ty); in EmitVAArg()
4809 TI.Align = getParamTypeAlignment(Ty); in EmitVAArg()
4812 return emitVoidPtrVAArg(CGF, VAList, Ty, in EmitVAArg()
4813 classifyArgumentType(Ty).isIndirect(), TI, SlotSize, in EmitVAArg()
4818 if (const ComplexType *CTy = Ty->getAs<ComplexType>()) { in EmitVAArg()
4832 bool isI64 = Ty->isIntegerType() && getContext().getTypeSize(Ty) == 64; in EmitVAArg()
4833 bool isInt = !Ty->isFloatingType(); in EmitVAArg()
4834 bool isF64 = Ty->isFloatingType() && getContext().getTypeSize(Ty) == 64; in EmitVAArg()
4838 bool isIndirect = isAggregateTypeForABI(Ty); in EmitVAArg()
4867 llvm::Type *DirectTy = CGF.ConvertType(Ty), *ElementTy = DirectTy; in EmitVAArg()
4917 auto TypeInfo = CGF.getContext().getTypeInfoInChars(Ty); in EmitVAArg()
4928 CharUnits Align = CGF.getContext().getTypeAlignInChars(Ty); in EmitVAArg()
4952 getContext().getTypeAlignInChars(Ty)); in EmitVAArg()
5005 bool isPromotableTypeForABI(QualType Ty) const;
5006 CharUnits getParamTypeAlignment(QualType Ty) const;
5009 ABIArgInfo classifyArgumentType(QualType Ty) const;
5011 bool isHomogeneousAggregateBaseType(QualType Ty) const override;
5012 bool isHomogeneousAggregateSmallEnough(const Type *Ty,
5043 QualType Ty) const override;
5091 PPC64_SVR4_ABIInfo::isPromotableTypeForABI(QualType Ty) const { in isPromotableTypeForABI()
5093 if (const EnumType *EnumTy = Ty->getAs<EnumType>()) in isPromotableTypeForABI()
5094 Ty = EnumTy->getDecl()->getIntegerType(); in isPromotableTypeForABI()
5097 if (isPromotableIntegerTypeForABI(Ty)) in isPromotableTypeForABI()
5102 if (const BuiltinType *BT = Ty->getAs<BuiltinType>()) in isPromotableTypeForABI()
5111 if (const auto *EIT = Ty->getAs<BitIntType>()) in isPromotableTypeForABI()
5120 CharUnits PPC64_SVR4_ABIInfo::getParamTypeAlignment(QualType Ty) const { in getParamTypeAlignment()
5122 if (const ComplexType *CTy = Ty->getAs<ComplexType>()) in getParamTypeAlignment()
5123 Ty = CTy->getElementType(); in getParamTypeAlignment()
5125 auto FloatUsesVector = [this](QualType Ty){ in getParamTypeAlignment() argument
5126 return Ty->isRealFloatingType() && &getContext().getFloatTypeSemantics( in getParamTypeAlignment()
5127 Ty) == &llvm::APFloat::IEEEquad(); in getParamTypeAlignment()
5132 if (Ty->isVectorType()) { in getParamTypeAlignment()
5133 return CharUnits::fromQuantity(getContext().getTypeSize(Ty) == 128 ? 16 : 8); in getParamTypeAlignment()
5134 } else if (FloatUsesVector(Ty)) { in getParamTypeAlignment()
5144 const Type *EltType = isSingleElementStruct(Ty, getContext()); in getParamTypeAlignment()
5156 isAggregateTypeForABI(Ty) && isHomogeneousAggregate(Ty, Base, Members)) in getParamTypeAlignment()
5168 if (isAggregateTypeForABI(Ty) && getContext().getTypeAlign(Ty) >= 128) { in getParamTypeAlignment()
5178 bool ABIInfo::isHomogeneousAggregate(QualType Ty, const Type *&Base, in isHomogeneousAggregate() argument
5180 if (const ConstantArrayType *AT = getContext().getAsConstantArrayType(Ty)) { in isHomogeneousAggregate()
5187 } else if (const RecordType *RT = Ty->getAs<RecordType>()) { in isHomogeneousAggregate()
5242 getContext().getTypeSize(Ty)) in isHomogeneousAggregate()
5246 if (const ComplexType *CT = Ty->getAs<ComplexType>()) { in isHomogeneousAggregate()
5248 Ty = CT->getElementType(); in isHomogeneousAggregate()
5252 if (!isHomogeneousAggregateBaseType(Ty)) in isHomogeneousAggregate()
5258 const Type *TyPtr = Ty.getTypePtr(); in isHomogeneousAggregate()
5280 bool PPC64_SVR4_ABIInfo::isHomogeneousAggregateBaseType(QualType Ty) const { in isHomogeneousAggregateBaseType()
5283 if (const BuiltinType *BT = Ty->getAs<BuiltinType>()) { in isHomogeneousAggregateBaseType()
5295 if (const VectorType *VT = Ty->getAs<VectorType>()) { in isHomogeneousAggregateBaseType()
5317 PPC64_SVR4_ABIInfo::classifyArgumentType(QualType Ty) const { in classifyArgumentType()
5318 Ty = useFirstFieldIfTransparentUnion(Ty); in classifyArgumentType()
5320 if (Ty->isAnyComplexType()) in classifyArgumentType()
5325 if (Ty->isVectorType()) { in classifyArgumentType()
5326 uint64_t Size = getContext().getTypeSize(Ty); in classifyArgumentType()
5328 return getNaturalAlignIndirect(Ty, /*ByVal=*/false); in classifyArgumentType()
5335 if (const auto *EIT = Ty->getAs<BitIntType>()) in classifyArgumentType()
5337 return getNaturalAlignIndirect(Ty, /*ByVal=*/true); in classifyArgumentType()
5339 if (isAggregateTypeForABI(Ty)) { in classifyArgumentType()
5340 if (CGCXXABI::RecordArgABI RAA = getRecordArgABI(Ty, getCXXABI())) in classifyArgumentType()
5341 return getNaturalAlignIndirect(Ty, RAA == CGCXXABI::RAA_DirectInMemory); in classifyArgumentType()
5343 uint64_t ABIAlign = getParamTypeAlignment(Ty).getQuantity(); in classifyArgumentType()
5344 uint64_t TyAlign = getContext().getTypeAlignInChars(Ty).getQuantity(); in classifyArgumentType()
5350 isHomogeneousAggregate(Ty, Base, Members)) { in classifyArgumentType()
5360 uint64_t Bits = getContext().getTypeSize(Ty); in classifyArgumentType()
5387 return (isPromotableTypeForABI(Ty) ? ABIArgInfo::getExtend(Ty) in classifyArgumentType()
5452 QualType Ty) const { in EmitVAArg()
5453 auto TypeInfo = getContext().getTypeInfoInChars(Ty); in EmitVAArg()
5454 TypeInfo.Align = getParamTypeAlignment(Ty); in EmitVAArg()
5464 if (const ComplexType *CTy = Ty->getAs<ComplexType>()) { in EmitVAArg()
5467 return complexTempStructure(CGF, VAListAddr, Ty, SlotSize, EltSize, CTy); in EmitVAArg()
5471 return emitVoidPtrVAArg(CGF, VAListAddr, Ty, /*Indirect*/ false, in EmitVAArg()
5518 ABIArgInfo coerceIllegalVector(QualType Ty) const;
5519 bool isHomogeneousAggregateBaseType(QualType Ty) const override;
5520 bool isHomogeneousAggregateSmallEnough(const Type *Ty,
5524 bool isIllegalVectorType(QualType Ty) const;
5536 Address EmitDarwinVAArg(Address VAListAddr, QualType Ty,
5539 Address EmitAAPCSVAArg(Address VAListAddr, QualType Ty,
5543 QualType Ty) const override { in EmitVAArg()
5544 llvm::Type *BaseTy = CGF.ConvertType(Ty); in EmitVAArg()
5549 return Kind == Win64 ? EmitMSVAArg(CGF, VAListAddr, Ty) in EmitVAArg()
5550 : isDarwinPCS() ? EmitDarwinVAArg(VAListAddr, Ty, CGF) in EmitVAArg()
5551 : EmitAAPCSVAArg(VAListAddr, Ty, CGF); in EmitVAArg()
5555 QualType Ty) const override;
5624 llvm::Type *Ty) const override { in isScalarizableAsmOperand()
5626 auto *ST = dyn_cast<llvm::StructType>(Ty); in isScalarizableAsmOperand()
5634 return TargetCodeGenInfo::isScalarizableAsmOperand(CGF, Ty); in isScalarizableAsmOperand()
5666 ABIArgInfo AArch64ABIInfo::coerceIllegalVector(QualType Ty) const { in coerceIllegalVector()
5667 assert(Ty->isVectorType() && "expected vector type!"); in coerceIllegalVector()
5669 const auto *VT = Ty->castAs<VectorType>(); in coerceIllegalVector()
5727 uint64_t Size = getContext().getTypeSize(Ty); in coerceIllegalVector()
5747 return getNaturalAlignIndirect(Ty, /*ByVal=*/false); in coerceIllegalVector()
5751 AArch64ABIInfo::classifyArgumentType(QualType Ty, bool IsVariadic, in classifyArgumentType() argument
5753 Ty = useFirstFieldIfTransparentUnion(Ty); in classifyArgumentType()
5756 if (isIllegalVectorType(Ty)) in classifyArgumentType()
5757 return coerceIllegalVector(Ty); in classifyArgumentType()
5759 if (!isAggregateTypeForABI(Ty)) { in classifyArgumentType()
5761 if (const EnumType *EnumTy = Ty->getAs<EnumType>()) in classifyArgumentType()
5762 Ty = EnumTy->getDecl()->getIntegerType(); in classifyArgumentType()
5764 if (const auto *EIT = Ty->getAs<BitIntType>()) in classifyArgumentType()
5766 return getNaturalAlignIndirect(Ty); in classifyArgumentType()
5768 return (isPromotableIntegerTypeForABI(Ty) && isDarwinPCS() in classifyArgumentType()
5769 ? ABIArgInfo::getExtend(Ty) in classifyArgumentType()
5775 if (CGCXXABI::RecordArgABI RAA = getRecordArgABI(Ty, getCXXABI())) { in classifyArgumentType()
5776 return getNaturalAlignIndirect(Ty, /*ByVal=*/RAA == in classifyArgumentType()
5782 uint64_t Size = getContext().getTypeSize(Ty); in classifyArgumentType()
5783 bool IsEmpty = isEmptyRecord(getContext(), Ty, true); in classifyArgumentType()
5802 if (!IsWinVariadic && isHomogeneousAggregate(Ty, Base, Members)) { in classifyArgumentType()
5810 getContext().getTypeUnadjustedAlignInChars(Ty).getQuantity(); in classifyArgumentType()
5823 return coerceToIntArray(Ty, getContext(), getVMContext()); in classifyArgumentType()
5827 Alignment = getContext().getTypeUnadjustedAlign(Ty); in classifyArgumentType()
5830 Alignment = std::max(getContext().getTypeAlign(Ty), in classifyArgumentType()
5843 return getNaturalAlignIndirect(Ty, /*ByVal=*/false); in classifyArgumentType()
5922 bool AArch64ABIInfo::isIllegalVectorType(QualType Ty) const { in isIllegalVectorType()
5923 if (const VectorType *VT = Ty->getAs<VectorType>()) { in isIllegalVectorType()
5961 bool AArch64ABIInfo::isHomogeneousAggregateBaseType(QualType Ty) const { in isHomogeneousAggregateBaseType()
5966 if (const BuiltinType *BT = Ty->getAs<BuiltinType>()) { in isHomogeneousAggregateBaseType()
5969 } else if (const VectorType *VT = Ty->getAs<VectorType>()) { in isHomogeneousAggregateBaseType()
5992 Address AArch64ABIInfo::EmitAAPCSVAArg(Address VAListAddr, QualType Ty, in EmitAAPCSVAArg() argument
5994 ABIArgInfo AI = classifyArgumentType(Ty, /*IsVariadic=*/true, in EmitAAPCSVAArg()
5998 llvm::Type *BaseTy = CGF.ConvertType(Ty); in EmitAAPCSVAArg()
6027 CharUnits TySize = getContext().getTypeSizeInChars(Ty); in EmitAAPCSVAArg()
6028 CharUnits TyAlign = getContext().getTypeUnadjustedAlignInChars(Ty); in EmitAAPCSVAArg()
6112 llvm::Type *MemTy = CGF.ConvertTypeForMem(Ty), *ElementTy = MemTy; in EmitAAPCSVAArg()
6122 bool IsHFA = isHomogeneousAggregate(Ty, Base, NumMembers); in EmitAAPCSVAArg()
6160 (IsHFA || !isAggregateTypeForABI(Ty)) && in EmitAAPCSVAArg()
6213 if (CGF.CGM.getDataLayout().isBigEndian() && !isAggregateTypeForABI(Ty) && in EmitAAPCSVAArg()
6238 Address AArch64ABIInfo::EmitDarwinVAArg(Address VAListAddr, QualType Ty, in EmitDarwinVAArg() argument
6243 if (!isAggregateTypeForABI(Ty) && !isIllegalVectorType(Ty)) in EmitDarwinVAArg()
6244 return EmitVAArgInstr(CGF, VAListAddr, Ty, ABIArgInfo::getDirect()); in EmitDarwinVAArg()
6250 if (isEmptyRecord(getContext(), Ty, true)) { in EmitDarwinVAArg()
6253 Addr = CGF.Builder.CreateElementBitCast(Addr, CGF.ConvertTypeForMem(Ty)); in EmitDarwinVAArg()
6259 auto TyInfo = getContext().getTypeInfoInChars(Ty); in EmitDarwinVAArg()
6267 IsIndirect = !isHomogeneousAggregate(Ty, Base, Members); in EmitDarwinVAArg()
6270 return emitVoidPtrVAArg(CGF, VAListAddr, Ty, IsIndirect, in EmitDarwinVAArg()
6275 QualType Ty) const { in EmitMSVAArg()
6279 if (isAggregateTypeForABI(Ty) && getContext().getTypeSize(Ty) > 128) in EmitMSVAArg()
6282 return emitVoidPtrVAArg(CGF, VAListAddr, Ty, IsIndirect, in EmitMSVAArg()
6283 CGF.getContext().getTypeInfoInChars(Ty), in EmitMSVAArg()
6352 ABIArgInfo classifyHomogeneousAggregate(QualType Ty, const Type *Base,
6354 ABIArgInfo coerceIllegalVector(QualType Ty) const;
6355 bool isIllegalVectorType(QualType Ty) const;
6356 bool containsAnyFP16Vectors(QualType Ty) const;
6358 bool isHomogeneousAggregateBaseType(QualType Ty) const override;
6359 bool isHomogeneousAggregateSmallEnough(const Type *Ty,
6368 QualType Ty) const override;
6572 ABIArgInfo ARMABIInfo::coerceIllegalVector(QualType Ty) const { in coerceIllegalVector()
6573 uint64_t Size = getContext().getTypeSize(Ty); in coerceIllegalVector()
6584 return getNaturalAlignIndirect(Ty, /*ByVal=*/false); in coerceIllegalVector()
6587 ABIArgInfo ARMABIInfo::classifyHomogeneousAggregate(QualType Ty, in classifyHomogeneousAggregate() argument
6594 if (!getTarget().hasLegalHalfType() && containsAnyFP16Vectors(Ty)) { in classifyHomogeneousAggregate()
6598 llvm::Type *Ty = llvm::ArrayType::get(NewVecTy, Members); in classifyHomogeneousAggregate() local
6599 return ABIArgInfo::getDirect(Ty, 0, nullptr, false); in classifyHomogeneousAggregate()
6607 Align = getContext().getTypeUnadjustedAlignInChars(Ty).getQuantity(); in classifyHomogeneousAggregate()
6614 ABIArgInfo ARMABIInfo::classifyArgumentType(QualType Ty, bool isVariadic, in classifyArgumentType() argument
6627 Ty = useFirstFieldIfTransparentUnion(Ty); in classifyArgumentType()
6630 if (isIllegalVectorType(Ty)) in classifyArgumentType()
6631 return coerceIllegalVector(Ty); in classifyArgumentType()
6633 if (!isAggregateTypeForABI(Ty)) { in classifyArgumentType()
6635 if (const EnumType *EnumTy = Ty->getAs<EnumType>()) { in classifyArgumentType()
6636 Ty = EnumTy->getDecl()->getIntegerType(); in classifyArgumentType()
6639 if (const auto *EIT = Ty->getAs<BitIntType>()) in classifyArgumentType()
6641 return getNaturalAlignIndirect(Ty, /*ByVal=*/true); in classifyArgumentType()
6643 return (isPromotableIntegerTypeForABI(Ty) ? ABIArgInfo::getExtend(Ty) in classifyArgumentType()
6647 if (CGCXXABI::RecordArgABI RAA = getRecordArgABI(Ty, getCXXABI())) { in classifyArgumentType()
6648 return getNaturalAlignIndirect(Ty, RAA == CGCXXABI::RAA_DirectInMemory); in classifyArgumentType()
6652 if (isEmptyRecord(getContext(), Ty, true)) in classifyArgumentType()
6660 if (isHomogeneousAggregate(Ty, Base, Members)) in classifyArgumentType()
6661 return classifyHomogeneousAggregate(Ty, Base, Members); in classifyArgumentType()
6668 if (isHomogeneousAggregate(Ty, Base, Members)) { in classifyArgumentType()
6670 llvm::Type *Ty = in classifyArgumentType() local
6672 return ABIArgInfo::getDirect(Ty, 0, nullptr, false); in classifyArgumentType()
6677 getContext().getTypeSizeInChars(Ty) > CharUnits::fromQuantity(16)) { in classifyArgumentType()
6682 CharUnits::fromQuantity(getContext().getTypeAlign(Ty) / 8), false); in classifyArgumentType()
6693 TyAlign = getContext().getTypeUnadjustedAlignInChars(Ty).getQuantity(); in classifyArgumentType()
6696 TyAlign = getContext().getTypeAlignInChars(Ty).getQuantity(); in classifyArgumentType()
6698 if (getContext().getTypeSizeInChars(Ty) > CharUnits::fromQuantity(64)) { in classifyArgumentType()
6708 return coerceToIntArray(Ty, getContext(), getVMContext()); in classifyArgumentType()
6718 SizeRegs = (getContext().getTypeSize(Ty) + 31) / 32; in classifyArgumentType()
6721 SizeRegs = (getContext().getTypeSize(Ty) + 63) / 64; in classifyArgumentType()
6727 static bool isIntegerLikeType(QualType Ty, ASTContext &Context, in isIntegerLikeType() argument
6733 uint64_t Size = Context.getTypeSize(Ty); in isIntegerLikeType()
6740 if (Ty->isVectorType()) in isIntegerLikeType()
6744 if (Ty->isRealFloatingType()) in isIntegerLikeType()
6748 if (Ty->getAs<BuiltinType>() || Ty->isPointerType()) in isIntegerLikeType()
6752 if (const ComplexType *CT = Ty->getAs<ComplexType>()) in isIntegerLikeType()
6759 const RecordType *RT = Ty->getAs<RecordType>(); in isIntegerLikeType()
6920 bool ARMABIInfo::isIllegalVectorType(QualType Ty) const { in isIllegalVectorType()
6921 if (const VectorType *VT = Ty->getAs<VectorType> ()) { in isIllegalVectorType()
6959 bool ARMABIInfo::containsAnyFP16Vectors(QualType Ty) const { in containsAnyFP16Vectors()
6960 if (const ConstantArrayType *AT = getContext().getAsConstantArrayType(Ty)) { in containsAnyFP16Vectors()
6965 } else if (const RecordType *RT = Ty->getAs<RecordType>()) { in containsAnyFP16Vectors()
6982 if (const VectorType *VT = Ty->getAs<VectorType>()) in containsAnyFP16Vectors()
7004 bool ARMABIInfo::isHomogeneousAggregateBaseType(QualType Ty) const { in isHomogeneousAggregateBaseType()
7007 if (const BuiltinType *BT = Ty->getAs<BuiltinType>()) { in isHomogeneousAggregateBaseType()
7012 } else if (const VectorType *VT = Ty->getAs<VectorType>()) { in isHomogeneousAggregateBaseType()
7045 QualType Ty) const { in EmitVAArg()
7049 if (isEmptyRecord(getContext(), Ty, true)) { in EmitVAArg()
7053 return CGF.Builder.CreateElementBitCast(Addr, CGF.ConvertTypeForMem(Ty)); in EmitVAArg()
7056 CharUnits TySize = getContext().getTypeSizeInChars(Ty); in EmitVAArg()
7057 CharUnits TyAlignForABI = getContext().getTypeUnadjustedAlignInChars(Ty); in EmitVAArg()
7063 if (TySize > CharUnits::fromQuantity(16) && isIllegalVectorType(Ty)) { in EmitVAArg()
7070 !isHomogeneousAggregate(Ty, Base, Members)) { in EmitVAArg()
7090 return emitVoidPtrVAArg(CGF, VAListAddr, Ty, IsIndirect, TyInfo, in EmitVAArg()
7110 ABIArgInfo classifyArgumentType(QualType Ty) const;
7114 QualType Ty) const override;
7116 ABIArgInfo coerceToIntArrayWithLimit(QualType Ty, unsigned MaxSize) const;
7214 ABIArgInfo NVPTXABIInfo::coerceToIntArrayWithLimit(QualType Ty, in coerceToIntArrayWithLimit() argument
7217 const uint64_t Size = getContext().getTypeSize(Ty); in coerceToIntArrayWithLimit()
7218 const uint64_t Alignment = getContext().getTypeAlign(Ty); in coerceToIntArrayWithLimit()
7245 ABIArgInfo NVPTXABIInfo::classifyArgumentType(QualType Ty) const { in classifyArgumentType()
7247 if (const EnumType *EnumTy = Ty->getAs<EnumType>()) in classifyArgumentType()
7248 Ty = EnumTy->getDecl()->getIntegerType(); in classifyArgumentType()
7251 if (isAggregateTypeForABI(Ty)) { in classifyArgumentType()
7255 if (Ty->isCUDADeviceBuiltinSurfaceType()) in classifyArgumentType()
7258 if (Ty->isCUDADeviceBuiltinTextureType()) in classifyArgumentType()
7262 return getNaturalAlignIndirect(Ty, /* byval */ true); in classifyArgumentType()
7265 if (const auto *EIT = Ty->getAs<BitIntType>()) { in classifyArgumentType()
7269 return getNaturalAlignIndirect(Ty, /* byval */ true); in classifyArgumentType()
7272 return (isPromotableIntegerTypeForABI(Ty) ? ABIArgInfo::getExtend(Ty) in classifyArgumentType()
7290 QualType Ty) const { in EmitVAArg()
7392 bool isPromotableIntegerTypeForABI(QualType Ty) const;
7393 bool isCompoundType(QualType Ty) const;
7394 bool isVectorArgumentType(QualType Ty) const;
7395 bool isFPArgumentType(QualType Ty) const;
7396 QualType GetSingleElementType(QualType Ty) const;
7409 QualType Ty) const override;
7434 llvm::Type *Ty = V->getType(); in testFPKind() local
7435 if (Ty->isFloatTy() || Ty->isDoubleTy() || Ty->isFP128Ty()) { in testFPKind()
7439 llvm::Intrinsic::getDeclaration(&M, llvm::Intrinsic::s390_tdc, Ty); in testFPKind()
7470 bool SystemZABIInfo::isPromotableIntegerTypeForABI(QualType Ty) const { in isPromotableIntegerTypeForABI()
7472 if (const EnumType *EnumTy = Ty->getAs<EnumType>()) in isPromotableIntegerTypeForABI()
7473 Ty = EnumTy->getDecl()->getIntegerType(); in isPromotableIntegerTypeForABI()
7476 if (ABIInfo::isPromotableIntegerTypeForABI(Ty)) in isPromotableIntegerTypeForABI()
7479 if (const auto *EIT = Ty->getAs<BitIntType>()) in isPromotableIntegerTypeForABI()
7484 if (const BuiltinType *BT = Ty->getAs<BuiltinType>()) in isPromotableIntegerTypeForABI()
7495 bool SystemZABIInfo::isCompoundType(QualType Ty) const { in isCompoundType()
7496 return (Ty->isAnyComplexType() || in isCompoundType()
7497 Ty->isVectorType() || in isCompoundType()
7498 isAggregateTypeForABI(Ty)); in isCompoundType()
7501 bool SystemZABIInfo::isVectorArgumentType(QualType Ty) const { in isVectorArgumentType()
7503 Ty->isVectorType() && in isVectorArgumentType()
7504 getContext().getTypeSize(Ty) <= 128); in isVectorArgumentType()
7507 bool SystemZABIInfo::isFPArgumentType(QualType Ty) const { in isFPArgumentType()
7511 if (const BuiltinType *BT = Ty->getAs<BuiltinType>()) in isFPArgumentType()
7523 QualType SystemZABIInfo::GetSingleElementType(QualType Ty) const { in GetSingleElementType()
7524 const RecordType *RT = Ty->getAs<RecordType>(); in GetSingleElementType()
7540 return Ty; in GetSingleElementType()
7557 return Ty; in GetSingleElementType()
7567 return Ty; in GetSingleElementType()
7571 QualType Ty) const { in EmitVAArg()
7583 Ty = getContext().getCanonicalType(Ty); in EmitVAArg()
7584 auto TyInfo = getContext().getTypeInfoInChars(Ty); in EmitVAArg()
7585 llvm::Type *ArgTy = CGF.ConvertTypeForMem(Ty); in EmitVAArg()
7587 ABIArgInfo AI = classifyArgumentType(Ty); in EmitVAArg()
7737 ABIArgInfo SystemZABIInfo::classifyArgumentType(QualType Ty) const { in classifyArgumentType()
7739 if (CGCXXABI::RecordArgABI RAA = getRecordArgABI(Ty, getCXXABI())) in classifyArgumentType()
7740 return getNaturalAlignIndirect(Ty, RAA == CGCXXABI::RAA_DirectInMemory); in classifyArgumentType()
7743 if (isPromotableIntegerTypeForABI(Ty)) in classifyArgumentType()
7744 return ABIArgInfo::getExtend(Ty); in classifyArgumentType()
7749 uint64_t Size = getContext().getTypeSize(Ty); in classifyArgumentType()
7750 QualType SingleElementTy = GetSingleElementType(Ty); in classifyArgumentType()
7757 return getNaturalAlignIndirect(Ty, /*ByVal=*/false); in classifyArgumentType()
7760 if (const RecordType *RT = Ty->getAs<RecordType>()) { in classifyArgumentType()
7765 return getNaturalAlignIndirect(Ty, /*ByVal=*/false); in classifyArgumentType()
7781 if (isCompoundType(Ty)) in classifyArgumentType()
7782 return getNaturalAlignIndirect(Ty, /*ByVal=*/false); in classifyArgumentType()
7827 QualType Ty) const override { in EmitVAArg()
7828 return EmitVAArgInstr(CGF, VAListAddr, Ty, classifyArgumentType(Ty)); in EmitVAArg()
7874 llvm::Type* HandleAggregates(QualType Ty, uint64_t TySize) const;
7886 QualType Ty) const override;
7887 ABIArgInfo extendType(QualType Ty) const;
7976 llvm::Type* MipsABIInfo::HandleAggregates(QualType Ty, uint64_t TySize) const { in HandleAggregates() argument
7984 if (Ty->isComplexType()) in HandleAggregates()
7985 return CGT.ConvertType(Ty); in HandleAggregates()
7987 const RecordType *RT = Ty->getAs<RecordType>(); in HandleAggregates()
8007 const QualType Ty = i->getType(); in HandleAggregates() local
8008 const BuiltinType *BT = Ty->getAs<BuiltinType>(); in HandleAggregates()
8041 MipsABIInfo::classifyArgumentType(QualType Ty, uint64_t &Offset) const { in classifyArgumentType() argument
8042 Ty = useFirstFieldIfTransparentUnion(Ty); in classifyArgumentType()
8045 uint64_t TySize = getContext().getTypeSize(Ty); in classifyArgumentType()
8046 uint64_t Align = getContext().getTypeAlign(Ty) / 8; in classifyArgumentType()
8053 if (isAggregateTypeForABI(Ty) || Ty->isVectorType()) { in classifyArgumentType()
8058 if (CGCXXABI::RecordArgABI RAA = getRecordArgABI(Ty, getCXXABI())) { in classifyArgumentType()
8060 return getNaturalAlignIndirect(Ty, RAA == CGCXXABI::RAA_DirectInMemory); in classifyArgumentType()
8067 ABIArgInfo::getDirect(HandleAggregates(Ty, TySize), 0, in classifyArgumentType()
8074 if (const EnumType *EnumTy = Ty->getAs<EnumType>()) in classifyArgumentType()
8075 Ty = EnumTy->getDecl()->getIntegerType(); in classifyArgumentType()
8078 if (const auto *EIT = Ty->getAs<BitIntType>()) in classifyArgumentType()
8082 return getNaturalAlignIndirect(Ty); in classifyArgumentType()
8085 if (Ty->isIntegralOrEnumerationType()) in classifyArgumentType()
8086 return extendType(Ty); in classifyArgumentType()
8199 QualType Ty = OrigTy; in EmitVAArg() local
8206 if ((Ty->isIntegerType() && in EmitVAArg()
8207 getContext().getIntWidth(Ty) < SlotSizeInBits) || in EmitVAArg()
8208 (Ty->isPointerType() && PtrWidth < SlotSizeInBits)) { in EmitVAArg()
8210 Ty = getContext().getIntTypeForBitwidth(SlotSizeInBits, in EmitVAArg()
8211 Ty->isSignedIntegerType()); in EmitVAArg()
8214 auto TyInfo = getContext().getTypeInfoInChars(Ty); in EmitVAArg()
8224 Address Addr = emitVoidPtrVAArg(CGF, VAListAddr, Ty, /*indirect*/ false, in EmitVAArg()
8248 ABIArgInfo MipsABIInfo::extendType(QualType Ty) const { in extendType()
8249 int TySize = getContext().getTypeSize(Ty); in extendType()
8252 if (Ty->isUnsignedIntegerOrEnumerationType() && TySize == 32) in extendType()
8253 return ABIArgInfo::getSignExtend(Ty); in extendType()
8255 return ABIArgInfo::getExtend(Ty); in extendType()
8343 ABIArgInfo classifyReturnType(QualType Ty, bool &LargeRet) const { in classifyReturnType() argument
8344 if (isAggregateTypeForABI(Ty)) { in classifyReturnType()
8349 if (getContext().getTypeSize(Ty) <= RetRegs * 8) in classifyReturnType()
8354 return getNaturalAlignIndirect(Ty); in classifyReturnType()
8357 return DefaultABIInfo::classifyReturnType(Ty); in classifyReturnType()
8360 ABIArgInfo classifyArgumentType(QualType Ty, unsigned &NumRegs) const { in classifyArgumentType() argument
8361 unsigned TySize = getContext().getTypeSize(Ty); in classifyArgumentType()
8366 return ABIArgInfo::getExtend(Ty); in classifyArgumentType()
8534 QualType Ty) const override;
8536 QualType Ty) const;
8538 QualType Ty) const;
8540 QualType Ty) const;
8597 ABIArgInfo HexagonABIInfo::classifyArgumentType(QualType Ty, in classifyArgumentType() argument
8599 if (!isAggregateTypeForABI(Ty)) { in classifyArgumentType()
8601 if (const EnumType *EnumTy = Ty->getAs<EnumType>()) in classifyArgumentType()
8602 Ty = EnumTy->getDecl()->getIntegerType(); in classifyArgumentType()
8604 uint64_t Size = getContext().getTypeSize(Ty); in classifyArgumentType()
8608 if (Size > 64 && Ty->isBitIntType()) in classifyArgumentType()
8609 return getNaturalAlignIndirect(Ty, /*ByVal=*/true); in classifyArgumentType()
8611 return isPromotableIntegerTypeForABI(Ty) ? ABIArgInfo::getExtend(Ty) in classifyArgumentType()
8615 if (CGCXXABI::RecordArgABI RAA = getRecordArgABI(Ty, getCXXABI())) in classifyArgumentType()
8616 return getNaturalAlignIndirect(Ty, RAA == CGCXXABI::RAA_DirectInMemory); in classifyArgumentType()
8619 if (isEmptyRecord(getContext(), Ty, true)) in classifyArgumentType()
8622 uint64_t Size = getContext().getTypeSize(Ty); in classifyArgumentType()
8623 unsigned Align = getContext().getTypeAlign(Ty); in classifyArgumentType()
8626 return getNaturalAlignIndirect(Ty, /*ByVal=*/true); in classifyArgumentType()
8636 return DefaultABIInfo::classifyArgumentType(Ty); in classifyArgumentType()
8687 QualType Ty) const { in EmitVAArgFromMemory()
8694 uint64_t Align = CGF.getContext().getTypeAlign(Ty) / 8; in EmitVAArgFromMemory()
8718 llvm::Type *PTy = CGF.ConvertTypeForMem(Ty); in EmitVAArgFromMemory()
8725 uint64_t Offset = llvm::alignTo(CGF.getContext().getTypeSize(Ty) / 8, 4); in EmitVAArgFromMemory()
8738 QualType Ty) const { in EmitVAArgForHexagon()
8745 uint64_t TyAlign = CGF.getContext().getTypeAlign(Ty) / 8; in EmitVAArgForHexagon()
8755 CGF.ConvertType(Ty)); in EmitVAArgForHexagon()
8757 uint64_t Offset = llvm::alignTo(CGF.getContext().getTypeSize(Ty) / 8, 4); in EmitVAArgForHexagon()
8767 QualType Ty) const { in EmitVAArgForHexagonLinux()
8768 int ArgSize = CGF.getContext().getTypeSize(Ty) / 8; in EmitVAArgForHexagonLinux()
8771 return EmitVAArgFromMemory(CGF, VAListAddr, Ty); in EmitVAArgForHexagonLinux()
8778 Ty = CGF.getContext().getCanonicalType(Ty); in EmitVAArgForHexagonLinux()
8779 (void)classifyArgumentType(Ty, &RegsLeft); in EmitVAArgForHexagonLinux()
8788 ArgSize = (CGF.getContext().getTypeSize(Ty) <= 32) ? 4 : 8; in EmitVAArgForHexagonLinux()
8789 int ArgAlign = (CGF.getContext().getTypeSize(Ty) <= 32) ? 4 : 8; in EmitVAArgForHexagonLinux()
8845 llvm::Type *PTy = CGF.ConvertType(Ty); in EmitVAArgForHexagonLinux()
8898 llvm::Type *OverflowPTy = CGF.ConvertTypeForMem(Ty); in EmitVAArgForHexagonLinux()
8908 llvm::Type *MemTy = CGF.ConvertTypeForMem(Ty); in EmitVAArgForHexagonLinux()
8918 QualType Ty) const { in EmitVAArg()
8921 return EmitVAArgForHexagonLinux(CGF, VAListAddr, Ty); in EmitVAArg()
8923 return EmitVAArgForHexagon(CGF, VAListAddr, Ty); in EmitVAArg()
8935 bool shouldUseInReg(QualType Ty, CCState &State) const;
8953 ABIArgInfo getIndirectResult(QualType Ty, bool ByVal, CCState &State) const;
8958 bool LanaiABIInfo::shouldUseInReg(QualType Ty, CCState &State) const { in shouldUseInReg() argument
8959 unsigned Size = getContext().getTypeSize(Ty); in shouldUseInReg()
8975 ABIArgInfo LanaiABIInfo::getIndirectResult(QualType Ty, bool ByVal, in getIndirectResult() argument
8980 return getNaturalAlignIndirectInReg(Ty); in getIndirectResult()
8982 return getNaturalAlignIndirect(Ty, false); in getIndirectResult()
8987 unsigned TypeAlign = getContext().getTypeAlign(Ty) / 8; in getIndirectResult()
8993 ABIArgInfo LanaiABIInfo::classifyArgumentType(QualType Ty, in classifyArgumentType() argument
8996 const RecordType *RT = Ty->getAs<RecordType>(); in classifyArgumentType()
9000 return getIndirectResult(Ty, /*ByVal=*/false, State); in classifyArgumentType()
9002 return getNaturalAlignIndirect(Ty, /*ByVal=*/true); in classifyArgumentType()
9006 if (isAggregateTypeForABI(Ty)) { in classifyArgumentType()
9009 return getIndirectResult(Ty, /*ByVal=*/true, State); in classifyArgumentType()
9012 if (isEmptyRecord(getContext(), Ty, true)) in classifyArgumentType()
9016 unsigned SizeInRegs = (getContext().getTypeSize(Ty) + 31) / 32; in classifyArgumentType()
9026 return getIndirectResult(Ty, true, State); in classifyArgumentType()
9030 if (const auto *EnumTy = Ty->getAs<EnumType>()) in classifyArgumentType()
9031 Ty = EnumTy->getDecl()->getIntegerType(); in classifyArgumentType()
9033 bool InReg = shouldUseInReg(Ty, State); in classifyArgumentType()
9036 if (const auto *EIT = Ty->getAs<BitIntType>()) in classifyArgumentType()
9038 return getIndirectResult(Ty, /*ByVal=*/true, State); in classifyArgumentType()
9040 if (isPromotableIntegerTypeForABI(Ty)) { in classifyArgumentType()
9043 return ABIArgInfo::getExtend(Ty); in classifyArgumentType()
9068 unsigned numRegsForType(QualType Ty) const;
9070 bool isHomogeneousAggregateBaseType(QualType Ty) const override;
9075 llvm::Type *coerceKernelArgumentType(llvm::Type *Ty, unsigned FromAS, in coerceKernelArgumentType() argument
9078 auto *PtrTy = llvm::dyn_cast<llvm::PointerType>(Ty); in coerceKernelArgumentType()
9081 return Ty; in coerceKernelArgumentType()
9089 ABIArgInfo classifyKernelArgumentType(QualType Ty) const;
9090 ABIArgInfo classifyArgumentType(QualType Ty, unsigned &NumRegsLeft) const;
9094 QualType Ty) const override;
9097 bool AMDGPUABIInfo::isHomogeneousAggregateBaseType(QualType Ty) const { in isHomogeneousAggregateBaseType()
9110 unsigned AMDGPUABIInfo::numRegsForType(QualType Ty) const { in numRegsForType()
9113 if (const VectorType *VT = Ty->getAs<VectorType>()) { in numRegsForType()
9127 if (const RecordType *RT = Ty->getAs<RecordType>()) { in numRegsForType()
9139 return (getContext().getTypeSize(Ty) + 31) / 32; in numRegsForType()
9159 QualType Ty) const { in EmitVAArg()
9206 ABIArgInfo AMDGPUABIInfo::classifyKernelArgumentType(QualType Ty) const { in classifyKernelArgumentType()
9207 Ty = useFirstFieldIfTransparentUnion(Ty); in classifyKernelArgumentType()
9211 if (const Type *SeltTy = isSingleElementStruct(Ty, getContext())) in classifyKernelArgumentType()
9212 Ty = QualType(SeltTy, 0); in classifyKernelArgumentType()
9214 llvm::Type *OrigLTy = CGT.ConvertType(Ty); in classifyKernelArgumentType()
9229 isAggregateTypeForABI(Ty)) { in classifyKernelArgumentType()
9231 getContext().getTypeAlignInChars(Ty), in classifyKernelArgumentType()
9242 ABIArgInfo AMDGPUABIInfo::classifyArgumentType(QualType Ty, in classifyArgumentType() argument
9246 Ty = useFirstFieldIfTransparentUnion(Ty); in classifyArgumentType()
9248 if (isAggregateTypeForABI(Ty)) { in classifyArgumentType()
9251 if (auto RAA = getRecordArgABI(Ty, getCXXABI())) in classifyArgumentType()
9252 return getNaturalAlignIndirect(Ty, RAA == CGCXXABI::RAA_DirectInMemory); in classifyArgumentType()
9255 if (isEmptyRecord(getContext(), Ty, true)) in classifyArgumentType()
9261 if (const Type *SeltTy = isSingleElementStruct(Ty, getContext())) in classifyArgumentType()
9264 if (const RecordType *RT = Ty->getAs<RecordType>()) { in classifyArgumentType()
9267 return DefaultABIInfo::classifyArgumentType(Ty); in classifyArgumentType()
9271 uint64_t Size = getContext().getTypeSize(Ty); in classifyArgumentType()
9288 unsigned NumRegs = numRegsForType(Ty); in classifyArgumentType()
9297 ABIArgInfo ArgInfo = DefaultABIInfo::classifyArgumentType(Ty); in classifyArgumentType()
9299 unsigned NumRegs = numRegsForType(Ty); in classifyArgumentType()
9574 SparcV8ABIInfo::classifyReturnType(QualType Ty) const { in classifyReturnType()
9575 if (Ty->isAnyComplexType()) { in classifyReturnType()
9579 return DefaultABIInfo::classifyReturnType(Ty); in classifyReturnType()
9655 QualType Ty) const override;
9705 void addFloat(uint64_t Offset, llvm::Type *Ty, unsigned Bits) { in addFloat()
9713 Elems.push_back(Ty); in addFloat()
9750 bool isUsableType(llvm::StructType *Ty) const { in isUsableType()
9751 return llvm::makeArrayRef(Elems) == Ty->elements(); in isUsableType()
9766 SparcV9ABIInfo::classifyType(QualType Ty, unsigned SizeLimit) const { in classifyType() argument
9767 if (Ty->isVoidType()) in classifyType()
9770 uint64_t Size = getContext().getTypeSize(Ty); in classifyType()
9775 return getNaturalAlignIndirect(Ty, /*ByVal=*/false); in classifyType()
9778 if (const EnumType *EnumTy = Ty->getAs<EnumType>()) in classifyType()
9779 Ty = EnumTy->getDecl()->getIntegerType(); in classifyType()
9782 if (Size < 64 && Ty->isIntegerType()) in classifyType()
9783 return ABIArgInfo::getExtend(Ty); in classifyType()
9785 if (const auto *EIT = Ty->getAs<BitIntType>()) in classifyType()
9787 return ABIArgInfo::getExtend(Ty); in classifyType()
9790 if (!isAggregateTypeForABI(Ty)) in classifyType()
9795 if (CGCXXABI::RecordArgABI RAA = getRecordArgABI(Ty, getCXXABI())) in classifyType()
9796 return getNaturalAlignIndirect(Ty, RAA == CGCXXABI::RAA_DirectInMemory); in classifyType()
9800 llvm::StructType *StrTy = dyn_cast<llvm::StructType>(CGT.ConvertType(Ty)); in classifyType()
9818 QualType Ty) const { in EmitVAArg()
9819 ABIArgInfo AI = classifyType(Ty, 16 * 8); in EmitVAArg()
9820 llvm::Type *ArgTy = CGT.ConvertType(Ty); in EmitVAArg()
9831 auto TypeInfo = getContext().getTypeInfoInChars(Ty); in EmitVAArg()
9950 QualType Ty) const override;
9952 void updateState(const ABIArgInfo &Info, QualType Ty, CCState &State) const { in updateState() argument
9958 unsigned sz = (getContext().getTypeSize(Ty) + 31) / 32; in updateState()
9980 ABIArgInfo getIndirectByRef(QualType Ty, bool HasFreeRegs) const;
9981 ABIArgInfo getIndirectByValue(QualType Ty) const;
9982 ABIArgInfo classifyArgumentType(QualType Ty, uint8_t FreeRegs) const;
9993 ABIArgInfo ARCABIInfo::getIndirectByRef(QualType Ty, bool HasFreeRegs) const { in getIndirectByRef() argument
9994 return HasFreeRegs ? getNaturalAlignIndirectInReg(Ty) : in getIndirectByRef()
9995 getNaturalAlignIndirect(Ty, false); in getIndirectByRef()
9998 ABIArgInfo ARCABIInfo::getIndirectByValue(QualType Ty) const { in getIndirectByValue()
10001 unsigned TypeAlign = getContext().getTypeAlign(Ty) / 8; in getIndirectByValue()
10007 QualType Ty) const { in EmitVAArg()
10008 return emitVoidPtrVAArg(CGF, VAListAddr, Ty, /*indirect*/ false, in EmitVAArg()
10009 getContext().getTypeInfoInChars(Ty), in EmitVAArg()
10013 ABIArgInfo ARCABIInfo::classifyArgumentType(QualType Ty, in classifyArgumentType() argument
10016 const RecordType *RT = Ty->getAs<RecordType>(); in classifyArgumentType()
10020 return getIndirectByRef(Ty, FreeRegs > 0); in classifyArgumentType()
10023 return getIndirectByValue(Ty); in classifyArgumentType()
10027 if (const EnumType *EnumTy = Ty->getAs<EnumType>()) in classifyArgumentType()
10028 Ty = EnumTy->getDecl()->getIntegerType(); in classifyArgumentType()
10030 auto SizeInRegs = llvm::alignTo(getContext().getTypeSize(Ty), 32) / 32; in classifyArgumentType()
10032 if (isAggregateTypeForABI(Ty)) { in classifyArgumentType()
10035 return getIndirectByValue(Ty); in classifyArgumentType()
10038 if (isEmptyRecord(getContext(), Ty, true)) in classifyArgumentType()
10052 if (const auto *EIT = Ty->getAs<BitIntType>()) in classifyArgumentType()
10054 return getIndirectByValue(Ty); in classifyArgumentType()
10056 return isPromotableIntegerTypeForABI(Ty) in classifyArgumentType()
10057 ? (FreeRegs >= SizeInRegs ? ABIArgInfo::getExtendInReg(Ty) in classifyArgumentType()
10058 : ABIArgInfo::getExtend(Ty)) in classifyArgumentType()
10179 QualType Ty) const override;
10200 QualType Ty) const { in EmitVAArg()
10209 ABIArgInfo AI = classifyArgumentType(Ty); in EmitVAArg()
10210 CharUnits TypeAlign = getContext().getTypeAlignInChars(Ty); in EmitVAArg()
10211 llvm::Type *ArgTy = CGT.ConvertType(Ty); in EmitVAArg()
10409 ABIArgInfo classifyKernelArgumentType(QualType Ty) const;
10440 ABIArgInfo SPIRVABIInfo::classifyKernelArgumentType(QualType Ty) const { in classifyKernelArgumentType()
10445 llvm::Type *LTy = CGT.ConvertType(Ty); in classifyKernelArgumentType()
10460 if (isAggregateTypeForABI(Ty)) in classifyKernelArgumentType()
10461 return getNaturalAlignIndirect(Ty, /* byval */ true); in classifyKernelArgumentType()
10463 return classifyArgumentType(Ty); in classifyKernelArgumentType()
10855 bool detectFPCCEligibleStructHelper(QualType Ty, CharUnits CurOff,
10869 ABIArgInfo classifyArgumentType(QualType Ty, bool IsFixed, int &ArgGPRsLeft,
10874 QualType Ty) const override;
10876 ABIArgInfo extendType(QualType Ty) const;
10878 bool detectFPCCEligibleStruct(QualType Ty, llvm::Type *&Field1Ty,
10933 bool RISCVABIInfo::detectFPCCEligibleStructHelper(QualType Ty, CharUnits CurOff, in detectFPCCEligibleStructHelper() argument
10938 bool IsInt = Ty->isIntegralOrEnumerationType(); in detectFPCCEligibleStructHelper()
10939 bool IsFloat = Ty->isRealFloatingType(); in detectFPCCEligibleStructHelper()
10942 uint64_t Size = getContext().getTypeSize(Ty); in detectFPCCEligibleStructHelper()
10955 Field1Ty = CGT.ConvertType(Ty); in detectFPCCEligibleStructHelper()
10960 Field2Ty = CGT.ConvertType(Ty); in detectFPCCEligibleStructHelper()
10967 if (auto CTy = Ty->getAs<ComplexType>()) { in detectFPCCEligibleStructHelper()
10980 if (const ConstantArrayType *ATy = getContext().getAsConstantArrayType(Ty)) { in detectFPCCEligibleStructHelper()
10994 if (const auto *RTy = Ty->getAs<RecordType>()) { in detectFPCCEligibleStructHelper()
10997 if (getRecordArgABI(Ty, CGT.getCXXABI())) in detectFPCCEligibleStructHelper()
10999 if (isEmptyRecord(getContext(), Ty, true)) in detectFPCCEligibleStructHelper()
11057 bool RISCVABIInfo::detectFPCCEligibleStruct(QualType Ty, llvm::Type *&Field1Ty, in detectFPCCEligibleStruct() argument
11068 Ty, CharUnits::Zero(), Field1Ty, Field1Off, Field2Ty, Field2Off); in detectFPCCEligibleStruct()
11135 ABIArgInfo RISCVABIInfo::classifyArgumentType(QualType Ty, bool IsFixed, in classifyArgumentType() argument
11139 Ty = useFirstFieldIfTransparentUnion(Ty); in classifyArgumentType()
11143 if (CGCXXABI::RecordArgABI RAA = getRecordArgABI(Ty, getCXXABI())) { in classifyArgumentType()
11146 return getNaturalAlignIndirect(Ty, /*ByVal=*/RAA == in classifyArgumentType()
11151 if (isEmptyRecord(getContext(), Ty, true)) in classifyArgumentType()
11154 uint64_t Size = getContext().getTypeSize(Ty); in classifyArgumentType()
11157 if (IsFixed && Ty->isFloatingType() && !Ty->isComplexType() && in classifyArgumentType()
11165 if (IsFixed && Ty->isComplexType() && FLen && ArgFPRsLeft >= 2) { in classifyArgumentType()
11166 QualType EltTy = Ty->castAs<ComplexType>()->getElementType(); in classifyArgumentType()
11173 if (IsFixed && FLen && Ty->isStructureOrClassType()) { in classifyArgumentType()
11181 detectFPCCEligibleStruct(Ty, Field1Ty, Field1Off, Field2Ty, Field2Off, in classifyArgumentType()
11192 uint64_t NeededAlign = getContext().getTypeAlign(Ty); in classifyArgumentType()
11210 if (!isAggregateTypeForABI(Ty) && !Ty->isVectorType()) { in classifyArgumentType()
11212 if (const EnumType *EnumTy = Ty->getAs<EnumType>()) in classifyArgumentType()
11213 Ty = EnumTy->getDecl()->getIntegerType(); in classifyArgumentType()
11217 if (Size < XLen && Ty->isIntegralOrEnumerationType() && !MustUseStack) { in classifyArgumentType()
11218 return extendType(Ty); in classifyArgumentType()
11221 if (const auto *EIT = Ty->getAs<BitIntType>()) { in classifyArgumentType()
11223 return extendType(Ty); in classifyArgumentType()
11227 return getNaturalAlignIndirect(Ty, /*ByVal=*/false); in classifyArgumentType()
11236 unsigned Alignment = getContext().getTypeAlign(Ty); in classifyArgumentType()
11251 return getNaturalAlignIndirect(Ty, /*ByVal=*/false); in classifyArgumentType()
11268 QualType Ty) const { in EmitVAArg()
11272 if (isEmptyRecord(getContext(), Ty, true)) { in EmitVAArg()
11275 Addr = CGF.Builder.CreateElementBitCast(Addr, CGF.ConvertTypeForMem(Ty)); in EmitVAArg()
11279 auto TInfo = getContext().getTypeInfoInChars(Ty); in EmitVAArg()
11284 return emitVoidPtrVAArg(CGF, VAListAddr, Ty, IsIndirect, TInfo, in EmitVAArg()
11288 ABIArgInfo RISCVABIInfo::extendType(QualType Ty) const { in extendType()
11289 int TySize = getContext().getTypeSize(Ty); in extendType()
11291 if (XLen == 64 && Ty->isUnsignedIntegerOrEnumerationType() && TySize == 32) in extendType()
11292 return ABIArgInfo::getSignExtend(Ty); in extendType()
11293 return ABIArgInfo::getExtend(Ty); in extendType()
11341 ABIArgInfo VEABIInfo::classifyReturnType(QualType Ty) const { in classifyReturnType()
11342 if (Ty->isAnyComplexType()) in classifyReturnType()
11344 uint64_t Size = getContext().getTypeSize(Ty); in classifyReturnType()
11345 if (Size < 64 && Ty->isIntegerType()) in classifyReturnType()
11346 return ABIArgInfo::getExtend(Ty); in classifyReturnType()
11347 return DefaultABIInfo::classifyReturnType(Ty); in classifyReturnType()
11350 ABIArgInfo VEABIInfo::classifyArgumentType(QualType Ty) const { in classifyArgumentType()
11351 if (Ty->isAnyComplexType()) in classifyArgumentType()
11353 uint64_t Size = getContext().getTypeSize(Ty); in classifyArgumentType()
11354 if (Size < 64 && Ty->isIntegerType()) in classifyArgumentType()
11355 return ABIArgInfo::getExtend(Ty); in classifyArgumentType()
11356 return DefaultABIInfo::classifyArgumentType(Ty); in classifyArgumentType()
11395 ABIArgInfo classifyArgumentType(QualType Ty, int &ArgGPRsLeft,
11401 QualType Ty) const override;
11425 QualType Ty) const { in EmitVAArg()
11429 if (isEmptyRecord(getContext(), Ty, true)) { in EmitVAArg()
11432 Addr = CGF.Builder.CreateElementBitCast(Addr, CGF.ConvertTypeForMem(Ty)); in EmitVAArg()
11436 auto TInfo = getContext().getTypeInfoInChars(Ty); in EmitVAArg()
11438 return emitVoidPtrVAArg(CGF, VAListAddr, Ty, false, TInfo, SlotSize, in EmitVAArg()
11442 ABIArgInfo CSKYABIInfo::classifyArgumentType(QualType Ty, int &ArgGPRsLeft, in classifyArgumentType() argument
11446 Ty = useFirstFieldIfTransparentUnion(Ty); in classifyArgumentType()
11450 if (CGCXXABI::RecordArgABI RAA = getRecordArgABI(Ty, getCXXABI())) { in classifyArgumentType()
11453 return getNaturalAlignIndirect(Ty, /*ByVal=*/RAA == in classifyArgumentType()
11458 if (isEmptyRecord(getContext(), Ty, true)) in classifyArgumentType()
11461 if (!Ty->getAsUnionType()) in classifyArgumentType()
11462 if (const Type *SeltTy = isSingleElementStruct(Ty, getContext())) in classifyArgumentType()
11465 uint64_t Size = getContext().getTypeSize(Ty); in classifyArgumentType()
11467 if (Ty->isFloatingType() && !Ty->isComplexType() && FLen >= Size && in classifyArgumentType()
11475 if (Ty->isComplexType() && FLen && !isReturnType) { in classifyArgumentType()
11476 QualType EltTy = Ty->castAs<ComplexType>()->getElementType(); in classifyArgumentType()
11483 if (!isAggregateTypeForABI(Ty)) { in classifyArgumentType()
11485 if (const EnumType *EnumTy = Ty->getAs<EnumType>()) in classifyArgumentType()
11486 Ty = EnumTy->getDecl()->getIntegerType(); in classifyArgumentType()
11490 if (Size < XLen && Ty->isIntegralOrEnumerationType()) in classifyArgumentType()
11491 return ABIArgInfo::getExtend(Ty); in classifyArgumentType()
11493 if (const auto *EIT = Ty->getAs<BitIntType>()) { in classifyArgumentType()
11495 return ABIArgInfo::getExtend(Ty); in classifyArgumentType()
11515 return getNaturalAlignIndirect(Ty, /*ByVal=*/false); in classifyArgumentType()