ARM: enable struct byval for AAPCS-VFP.

rdar://9877866


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161790 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/TargetInfo.cpp b/lib/CodeGen/TargetInfo.cpp
index 2cd239c..9c23ed9 100644
--- a/lib/CodeGen/TargetInfo.cpp
+++ b/lib/CodeGen/TargetInfo.cpp
@@ -2757,13 +2757,10 @@
     }
   }
 
-  // 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/test/CodeGen/arm-aapcs-vfp.c b/test/CodeGen/arm-aapcs-vfp.c
index fdd87e0..614b52d 100644
--- a/test/CodeGen/arm-aapcs-vfp.c
+++ b/test/CodeGen/arm-aapcs-vfp.c
@@ -88,3 +88,7 @@
 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) { }