diff options
| author | Ulrich Weigand <ulrich.weigand@de.ibm.com> | 2014-07-21 00:56:36 +0000 |
|---|---|---|
| committer | Ulrich Weigand <ulrich.weigand@de.ibm.com> | 2014-07-21 00:56:36 +0000 |
| commit | 601957fa23ab90cbb24114ee9913244883453f96 (patch) | |
| tree | 306890a8831d7cb6d9d3480e365437bc9ae65eb5 /clang/test/CodeGen/ppc64-vector.c | |
| parent | b712237da6acd42a9221787acea7880f8db3fa0c (diff) | |
| download | bcm5719-llvm-601957fa23ab90cbb24114ee9913244883453f96.tar.gz bcm5719-llvm-601957fa23ab90cbb24114ee9913244883453f96.zip | |
[PowerPC] Optimize passing certain aggregates by value
In addition to enabling ELFv2 homogeneous aggregate handling,
LLVM support to pass array types directly also enables a performance
enhancement. We can now pass (non-homogeneous) aggregates that fit
fully in registers as direct integer arrays, using an element type
to encode the alignment requirement (that would otherwise go to the
"byval align" field).
This is preferable since "byval" forces the back-end to write the
aggregate out to the stack, even if it could be passed fully in
registers. This is particularly annoying on ELFv2, if there is
no parameter save area available, since we then need to allocate
space on the callee's stack just to hold those aggregates.
Note that to implement this optimization, this patch does not attempt
to fully anticipate register allocation rules as (defined in the
ABI and) implemented in the back-end. Instead, the patch is simply
passing *any* aggregate passed by value using the array mechanism
if its size is up to 64 bytes. This means that some of those will
end up being passed in stack slots anyway, but the generated code
shouldn't be any worse either. (*Large* aggregates remain passed
using "byval" to enable optimized copying via memcpy etc.)
llvm-svn: 213495
Diffstat (limited to 'clang/test/CodeGen/ppc64-vector.c')
| -rw-r--r-- | clang/test/CodeGen/ppc64-vector.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/test/CodeGen/ppc64-vector.c b/clang/test/CodeGen/ppc64-vector.c index 3ff07a4d415..f0211f0ec19 100644 --- a/clang/test/CodeGen/ppc64-vector.c +++ b/clang/test/CodeGen/ppc64-vector.c @@ -45,7 +45,7 @@ v16i16 test_v16i16(v16i16 x) return x; } -// CHECK: define void @test_struct_v16i16(%struct.v16i16* noalias sret %agg.result, %struct.v16i16* byval align 16) +// CHECK: define void @test_struct_v16i16(%struct.v16i16* noalias sret %agg.result, [2 x i128] %x.coerce) struct v16i16 test_struct_v16i16(struct v16i16 x) { return x; |

