2018-07-12 04:26:20 +08:00
|
|
|
// RUN: %clang_cc1 -DCHECK -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-64
|
2017-10-04 22:12:09 +08:00
|
|
|
// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
|
2018-07-12 04:26:20 +08:00
|
|
|
// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-64
|
|
|
|
// RUN: %clang_cc1 -DCHECK -verify -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-32
|
2017-10-04 22:12:09 +08:00
|
|
|
// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
|
2018-07-12 04:26:20 +08:00
|
|
|
// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-32
|
2017-10-04 22:12:09 +08:00
|
|
|
|
2018-07-12 04:26:20 +08:00
|
|
|
// RUN: %clang_cc1 -DCHECK -verify -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
|
2017-12-30 02:07:07 +08:00
|
|
|
// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
|
2018-07-12 04:26:20 +08:00
|
|
|
// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
|
|
|
|
// RUN: %clang_cc1 -DCHECK -verify -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
|
2017-12-30 02:07:07 +08:00
|
|
|
// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
|
2018-07-12 04:26:20 +08:00
|
|
|
// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
|
2017-12-30 02:07:07 +08:00
|
|
|
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
|
|
|
|
|
2018-07-12 04:26:20 +08:00
|
|
|
// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix LAMBDA --check-prefix LAMBDA-64
|
2017-10-04 22:12:09 +08:00
|
|
|
// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
|
2018-07-12 04:26:20 +08:00
|
|
|
// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix LAMBDA --check-prefix LAMBDA-64
|
2017-10-04 22:12:09 +08:00
|
|
|
|
2018-07-12 04:26:20 +08:00
|
|
|
// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY1 %s
|
2017-12-30 02:07:07 +08:00
|
|
|
// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
|
2018-07-12 04:26:20 +08:00
|
|
|
// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY1 %s
|
2017-12-30 02:07:07 +08:00
|
|
|
// SIMD-ONLY1-NOT: {{__kmpc|__tgt}}
|
|
|
|
|
2017-10-04 22:12:09 +08:00
|
|
|
// expected-no-diagnostics
|
|
|
|
#ifndef HEADER
|
|
|
|
#define HEADER
|
|
|
|
|
|
|
|
struct St {
|
|
|
|
int a, b;
|
|
|
|
St() : a(0), b(0) {}
|
|
|
|
St(const St &st) : a(st.a + st.b), b(0) {}
|
|
|
|
~St() {}
|
|
|
|
};
|
|
|
|
|
|
|
|
volatile int g = 1212;
|
|
|
|
volatile int &g1 = g;
|
|
|
|
|
|
|
|
template <class T>
|
|
|
|
struct S {
|
|
|
|
T f;
|
|
|
|
S(T a) : f(a + g) {}
|
|
|
|
S() : f(g) {}
|
|
|
|
S(const S &s, St t = St()) : f(s.f + t.a) {}
|
|
|
|
operator T() { return T(); }
|
|
|
|
~S() {}
|
|
|
|
};
|
|
|
|
|
|
|
|
// CHECK-DAG: [[S_FLOAT_TY:%.+]] = type { float }
|
|
|
|
// CHECK-DAG: [[S_INT_TY:%.+]] = type { i{{[0-9]+}} }
|
|
|
|
|
|
|
|
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;
|
|
|
|
#pragma omp target
|
|
|
|
#pragma omp teams distribute private(t_var, vec, s_arr, var)
|
|
|
|
for (int i = 0; i < 2; ++i) {
|
|
|
|
vec[i] = t_var;
|
|
|
|
s_arr[i] = var;
|
|
|
|
}
|
|
|
|
return T();
|
|
|
|
}
|
|
|
|
|
[CodeGenModule] Assume dso_local for -fpic -fno-semantic-interposition
Summary:
Clang -fpic defaults to -fno-semantic-interposition (GCC -fpic defaults
to -fsemantic-interposition).
Users need to specify -fsemantic-interposition to get semantic
interposition behavior.
Semantic interposition is currently a best-effort feature. There may
still be some cases where it is not handled well.
Reviewers: peter.smith, rnk, serge-sans-paille, sfertile, jfb, jdoerfert
Subscribers: dschuff, jyknight, dylanmckay, nemanjai, jvesely, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, jrtc27, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, arphaman, PkmX, jocewei, jsji, Jim, lenary, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73865
2020-02-03 04:23:47 +08:00
|
|
|
// CHECK-DAG: [[TEST:@.+]] = dso_local global [[S_FLOAT_TY]] zeroinitializer,
|
2017-10-04 22:12:09 +08:00
|
|
|
S<float> test;
|
[CodeGenModule] Assume dso_local for -fpic -fno-semantic-interposition
Summary:
Clang -fpic defaults to -fno-semantic-interposition (GCC -fpic defaults
to -fsemantic-interposition).
Users need to specify -fsemantic-interposition to get semantic
interposition behavior.
Semantic interposition is currently a best-effort feature. There may
still be some cases where it is not handled well.
Reviewers: peter.smith, rnk, serge-sans-paille, sfertile, jfb, jdoerfert
Subscribers: dschuff, jyknight, dylanmckay, nemanjai, jvesely, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, jrtc27, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, arphaman, PkmX, jocewei, jsji, Jim, lenary, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73865
2020-02-03 04:23:47 +08:00
|
|
|
// CHECK-DAG: [[T_VAR:@.+]] = dso_local global i{{[0-9]+}} 333,
|
2017-10-04 22:12:09 +08:00
|
|
|
int t_var = 333;
|
[CodeGenModule] Assume dso_local for -fpic -fno-semantic-interposition
Summary:
Clang -fpic defaults to -fno-semantic-interposition (GCC -fpic defaults
to -fsemantic-interposition).
Users need to specify -fsemantic-interposition to get semantic
interposition behavior.
Semantic interposition is currently a best-effort feature. There may
still be some cases where it is not handled well.
Reviewers: peter.smith, rnk, serge-sans-paille, sfertile, jfb, jdoerfert
Subscribers: dschuff, jyknight, dylanmckay, nemanjai, jvesely, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, jrtc27, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, arphaman, PkmX, jocewei, jsji, Jim, lenary, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73865
2020-02-03 04:23:47 +08:00
|
|
|
// CHECK-DAG: [[VEC:@.+]] = dso_local global [2 x i{{[0-9]+}}] [i{{[0-9]+}} 1, i{{[0-9]+}} 2],
|
2017-10-04 22:12:09 +08:00
|
|
|
int vec[] = {1, 2};
|
[CodeGenModule] Assume dso_local for -fpic -fno-semantic-interposition
Summary:
Clang -fpic defaults to -fno-semantic-interposition (GCC -fpic defaults
to -fsemantic-interposition).
Users need to specify -fsemantic-interposition to get semantic
interposition behavior.
Semantic interposition is currently a best-effort feature. There may
still be some cases where it is not handled well.
Reviewers: peter.smith, rnk, serge-sans-paille, sfertile, jfb, jdoerfert
Subscribers: dschuff, jyknight, dylanmckay, nemanjai, jvesely, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, jrtc27, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, arphaman, PkmX, jocewei, jsji, Jim, lenary, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73865
2020-02-03 04:23:47 +08:00
|
|
|
// CHECK-DAG: [[S_ARR:@.+]] = dso_local global [2 x [[S_FLOAT_TY]]] zeroinitializer,
|
2017-10-04 22:12:09 +08:00
|
|
|
S<float> s_arr[] = {1, 2};
|
[CodeGenModule] Assume dso_local for -fpic -fno-semantic-interposition
Summary:
Clang -fpic defaults to -fno-semantic-interposition (GCC -fpic defaults
to -fsemantic-interposition).
Users need to specify -fsemantic-interposition to get semantic
interposition behavior.
Semantic interposition is currently a best-effort feature. There may
still be some cases where it is not handled well.
Reviewers: peter.smith, rnk, serge-sans-paille, sfertile, jfb, jdoerfert
Subscribers: dschuff, jyknight, dylanmckay, nemanjai, jvesely, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, jrtc27, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, arphaman, PkmX, jocewei, jsji, Jim, lenary, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73865
2020-02-03 04:23:47 +08:00
|
|
|
// CHECK-DAG: [[VAR:@.+]] = dso_local global [[S_FLOAT_TY]] zeroinitializer,
|
2017-10-04 22:12:09 +08:00
|
|
|
S<float> var(3);
|
|
|
|
// CHECK-DAG: [[SIVAR:@.+]] = internal global i{{[0-9]+}} 0,
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
static int sivar;
|
|
|
|
#ifdef LAMBDA
|
[CodeGenModule] Assume dso_local for -fpic -fno-semantic-interposition
Summary:
Clang -fpic defaults to -fno-semantic-interposition (GCC -fpic defaults
to -fsemantic-interposition).
Users need to specify -fsemantic-interposition to get semantic
interposition behavior.
Semantic interposition is currently a best-effort feature. There may
still be some cases where it is not handled well.
Reviewers: peter.smith, rnk, serge-sans-paille, sfertile, jfb, jdoerfert
Subscribers: dschuff, jyknight, dylanmckay, nemanjai, jvesely, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, jrtc27, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, arphaman, PkmX, jocewei, jsji, Jim, lenary, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73865
2020-02-03 04:23:47 +08:00
|
|
|
// LAMBDA: [[G:@.+]] = dso_local global i{{[0-9]+}} 1212,
|
2017-10-04 22:12:09 +08:00
|
|
|
// LAMBDA-LABEL: @main
|
|
|
|
// LAMBDA: call void [[OUTER_LAMBDA:@.+]](
|
|
|
|
[&]() {
|
|
|
|
// LAMBDA: define{{.*}} internal{{.*}} void [[OUTER_LAMBDA]](
|
2017-12-08 03:49:28 +08:00
|
|
|
// LAMBDA: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 1, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 0)
|
2017-10-04 22:12:09 +08:00
|
|
|
// LAMBDA: call void @[[LOFFL1:.+]](
|
|
|
|
// LAMBDA: ret
|
|
|
|
#pragma omp target
|
|
|
|
#pragma omp teams distribute private(g, g1, sivar)
|
|
|
|
for (int i = 0; i < 2; ++i) {
|
2017-12-08 03:49:28 +08:00
|
|
|
// LAMBDA: define{{.*}} internal{{.*}} void @[[LOFFL1]](i{{64|32}} {{%.+}})
|
2017-10-04 22:12:09 +08:00
|
|
|
// LAMBDA: call void {{.+}} @__kmpc_fork_teams({{.+}}, i32 0, {{.+}} @[[LOUTL1:.+]] to {{.+}})
|
|
|
|
// LAMBDA: ret void
|
|
|
|
|
|
|
|
// LAMBDA: define internal void @[[LOUTL1]]({{.+}})
|
|
|
|
// Skip global, bound tid and loop vars
|
|
|
|
// LAMBDA: {{.+}} = alloca i32*,
|
|
|
|
// LAMBDA: {{.+}} = alloca i32*,
|
|
|
|
// LAMBDA: alloca i32,
|
|
|
|
// LAMBDA: alloca i32,
|
|
|
|
// LAMBDA: alloca i32,
|
|
|
|
// LAMBDA: alloca i32,
|
|
|
|
// LAMBDA: alloca i32,
|
2017-12-05 05:30:42 +08:00
|
|
|
// LAMBDA: alloca i32,
|
2017-10-04 22:12:09 +08:00
|
|
|
// LAMBDA: [[G_PRIV:%.+]] = alloca i{{[0-9]+}},
|
|
|
|
// LAMBDA: [[G1_PRIV:%.+]] = alloca i{{[0-9]+}}
|
|
|
|
// LAMBDA: [[TMP:%.+]] = alloca i{{[0-9]+}}*,
|
|
|
|
// LAMBDA: [[SIVAR_PRIV:%.+]] = alloca i{{[0-9]+}},
|
|
|
|
// LAMBDA: store{{.+}} [[G1_PRIV]], {{.+}} [[TMP]],
|
|
|
|
g = 1;
|
|
|
|
g1 = 1;
|
|
|
|
sivar = 2;
|
|
|
|
// LAMBDA: call void @__kmpc_for_static_init_4(
|
|
|
|
// LAMBDA-DAG: store{{.+}} 1, {{.+}} [[G_PRIV]],
|
|
|
|
// LAMBDA-DAG: store{{.+}} 2, {{.+}} [[SIVAR_PRIV]],
|
|
|
|
// LAMBDA-DAG: [[G1_REF:%.+]] = load{{.+}}, {{.+}} [[TMP]],
|
|
|
|
// LAMBDA-DAG: store{{.+}} 1, {{.+}} [[G1_REF]],
|
|
|
|
// LAMBDA: call void [[INNER_LAMBDA:@.+]](
|
|
|
|
// LAMBDA: call void @__kmpc_for_static_fini(
|
|
|
|
[&]() {
|
|
|
|
// LAMBDA: define {{.+}} void [[INNER_LAMBDA]](%{{.+}}* [[ARG_PTR:%.+]])
|
|
|
|
// LAMBDA: store %{{.+}}* [[ARG_PTR]], %{{.+}}** [[ARG_PTR_REF:%.+]],
|
|
|
|
g = 2;
|
|
|
|
g1 = 2;
|
|
|
|
sivar = 4;
|
|
|
|
// LAMBDA: [[ARG_PTR:%.+]] = load %{{.+}}*, %{{.+}}** [[ARG_PTR_REF]]
|
|
|
|
|
|
|
|
// LAMBDA: [[G_PTR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[ARG_PTR]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
|
|
|
|
// LAMBDA: [[G_REF:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** [[G_PTR_REF]]
|
|
|
|
// LAMBDA: store i{{[0-9]+}} 2, i{{[0-9]+}}* [[G_REF]]
|
2017-10-07 00:17:25 +08:00
|
|
|
// LAMBDA: [[G1_PTR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[ARG_PTR]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
|
|
|
|
// LAMBDA: [[G1_REF:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** [[G1_PTR_REF]]
|
|
|
|
// LAMBDA: store i{{[0-9]+}} 2, i{{[0-9]+}}* [[G1_REF]]
|
|
|
|
// LAMBDA: [[SIVAR_PTR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[ARG_PTR]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
|
2017-10-04 22:12:09 +08:00
|
|
|
// LAMBDA: [[SIVAR_REF:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** [[SIVAR_PTR_REF]]
|
|
|
|
// LAMBDA: store i{{[0-9]+}} 4, i{{[0-9]+}}* [[SIVAR_REF]]
|
|
|
|
}();
|
|
|
|
}
|
|
|
|
}();
|
|
|
|
return 0;
|
|
|
|
#else
|
|
|
|
#pragma omp target
|
|
|
|
#pragma omp teams distribute private(t_var, vec, s_arr, var, sivar)
|
|
|
|
for (int i = 0; i < 2; ++i) {
|
|
|
|
vec[i] = t_var;
|
|
|
|
s_arr[i] = var;
|
|
|
|
sivar += i;
|
|
|
|
}
|
|
|
|
return tmain<int>();
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK: define {{.*}}i{{[0-9]+}} @main()
|
2017-12-08 03:49:28 +08:00
|
|
|
// CHECK: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 0, i8** null, i8** null, i{{64|32}}* null, i64* null, i32 0, i32 0)
|
|
|
|
// CHECK: call void @[[OFFL1:.+]]()
|
2017-10-04 22:12:09 +08:00
|
|
|
// CHECK: {{%.+}} = call{{.*}} i32 @[[TMAIN_INT:.+]]()
|
|
|
|
// CHECK: ret
|
|
|
|
|
2017-12-08 03:49:28 +08:00
|
|
|
// CHECK: define{{.*}} void @[[OFFL1]]()
|
2017-10-04 22:12:09 +08:00
|
|
|
// CHECK: call void {{.+}} @__kmpc_fork_teams({{.+}}, i32 0, {{.+}} @[[OUTL1:.+]] to {{.+}})
|
|
|
|
// CHECK: ret void
|
|
|
|
|
|
|
|
// CHECK: define internal void @[[OUTL1]]({{.+}})
|
|
|
|
// Skip global, bound tid and loop vars
|
|
|
|
// CHECK: {{.+}} = alloca i32*,
|
|
|
|
// CHECK: {{.+}} = alloca i32*,
|
|
|
|
// CHECK: {{.+}} = alloca i32,
|
|
|
|
// CHECK: {{.+}} = alloca i32,
|
|
|
|
// CHECK: {{.+}} = alloca i32,
|
|
|
|
// CHECK: {{.+}} = alloca i32,
|
|
|
|
// CHECK: {{.+}} = alloca i32,
|
2017-12-05 05:30:42 +08:00
|
|
|
// CHECK: {{.+}} = alloca i32,
|
2017-10-04 22:12:09 +08:00
|
|
|
// CHECK-DAG: [[T_VAR_PRIV:%.+]] = alloca i{{[0-9]+}},
|
|
|
|
// CHECK-DAG: [[VEC_PRIV:%.+]] = alloca [2 x i{{[0-9]+}}],
|
|
|
|
// CHECK-DAG: [[S_ARR_PRIV:%.+]] = alloca [2 x [[S_FLOAT_TY]]],
|
|
|
|
// CHECK-DAG: [[VAR_PRIV:%.+]] = alloca [[S_FLOAT_TY]],
|
|
|
|
// CHECK-DAG: [[SIVAR_PRIV:%.+]] = alloca i{{[0-9]+}},
|
|
|
|
|
|
|
|
// private(s_arr)
|
|
|
|
// CHECK-DAG: [[S_ARR_PRIV_BGN:%.+]] = getelementptr{{.*}} [2 x [[S_FLOAT_TY]]], [2 x [[S_FLOAT_TY]]]* [[S_ARR_PRIV]],
|
|
|
|
// CHECK-DAG: [[S_ARR_PTR_ALLOC:%.+]] = phi{{.+}} [ [[S_ARR_PRIV_BGN]], {{.+}} ], [ [[S_ARR_NEXT:%.+]], {{.+}} ]
|
|
|
|
// CHECK-DAG: call void @{{.+}}({{.+}} [[S_ARR_PTR_ALLOC]])
|
|
|
|
// CHECK-DAG: [[S_ARR_NEXT]] = getelementptr {{.+}} [[S_ARR_PTR_ALLOC]],
|
|
|
|
|
|
|
|
// private(var)
|
|
|
|
// CHECK-DAG: call void @{{.+}}({{.+}} [[VAR_PRIV]])
|
|
|
|
|
|
|
|
// CHECK: call void @__kmpc_for_static_init_4(
|
|
|
|
// CHECK-DAG: {{.+}} = {{.+}} [[T_VAR_PRIV]]
|
|
|
|
// CHECK-DAG: {{.+}} = {{.+}} [[VEC_PRIV]]
|
|
|
|
// CHECK-DAG: {{.+}} = {{.+}} [[S_ARR_PRIV]]
|
|
|
|
// CHECK-DAG: {{.+}} = {{.+}} [[VAR_PRIV]]
|
|
|
|
// CHECK-DAG: {{.+}} = {{.+}} [[SIVAR_PRIV]]
|
|
|
|
// CHECK: call void @__kmpc_for_static_fini(
|
|
|
|
// CHECK: ret void
|
|
|
|
|
|
|
|
|
|
|
|
// CHECK: define{{.*}} i{{[0-9]+}} @[[TMAIN_INT]]()
|
2017-12-02 05:31:08 +08:00
|
|
|
// CHECK: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 0,
|
2017-10-04 22:12:09 +08:00
|
|
|
// CHECK: call void @[[TOFFL1:.+]]()
|
|
|
|
// CHECK: ret
|
|
|
|
|
|
|
|
// CHECK: define {{.*}}void @[[TOFFL1]]()
|
|
|
|
// CHECK: call void {{.+}} @__kmpc_fork_teams({{.+}}, i32 0, {{.+}} @[[TOUTL1:.+]] to {{.+}})
|
|
|
|
// CHECK: ret void
|
|
|
|
|
|
|
|
// CHECK: define internal void @[[TOUTL1]]({{.+}})
|
|
|
|
// Skip global, bound tid and loop vars
|
|
|
|
// CHECK: {{.+}} = alloca i32*,
|
|
|
|
// CHECK: {{.+}} = alloca i32*,
|
|
|
|
// CHECK: alloca i{{[0-9]+}},
|
|
|
|
// CHECK: alloca i{{[0-9]+}},
|
|
|
|
// CHECK: alloca i{{[0-9]+}},
|
|
|
|
// CHECK: alloca i{{[0-9]+}},
|
|
|
|
// CHECK: alloca i{{[0-9]+}},
|
2017-12-05 05:30:42 +08:00
|
|
|
// CHECK: alloca i{{[0-9]+}},
|
2017-10-04 22:12:09 +08:00
|
|
|
// 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: [[TMP:%.+]] = alloca [[S_INT_TY]]*,
|
|
|
|
|
|
|
|
// private(s_arr)
|
|
|
|
// CHECK-DAG: [[S_ARR_PRIV_BGN:%.+]] = getelementptr{{.*}} [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* [[S_ARR_PRIV]],
|
|
|
|
// CHECK-DAG: [[S_ARR_PTR_ALLOC:%.+]] = phi{{.+}} [ [[S_ARR_PRIV_BGN]], {{.+}} ], [ [[S_ARR_NEXT:%.+]], {{.+}} ]
|
|
|
|
// CHECK-DAG: call void @{{.+}}({{.+}} [[S_ARR_PTR_ALLOC]])
|
|
|
|
// CHECK-DAG: [[S_ARR_NEXT]] = getelementptr {{.+}} [[S_ARR_PTR_ALLOC]],
|
|
|
|
|
|
|
|
// CHECK-DAG: [[S_ARR_PRIV_BGN:%.+]] = getelementptr{{.*}} [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* [[S_ARR_PRIV]],
|
|
|
|
// CHECK-DAG: [[S_ARR_PTR_ALLOC:%.+]] = phi{{.+}} [ [[S_ARR_PRIV_BGN]], {{.+}} ], [ [[S_ARR_NEXT:%.+]], {{.+}} ]
|
|
|
|
// CHECK-DAG: call void @{{.+}}({{.+}} [[S_ARR_PTR_ALLOC]])
|
|
|
|
// CHECK-DAG: [[S_ARR_NEXT]] = getelementptr {{.+}} [[S_ARR_PTR_ALLOC]],
|
|
|
|
|
|
|
|
// private(var)
|
|
|
|
// CHECK-DAG: call void @{{.+}}({{.+}} [[VAR_PRIV]])
|
|
|
|
// CHECK-DAG: store{{.+}} [[VAR_PRIV]], {{.+}} [[TMP]]
|
|
|
|
|
|
|
|
// CHECK: call void @__kmpc_for_static_init_4(
|
|
|
|
// CHECK-DAG: {{.+}} = {{.+}} [[T_VAR_PRIV]]
|
|
|
|
// CHECK-DAG: {{.+}} = {{.+}} [[VEC_PRIV]]
|
|
|
|
// CHECK-DAG: {{.+}} = {{.+}} [[S_ARR_PRIV]]
|
|
|
|
// CHECK-DAG: {{.+}} = {{.+}} [[TMP]]
|
|
|
|
// CHECK: call void @__kmpc_for_static_fini(
|
|
|
|
// CHECK: ret void
|
|
|
|
|
|
|
|
#endif
|