summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorManman Ren <mren@apple.com>2012-08-13 21:23:55 +0000
committerManman Ren <mren@apple.com>2012-08-13 21:23:55 +0000
commit6c30e137d021be9df74eac1998e6d4efe46eb921 (patch)
tree6c7fca7b6a390233f183687fd04abfc9214bde95 /clang
parentd6c8270eaab2f3594d22b81ceb4269f1afe6f907 (diff)
downloadbcm5719-llvm-6c30e137d021be9df74eac1998e6d4efe46eb921.tar.gz
bcm5719-llvm-6c30e137d021be9df74eac1998e6d4efe46eb921.zip
ARM: enable struct byval for AAPCS-VFP.
rdar://9877866 llvm-svn: 161790
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/CodeGen/TargetInfo.cpp11
-rw-r--r--clang/test/CodeGen/arm-aapcs-vfp.c4
2 files changed, 8 insertions, 7 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp
index 2cd239c81a2..9c23ed9871d 100644
--- a/clang/lib/CodeGen/TargetInfo.cpp
+++ b/clang/lib/CodeGen/TargetInfo.cpp
@@ -2757,13 +2757,10 @@ ABIArgInfo ARMABIInfo::classifyArgumentType(QualType Ty) const {
}
}
- // Turn on byval for APCS and AAPCS.
- // FIXME: turn on byval for AAPCS_VFP for performance.
- if (getABIKind() == ARMABIInfo::APCS || getABIKind() == ARMABIInfo::AAPCS) {
- if (getContext().getTypeSizeInChars(Ty) > CharUnits::fromQuantity(64) ||
- getContext().getTypeAlign(Ty) > 64) {
- return ABIArgInfo::getIndirect(0, /*ByVal=*/true);
- }
+ // Support byval for ARM.
+ if (getContext().getTypeSizeInChars(Ty) > CharUnits::fromQuantity(64) ||
+ getContext().getTypeAlign(Ty) > 64) {
+ return ABIArgInfo::getIndirect(0, /*ByVal=*/true);
}
// Otherwise, pass by coercing to a structure of the appropriate size.
diff --git a/clang/test/CodeGen/arm-aapcs-vfp.c b/clang/test/CodeGen/arm-aapcs-vfp.c
index fdd87e05495..614b52dad57 100644
--- a/clang/test/CodeGen/arm-aapcs-vfp.c
+++ b/clang/test/CodeGen/arm-aapcs-vfp.c
@@ -88,3 +88,7 @@ extern void neon_callee(struct neon_struct);
void test_neon(struct neon_struct arg) {
neon_callee(arg);
}
+
+// CHECK: define arm_aapcs_vfpcc void @f33(%struct.s33* byval %s)
+struct s33 { char buf[32*32]; };
+void f33(struct s33 s) { }
OpenPOWER on IntegriCloud