From 405bdeddd18318d3b10edd474f6f08caa5e3a1d4 Mon Sep 17 00:00:00 2001 From: Oliver Stannard Date: Tue, 11 Feb 2014 09:25:50 +0000 Subject: AAPCS: Do not split structs after CPRC allocated on stack According to the AAPCS, we can split structs between GPRs and the stack, except for when an argument has already been allocated on the stack. This can occur when a large number of floating-point arguments fill up the VFP registers, and are alllocated on the stack before the general-purpose argument registers are full. llvm-svn: 201137 --- clang/test/CodeGen/arm-aapcs-vfp.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'clang/test') diff --git a/clang/test/CodeGen/arm-aapcs-vfp.c b/clang/test/CodeGen/arm-aapcs-vfp.c index 071b7cf91ba..a3be64ef975 100644 --- a/clang/test/CodeGen/arm-aapcs-vfp.c +++ b/clang/test/CodeGen/arm-aapcs-vfp.c @@ -103,3 +103,13 @@ void test_neon(struct neon_struct arg) { // CHECK-LABEL: define arm_aapcs_vfpcc void @f33(%struct.s33* byval %s) struct s33 { char buf[32*32]; }; void f33(struct s33 s) { } + +typedef struct { long long x; int y; } struct_long_long_int; +// CHECK: define arm_aapcs_vfpcc void @test_vfp_stack_gpr_split_1(double %a, double %b, double %c, double %d, double %e, double %f, double %g, double %h, double %i, i32 %j, i64 %k, i32 %l) +void test_vfp_stack_gpr_split_1(double a, double b, double c, double d, double e, double f, double g, double h, double i, int j, long long k, int l) {} + +// CHECK: define arm_aapcs_vfpcc void @test_vfp_stack_gpr_split_2(double %a, double %b, double %c, double %d, double %e, double %f, double %g, double %h, double %i, i32 %j, [3 x i32], i64 %k.0, i32 %k.1) +void test_vfp_stack_gpr_split_2(double a, double b, double c, double d, double e, double f, double g, double h, double i, int j, struct_long_long_int k) {} + +// CHECK: define arm_aapcs_vfpcc void @test_vfp_stack_gpr_split_3(%struct.struct_long_long_int* noalias sret %agg.result, double %a, double %b, double %c, double %d, double %e, double %f, double %g, double %h, double %i, [3 x i32], i64 %k.0, i32 %k.1) +struct_long_long_int test_vfp_stack_gpr_split_3(double a, double b, double c, double d, double e, double f, double g, double h, double i, struct_long_long_int k) {} -- cgit v1.2.3