diff options
| author | Manman Ren <mren@apple.com> | 2012-11-06 04:58:01 +0000 |
|---|---|---|
| committer | Manman Ren <mren@apple.com> | 2012-11-06 04:58:01 +0000 |
| commit | 8cd99817f9a60cc13847b7e9cdc6d9fdca5f27df (patch) | |
| tree | 0476af4db6dded5f6c5ab80597d577e319652ef4 /clang/test/CodeGen/arm-arguments.c | |
| parent | 2ed51255028be06c9d831d8cd5ef489bd008a763 (diff) | |
| download | bcm5719-llvm-8cd99817f9a60cc13847b7e9cdc6d9fdca5f27df.tar.gz bcm5719-llvm-8cd99817f9a60cc13847b7e9cdc6d9fdca5f27df.zip | |
ARM byval: when type alignment is bigger than ABI alignment, instead of
disabling byval, we set realign to true.
It will perform an aligned alloca, and call memcpy to copy the byval
argument to the local variable.
Change the size threshold back to 64 bytes.
rdar://12596507
llvm-svn: 167440
Diffstat (limited to 'clang/test/CodeGen/arm-arguments.c')
| -rw-r--r-- | clang/test/CodeGen/arm-arguments.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/clang/test/CodeGen/arm-arguments.c b/clang/test/CodeGen/arm-arguments.c index 8aa33f696d7..63ecd4c5990 100644 --- a/clang/test/CodeGen/arm-arguments.c +++ b/clang/test/CodeGen/arm-arguments.c @@ -191,3 +191,35 @@ void g34(struct s34 *s) { f34(*s); } // AAPCS: %[[a:.*]] = alloca { [1 x i32] } // AAPCS: %[[gep:.*]] = getelementptr { [1 x i32] }* %[[a]], i32 0, i32 0 // AAPCS: load [1 x i32]* %[[gep]] + +// rdar://12596507 +struct s35 +{ + float v[18]; //make sure byval is on. +} __attribute__((aligned(16))); +typedef struct s35 s35_with_align; + +typedef __attribute__((neon_vector_type(4))) float float32x4_t; +static __attribute__((__always_inline__, __nodebug__)) float32x4_t vaddq_f32( + float32x4_t __a, float32x4_t __b) { + return __a + __b; +} +float32x4_t f35(int i, s35_with_align s1, s35_with_align s2) { + float32x4_t v = vaddq_f32(*(float32x4_t *)&s1, + *(float32x4_t *)&s2); + return v; +} +// APCS-GNU: define <4 x float> @f35(i32 %i, %struct.s35* byval, %struct.s35* byval) +// APCS-GNU: %[[a:.*]] = alloca %struct.s35, align 16 +// APCS-GNU: %[[b:.*]] = bitcast %struct.s35* %[[a]] to i8* +// APCS-GNU: %[[c:.*]] = bitcast %struct.s35* %0 to i8* +// APCS-GNU: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %[[b]], i8* %[[c]] +// APCS-GNU: %[[d:.*]] = bitcast %struct.s35* %[[a]] to <4 x float>* +// APCS-GNU: load <4 x float>* %[[d]], align 16 +// AAPCS: define arm_aapcscc <4 x float> @f35(i32 %i, %struct.s35* byval, %struct.s35* byval) +// AAPCS: %[[a:.*]] = alloca %struct.s35, align 16 +// AAPCS: %[[b:.*]] = bitcast %struct.s35* %[[a]] to i8* +// AAPCS: %[[c:.*]] = bitcast %struct.s35* %0 to i8* +// AAPCS: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %[[b]], i8* %[[c]] +// AAPCS: %[[d:.*]] = bitcast %struct.s35* %[[a]] to <4 x float>* +// AAPCS: load <4 x float>* %[[d]], align 16 |

