]> granicus.if.org Git - clang/commit
[PowerPC] ABI support for aligned by-value aggregates
authorUlrich Weigand <ulrich.weigand@de.ibm.com>
Thu, 10 Jul 2014 17:20:07 +0000 (17:20 +0000)
committerUlrich Weigand <ulrich.weigand@de.ibm.com>
Thu, 10 Jul 2014 17:20:07 +0000 (17:20 +0000)
commitec81a0dc9e7ac324e01ff9d5c69b99fee47ca10d
tree7323310452a785aed681722c2ec50a2b2bf0cbaf
parent5ebac2ac9dab9ba71b0e8c8b1c0c404f2973c674
[PowerPC] ABI support for aligned by-value aggregates

This patch adds support for respecting the ABI and type alignment
of aggregates passed by value.  Currently, all aggregates are aligned
at 8 bytes in the parameter save area.  This is incorrect for two
reasons:

- Aggregates that need alignment of 16 bytes or more should be aligned
  at 16 bytes in the parameter save area.  This is implemented by
  using an appropriate "byval align" attribute in the IR.

- Aggregates that need alignment beyond 16 bytes need to be dynamically
  realigned by the caller.  This is implemented by setting the Realign
  flag of the ABIArgInfo::getIndirect call.

In addition, when expanding a va_arg call accessing a type that is
aligned at 16 bytes in the argument save area (either one of the
aggregate types as above, or a vector type which is already aligned
at 16 bytes), code needs to align the va_list pointer accordingly.

Reviewed by Hal Finkel.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212743 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/TargetInfo.cpp
test/CodeGen/ppc64-align-struct.c [new file with mode: 0644]
test/CodeGen/ppc64-vector.c