diff options
author | Stefan Maksimovic <stefan.maksimovic@mips.com> | 2018-02-23 08:37:48 +0000 |
---|---|---|
committer | Stefan Maksimovic <stefan.maksimovic@mips.com> | 2018-02-23 08:37:48 +0000 |
commit | 3cd76b1448cbab44080c205c5fdec3dad5f5d346 (patch) | |
tree | f936d5b34d47125a50846ad2ae17ba866aa2add2 /clang/lib/CodeGen | |
parent | 07d6aea61af9d69a1f230489207713f0d49efe08 (diff) | |
download | bcm5719-llvm-3cd76b1448cbab44080c205c5fdec3dad5f5d346.tar.gz bcm5719-llvm-3cd76b1448cbab44080c205c5fdec3dad5f5d346.zip |
[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.
llvm-svn: 325872
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/TargetInfo.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp index 4ca421bb863..7d597437683 100644 --- a/clang/lib/CodeGen/TargetInfo.cpp +++ b/clang/lib/CodeGen/TargetInfo.cpp @@ -6870,6 +6870,14 @@ MipsABIInfo::classifyArgumentType(QualType Ty, uint64_t &Offset) const { 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. |