From 16ba7c8498933781cff103058612e76e8045c798 Mon Sep 17 00:00:00 2001 From: Manman Ren Date: Fri, 10 Aug 2012 20:42:31 +0000 Subject: [PATCH] ARM: enable struct byval for AAPCS. rdar://9877866 PR://13350 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161694 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/TargetInfo.cpp | 4 +--- test/CodeGen/arm-arguments.c | 6 ++++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/CodeGen/TargetInfo.cpp b/lib/CodeGen/TargetInfo.cpp index 4aa98d2fd8..752228e2a3 100644 --- a/lib/CodeGen/TargetInfo.cpp +++ b/lib/CodeGen/TargetInfo.cpp @@ -2757,9 +2757,7 @@ ABIArgInfo ARMABIInfo::classifyArgumentType(QualType Ty) const { } } - // FIXME: byval for AAPCS is not yet supported; we need it for performance - // and to support large alignment. - if (getABIKind() == ARMABIInfo::APCS) { + if (getABIKind() == ARMABIInfo::APCS || getABIKind() == ARMABIInfo::AAPCS) { if (getContext().getTypeSizeInChars(Ty) > CharUnits::fromQuantity(64) || getContext().getTypeAlign(Ty) > 64) { return ABIArgInfo::getIndirect(0, /*ByVal=*/true); diff --git a/test/CodeGen/arm-arguments.c b/test/CodeGen/arm-arguments.c index dd18414863..2ec729eb9b 100644 --- a/test/CodeGen/arm-arguments.c +++ b/test/CodeGen/arm-arguments.c @@ -172,3 +172,9 @@ struct s32 { double x; }; void f32(struct s32 s) { } // AAPCS: @f32([1 x i64] %s.coerce) // APCS-GNU: @f32([2 x i32] %s.coerce) + +// PR13350 +struct s33 { char buf[32*32]; }; +void f33(struct s33 s) { } +// APCS-GNU: define void @f33(%struct.s33* byval %s) +// AAPCS: define arm_aapcscc void @f33(%struct.s33* byval %s) -- 2.40.0