[cfe-commits] r161790 - in /cfe/trunk: lib/CodeGen/TargetInfo.cpp test/CodeGen/arm-aapcs-vfp.c

Manman Ren mren at apple.com
Mon Aug 13 14:23:56 PDT 2012


Author: mren
Date: Mon Aug 13 16:23:55 2012
New Revision: 161790

URL: http://llvm.org/viewvc/llvm-project?rev=161790&view=rev
Log:
ARM: enable struct byval for AAPCS-VFP.

rdar://9877866

Modified:
    cfe/trunk/lib/CodeGen/TargetInfo.cpp
    cfe/trunk/test/CodeGen/arm-aapcs-vfp.c

Modified: cfe/trunk/lib/CodeGen/TargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/TargetInfo.cpp?rev=161790&r1=161789&r2=161790&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/TargetInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/TargetInfo.cpp Mon Aug 13 16:23:55 2012
@@ -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.

Modified: cfe/trunk/test/CodeGen/arm-aapcs-vfp.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/arm-aapcs-vfp.c?rev=161790&r1=161789&r2=161790&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/arm-aapcs-vfp.c (original)
+++ cfe/trunk/test/CodeGen/arm-aapcs-vfp.c Mon Aug 13 16:23:55 2012
@@ -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) { }





More information about the cfe-commits mailing list