Author: smaksimovic Date: Fri Feb 23 00:37:48 2018 New Revision: 325872 URL: http://llvm.org/viewvc/llvm-project?rev=325872&view=rev Log: [mips] Reland r310704
Recommit this change which was previously reverted for the 5.0.0 release since the failures identified were dealt with in r325782. Added: cfe/trunk/test/CodeGen/mips-aggregate-arg.c - copied unchanged from r310703, cfe/trunk/test/CodeGen/mips-aggregate-arg.c Modified: cfe/trunk/lib/CodeGen/TargetInfo.cpp Modified: cfe/trunk/lib/CodeGen/TargetInfo.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/TargetInfo.cpp?rev=325872&r1=325871&r2=325872&view=diff ============================================================================== --- cfe/trunk/lib/CodeGen/TargetInfo.cpp (original) +++ cfe/trunk/lib/CodeGen/TargetInfo.cpp Fri Feb 23 00:37:48 2018 @@ -6870,6 +6870,14 @@ MipsABIInfo::classifyArgumentType(QualTy return getNaturalAlignIndirect(Ty, RAA == CGCXXABI::RAA_DirectInMemory); } + // Use indirect if the aggregate cannot fit into registers for + // passing arguments according to the ABI + unsigned Threshold = IsO32 ? 16 : 64; + + if(getContext().getTypeSizeInChars(Ty) > CharUnits::fromQuantity(Threshold)) + return ABIArgInfo::getIndirect(CharUnits::fromQuantity(Align), true, + getContext().getTypeAlign(Ty) / 8 > Align); + // If we have reached here, aggregates are passed directly by coercing to // another structure type. Padding is inserted if the offset of the // aggregate is unaligned. _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits