diff options
author | John McCall <rjmccall@apple.com> | 2018-06-01 21:34:26 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2018-06-01 21:34:26 +0000 |
commit | 63074aa297d598f62dcc2a1b825af2a7716ecc3f (patch) | |
tree | 75bc7597afe4c02b7399b3563a62c22d216f4bea /test/CodeGenCXX/align-avx-complete-objects.cpp | |
parent | 3d5cade19158799a5828553fee71dd553a3aba82 (diff) |
Cap "voluntary" vector alignment at 16 for all Darwin platforms.
This fixes two major problems:
- We were not capping vector alignment as desired on 32-bit ARM.
- We were using different alignments based on the AVX settings on
Intel, so we did not have a consistent ABI.
This is an ABI break, but we think we can get away with it because
vectors tend to be used mostly in inline code (which is why not having
a consistent ABI has not proven disastrous on Intel).
Intel's AVX types are specified as having 32-byte / 64-byte alignment,
so align them explicitly instead of relying on the base ABI rule.
Note that this sort of attribute is stripped from template arguments
in template substitution, so there's a possibility that code templated
over vectors will produce inadequately-aligned objects. The right
long-term solution for this is for alignment attributes to be
interpreted as true qualifiers and thus preserved in the canonical type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333791 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/align-avx-complete-objects.cpp')
-rw-r--r-- | test/CodeGenCXX/align-avx-complete-objects.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/CodeGenCXX/align-avx-complete-objects.cpp b/test/CodeGenCXX/align-avx-complete-objects.cpp index ad4a91428d..1271e021fc 100644 --- a/test/CodeGenCXX/align-avx-complete-objects.cpp +++ b/test/CodeGenCXX/align-avx-complete-objects.cpp @@ -12,7 +12,7 @@ volatile float TestAlign(void) return r[0]; } -// CHECK: [[R:%.*]] = alloca <8 x float>, align 32 +// CHECK: [[R:%.*]] = alloca <8 x float>, align 16 // CHECK-NEXT: [[CALL:%.*]] = call i8* @_Znwm(i64 32) // CHECK-NEXT: [[ZERO:%.*]] = bitcast i8* [[CALL]] to <8 x float>* // CHECK-NEXT: store <8 x float>* [[ZERO]], <8 x float>** [[P:%.*]], align 8 @@ -22,8 +22,8 @@ volatile float TestAlign(void) // CHECK-NEXT: store volatile <8 x float> [[TWO]], <8 x float>* [[THREE]], align 16 // CHECK-NEXT: [[FOUR:%.*]] = load <8 x float>*, <8 x float>** [[P]], align 8 // CHECK-NEXT: [[FIVE:%.*]] = load volatile <8 x float>, <8 x float>* [[FOUR]], align 16 -// CHECK-NEXT: store <8 x float> [[FIVE]], <8 x float>* [[R]], align 32 -// CHECK-NEXT: [[SIX:%.*]] = load <8 x float>, <8 x float>* [[R]], align 32 +// CHECK-NEXT: store <8 x float> [[FIVE]], <8 x float>* [[R]], align 16 +// CHECK-NEXT: [[SIX:%.*]] = load <8 x float>, <8 x float>* [[R]], align 16 // CHECK-NEXT: [[VECEXT:%.*]] = extractelement <8 x float> [[SIX]], i32 0 // CHECK-NEXT: ret float [[VECEXT]] |