summaryrefslogtreecommitdiffstats
path: root/clang/test/OpenMP/parallel_reduction_codegen.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2015-09-10 09:48:30 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2015-09-10 09:48:30 +0000
commit1d7f0faf93eefa7624b611cd0636a2f62f44efe9 (patch)
tree1c81b331267b5078e4e5e37229e92424f687fc9d /clang/test/OpenMP/parallel_reduction_codegen.cpp
parent9e1c0c15004a3a059586cd013177abe332dfb491 (diff)
downloadbcm5719-llvm-1d7f0faf93eefa7624b611cd0636a2f62f44efe9.tar.gz
bcm5719-llvm-1d7f0faf93eefa7624b611cd0636a2f62f44efe9.zip
[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. llvm-svn: 247260
Diffstat (limited to 'clang/test/OpenMP/parallel_reduction_codegen.cpp')
-rw-r--r--clang/test/OpenMP/parallel_reduction_codegen.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/clang/test/OpenMP/parallel_reduction_codegen.cpp b/clang/test/OpenMP/parallel_reduction_codegen.cpp
index 6ecd42bb94c..2ee4239d2a5 100644
--- a/clang/test/OpenMP/parallel_reduction_codegen.cpp
+++ b/clang/test/OpenMP/parallel_reduction_codegen.cpp
@@ -8,7 +8,7 @@
#ifndef HEADER
#define HEADER
-volatile int g = 1212;
+volatile int g __attribute__((aligned(128))) = 1212;
template <class T>
struct S {
@@ -30,10 +30,10 @@ template <typename T>
T tmain() {
T t;
S<T> test;
- T t_var = T(), t_var1;
+ T t_var __attribute__((aligned(128))) = T(), t_var1 __attribute__((aligned(128)));
T vec[] = {1, 2};
- S<T> s_arr[] = {1, 2};
- S<T> var(3), var1;
+ S<T> s_arr[] = {1, 2};
+ S<T> var __attribute__((aligned(128))) (3), var1 __attribute__((aligned(128)));
#pragma omp parallel reduction(+:t_var) reduction(&:var) reduction(&& : var1) reduction(min: t_var1)
{
vec[0] = t_var;
@@ -59,9 +59,9 @@ int main() {
// LAMBDA: [[RED_LIST:%.+]] = alloca [1 x i8*],
// LAMBDA: [[G_REF:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** [[G_REF_ADDR:%.+]]
- // LAMBDA: store i{{[0-9]+}} 0, i{{[0-9]+}}* [[G_PRIVATE_ADDR]]
+ // LAMBDA: store i{{[0-9]+}} 0, i{{[0-9]+}}* [[G_PRIVATE_ADDR]], align 128
g = 1;
- // LAMBDA: store i{{[0-9]+}} 1, i{{[0-9]+}}* [[G_PRIVATE_ADDR]],
+ // LAMBDA: store i{{[0-9]+}} 1, i{{[0-9]+}}* [[G_PRIVATE_ADDR]], align 128
// LAMBDA: [[G_PRIVATE_ADDR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[ARG:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
// LAMBDA: store i{{[0-9]+}}* [[G_PRIVATE_ADDR]], i{{[0-9]+}}** [[G_PRIVATE_ADDR_REF]]
// LAMBDA: call void [[INNER_LAMBDA:@.+]](%{{.+}}* [[ARG]])
@@ -114,9 +114,9 @@ int main() {
// BLOCKS: [[RED_LIST:%.+]] = alloca [1 x i8*],
// BLOCKS: [[G_REF:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** [[G_REF_ADDR:%.+]]
- // BLOCKS: store i{{[0-9]+}} 0, i{{[0-9]+}}* [[G_PRIVATE_ADDR]]
+ // BLOCKS: store i{{[0-9]+}} 0, i{{[0-9]+}}* [[G_PRIVATE_ADDR]], align 128
g = 1;
- // BLOCKS: store i{{[0-9]+}} 1, i{{[0-9]+}}* [[G_PRIVATE_ADDR]],
+ // BLOCKS: store i{{[0-9]+}} 1, i{{[0-9]+}}* [[G_PRIVATE_ADDR]], align 128
// BLOCKS-NOT: [[G]]{{[[^:word:]]}}
// BLOCKS: i{{[0-9]+}}* [[G_PRIVATE_ADDR]]
// BLOCKS-NOT: [[G]]{{[[^:word:]]}}
@@ -435,10 +435,10 @@ int main() {
// CHECK: ret
//
// CHECK: define internal void [[TMAIN_MICROTASK]](i{{[0-9]+}}* noalias [[GTID_ADDR:%.+]], i{{[0-9]+}}* noalias %{{.+}},
-// CHECK: [[T_VAR_PRIV:%.+]] = alloca i{{[0-9]+}},
-// CHECK: [[VAR_PRIV:%.+]] = alloca [[S_INT_TY]],
-// CHECK: [[VAR1_PRIV:%.+]] = alloca [[S_INT_TY]],
-// CHECK: [[T_VAR1_PRIV:%.+]] = alloca i{{[0-9]+}},
+// CHECK: [[T_VAR_PRIV:%.+]] = alloca i{{[0-9]+}}, align 128
+// CHECK: [[VAR_PRIV:%.+]] = alloca [[S_INT_TY]], align 128
+// CHECK: [[VAR1_PRIV:%.+]] = alloca [[S_INT_TY]], align 128
+// CHECK: [[T_VAR1_PRIV:%.+]] = alloca i{{[0-9]+}}, align 128
// Reduction list for runtime.
// CHECK: [[RED_LIST:%.+]] = alloca [4 x i8*],
OpenPOWER on IntegriCloud