diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2015-09-10 09:48:30 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2015-09-10 09:48:30 +0000 |
commit | d11a98c322f59af36bb74fb90870fc52148d092a (patch) | |
tree | f7bc0d3a20fa6ca23b8c7a9a9b69199fde916fef /test/OpenMP/for_lastprivate_codegen.cpp | |
parent | a9b6a57da78d0f594a9febcdcc98f316f3242d42 (diff) |
[OPENMP] Propagate alignment from original variables to the private copies.
Currently private copies of captured variables have default alignment. Patch makes private variables to have same alignment as original variables.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247260 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/OpenMP/for_lastprivate_codegen.cpp')
-rw-r--r-- | test/OpenMP/for_lastprivate_codegen.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/test/OpenMP/for_lastprivate_codegen.cpp b/test/OpenMP/for_lastprivate_codegen.cpp index cada3a06e5..9cfb73fd09 100644 --- a/test/OpenMP/for_lastprivate_codegen.cpp +++ b/test/OpenMP/for_lastprivate_codegen.cpp @@ -18,7 +18,7 @@ struct S { ~S() {} }; -volatile int g = 1212; +volatile int g __attribute__((aligned(128)))= 1212; volatile int &g1 = g; float f; char cnt; @@ -32,10 +32,10 @@ char cnt; template <typename T> T tmain() { S<T> test; - T t_var = T(); - T vec[] = {1, 2}; - S<T> s_arr[] = {1, 2}; - S<T> &var = test; + T t_var __attribute__((aligned(128))) = T(); + T vec[] __attribute__((aligned(128))) = {1, 2}; + S<T> s_arr[] __attribute__((aligned(128))) = {1, 2}; + S<T> &var __attribute__((aligned(128))) = test; #pragma omp parallel #pragma omp for lastprivate(t_var, vec, s_arr, var) for (int i = 0; i < 2; ++i) { @@ -69,7 +69,7 @@ int main() { // LAMBDA: alloca i{{[0-9]+}}, // LAMBDA: alloca i{{[0-9]+}}, // LAMBDA: alloca i{{[0-9]+}}, - // LAMBDA: [[G_PRIVATE_ADDR:%.+]] = alloca i{{[0-9]+}}, + // LAMBDA: [[G_PRIVATE_ADDR:%.+]] = alloca i{{[0-9]+}}, align 128 // LAMBDA: [[GTID_REF:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** %{{.+}} // LAMBDA: [[GTID:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[GTID_REF]] // LAMBDA: call {{.+}} @__kmpc_for_static_init_4(%{{.+}}* @{{.+}}, i32 [[GTID]], i32 34, i32* [[IS_LAST_ADDR:%.+]], i32* %{{.+}}, i32* %{{.+}}, i32* %{{.+}}, i32 1, i32 1) @@ -122,7 +122,7 @@ int main() { // BLOCKS: alloca i{{[0-9]+}}, // BLOCKS: alloca i{{[0-9]+}}, // BLOCKS: alloca i{{[0-9]+}}, - // BLOCKS: [[G_PRIVATE_ADDR:%.+]] = alloca i{{[0-9]+}}, + // BLOCKS: [[G_PRIVATE_ADDR:%.+]] = alloca i{{[0-9]+}}, align 128 // BLOCKS: [[GTID_REF:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** %{{.+}} // BLOCKS: [[GTID:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[GTID_REF]] // BLOCKS: call {{.+}} @__kmpc_for_static_init_4(%{{.+}}* @{{.+}}, i32 [[GTID]], i32 34, i32* [[IS_LAST_ADDR:%.+]], i32* %{{.+}}, i32* %{{.+}}, i32* %{{.+}}, i32 1, i32 1) @@ -402,10 +402,10 @@ int main() { // CHECK: alloca i{{[0-9]+}}, // CHECK: alloca i{{[0-9]+}}, // CHECK: alloca i{{[0-9]+}}, -// CHECK: [[T_VAR_PRIV:%.+]] = alloca i{{[0-9]+}}, -// CHECK: [[VEC_PRIV:%.+]] = alloca [2 x i{{[0-9]+}}], -// CHECK: [[S_ARR_PRIV:%.+]] = alloca [2 x [[S_INT_TY]]], -// CHECK: [[VAR_PRIV:%.+]] = alloca [[S_INT_TY]], +// CHECK: [[T_VAR_PRIV:%.+]] = alloca i{{[0-9]+}}, align 128 +// CHECK: [[VEC_PRIV:%.+]] = alloca [2 x i{{[0-9]+}}], align 128 +// CHECK: [[S_ARR_PRIV:%.+]] = alloca [2 x [[S_INT_TY]]], align 128 +// CHECK: [[VAR_PRIV:%.+]] = alloca [[S_INT_TY]], align 128 // CHECK: [[VAR_PRIV_REF:%.+]] = alloca [[S_INT_TY]]*, // CHECK: store i{{[0-9]+}}* [[GTID_ADDR]], i{{[0-9]+}}** [[GTID_ADDR_REF:%.+]] |