2018-12-27 00:06:26 +08:00
|
|
|
// RUN: %clang_cc1 -verify -fopenmp -fnoopenmp-use-tls -x c++ -triple x86_64-linux -emit-llvm %s -o - | FileCheck %s
|
|
|
|
// RUN: %clang_cc1 -fopenmp -fnoopenmp-use-tls -x c++ -std=c++11 -triple x86_64-linux -emit-pch -o %t %s
|
|
|
|
// RUN: %clang_cc1 -fopenmp -fnoopenmp-use-tls -x c++ -triple x86_64-linux -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
|
|
|
|
// RUN: %clang_cc1 -verify -fopenmp -fnoopenmp-use-tls -x c++ -std=c++11 -DLAMBDA -triple x86_64-linux -emit-llvm %s -o - | FileCheck -check-prefix=LAMBDA %s
|
|
|
|
// RUN: %clang_cc1 -verify -fopenmp -fnoopenmp-use-tls -x c++ -fblocks -DBLOCKS -triple x86_64-linux -emit-llvm %s -o - | FileCheck -check-prefix=BLOCKS %s
|
2015-07-14 06:54:53 +08:00
|
|
|
// RUN: %clang_cc1 -verify -fopenmp -fnoopenmp-use-tls -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=ARRAY %s
|
2015-07-28 00:38:06 +08:00
|
|
|
|
2018-12-27 00:06:26 +08:00
|
|
|
// RUN: %clang_cc1 -verify -fopenmp-simd -fnoopenmp-use-tls -x c++ -triple x86_64-linux -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
|
|
|
|
// RUN: %clang_cc1 -fopenmp-simd -fnoopenmp-use-tls -x c++ -std=c++11 -triple x86_64-linux -emit-pch -o %t %s
|
|
|
|
// RUN: %clang_cc1 -fopenmp-simd -fnoopenmp-use-tls -x c++ -triple x86_64-linux -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
|
|
|
|
// RUN: %clang_cc1 -verify -fopenmp-simd -fnoopenmp-use-tls -x c++ -std=c++11 -DLAMBDA -triple x86_64-linux -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
|
|
|
|
// RUN: %clang_cc1 -verify -fopenmp-simd -fnoopenmp-use-tls -x c++ -fblocks -DBLOCKS -triple x86_64-linux -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
|
2017-12-30 02:07:07 +08:00
|
|
|
// RUN: %clang_cc1 -verify -fopenmp-simd -fnoopenmp-use-tls -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
|
|
|
|
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
|
|
|
|
|
2018-12-27 00:06:26 +08:00
|
|
|
// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-linux -emit-llvm %s -o - | FileCheck %s -check-prefix=TLS-CHECK
|
|
|
|
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-linux -emit-pch -o %t %s
|
|
|
|
// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-linux -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s -check-prefix=TLS-CHECK
|
|
|
|
// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DLAMBDA -triple x86_64-linux -emit-llvm %s -o - | FileCheck -check-prefix=TLS-LAMBDA %s
|
|
|
|
// RUN: %clang_cc1 -verify -fopenmp -x c++ -fblocks -DBLOCKS -triple x86_64-linux -emit-llvm %s -o - | FileCheck -check-prefix=TLS-BLOCKS %s
|
2015-07-28 00:38:06 +08:00
|
|
|
// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DARRAY -triple x86_64-linux-gnu -emit-llvm %s -o - | FileCheck -check-prefix=TLS-ARRAY %s
|
2019-07-19 03:40:24 +08:00
|
|
|
// RUN: %clang_cc1 -verify -fopenmp -x c++ -DNESTED -triple x86_64-linux -emit-llvm %s -o - | FileCheck %s -check-prefix=NESTED
|
2017-12-30 02:07:07 +08:00
|
|
|
|
2018-12-27 00:06:26 +08:00
|
|
|
// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple x86_64-linux -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY1 %s
|
|
|
|
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-linux -emit-pch -o %t %s
|
|
|
|
// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-linux -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY1 %s
|
|
|
|
// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DLAMBDA -triple x86_64-linux -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY1 %s
|
|
|
|
// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -fblocks -DBLOCKS -triple x86_64-linux -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY1 %s
|
2017-12-30 02:07:07 +08:00
|
|
|
// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DARRAY -triple x86_64-linux-gnu -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY1 %s
|
|
|
|
// SIMD-ONLY1-NOT: {{__kmpc|__tgt}}
|
2015-04-16 13:39:01 +08:00
|
|
|
// expected-no-diagnostics
|
2019-07-19 03:40:24 +08:00
|
|
|
#if !defined(ARRAY) && !defined(NESTED)
|
2015-04-16 13:39:01 +08:00
|
|
|
#ifndef HEADER
|
|
|
|
#define HEADER
|
|
|
|
|
2015-09-10 17:48:30 +08:00
|
|
|
volatile int g __attribute__((aligned(128))) = 1212;
|
2015-04-16 13:39:01 +08:00
|
|
|
#pragma omp threadprivate(g)
|
|
|
|
|
|
|
|
template <class T>
|
|
|
|
struct S {
|
|
|
|
T f;
|
|
|
|
S(T a) : f(a + g) {}
|
|
|
|
S() : f(g) {}
|
|
|
|
S &operator=(const S &) { return *this; };
|
|
|
|
operator T() { return T(); }
|
|
|
|
~S() {}
|
|
|
|
};
|
|
|
|
|
|
|
|
// CHECK-DAG: [[S_FLOAT_TY:%.+]] = type { float }
|
|
|
|
// CHECK-DAG: [[S_INT_TY:%.+]] = type { i{{[0-9]+}} }
|
2018-08-29 23:45:11 +08:00
|
|
|
// CHECK-DAG: [[IMPLICIT_BARRIER_LOC:@.+]] = private unnamed_addr global %{{.+}} { i32 0, i32 66, i32 0, i32 0, i8*
|
2015-07-28 00:38:06 +08:00
|
|
|
// TLS-CHECK-DAG: [[S_FLOAT_TY:%.+]] = type { float }
|
|
|
|
// TLS-CHECK-DAG: [[S_INT_TY:%.+]] = type { i{{[0-9]+}} }
|
2018-08-29 23:45:11 +08:00
|
|
|
// TLS-CHECK-DAG: [[IMPLICIT_BARRIER_LOC:@.+]] = private unnamed_addr global %{{.+}} { i32 0, i32 66, i32 0, i32 0, i8*
|
2015-04-16 13:39:01 +08:00
|
|
|
|
|
|
|
// CHECK-DAG: [[T_VAR:@.+]] = internal global i{{[0-9]+}} 1122,
|
|
|
|
// CHECK-DAG: [[VEC:@.+]] = internal global [2 x i{{[0-9]+}}] [i{{[0-9]+}} 1, i{{[0-9]+}} 2],
|
|
|
|
// CHECK-DAG: [[S_ARR:@.+]] = internal global [2 x [[S_FLOAT_TY]]] zeroinitializer,
|
|
|
|
// CHECK-DAG: [[VAR:@.+]] = internal global [[S_FLOAT_TY]] zeroinitializer,
|
2018-02-24 03:30:48 +08:00
|
|
|
// CHECK-DAG: [[TMAIN_T_VAR:@.+]] = linkonce_odr {{(dso_local )?}}global i{{[0-9]+}} 333,
|
|
|
|
// CHECK-DAG: [[TMAIN_VEC:@.+]] = linkonce_odr {{(dso_local )?}}global [2 x i{{[0-9]+}}] [i{{[0-9]+}} 3, i{{[0-9]+}} 3],
|
|
|
|
// CHECK-DAG: [[TMAIN_S_ARR:@.+]] = linkonce_odr {{(dso_local )?}}global [2 x [[S_INT_TY]]] zeroinitializer,
|
|
|
|
// CHECK-DAG: [[TMAIN_VAR:@.+]] = linkonce_odr {{(dso_local )?}}global [[S_INT_TY]] zeroinitializer,
|
2015-07-28 00:38:06 +08:00
|
|
|
// TLS-CHECK-DAG: [[T_VAR:@.+]] = internal thread_local global i{{[0-9]+}} 1122,
|
|
|
|
// TLS-CHECK-DAG: [[VEC:@.+]] = internal thread_local global [2 x i{{[0-9]+}}] [i{{[0-9]+}} 1, i{{[0-9]+}} 2],
|
|
|
|
// TLS-CHECK-DAG: [[S_ARR:@.+]] = internal thread_local global [2 x [[S_FLOAT_TY]]] zeroinitializer,
|
|
|
|
// TLS-CHECK-DAG: [[VAR:@.+]] = internal thread_local global [[S_FLOAT_TY]] zeroinitializer,
|
2018-02-24 03:30:48 +08:00
|
|
|
// TLS-CHECK-DAG: [[TMAIN_T_VAR:@.+]] = linkonce_odr {{(dso_local )?}}thread_local global i{{[0-9]+}} 333,
|
|
|
|
// TLS-CHECK-DAG: [[TMAIN_VEC:@.+]] = linkonce_odr {{(dso_local )?}}thread_local global [2 x i{{[0-9]+}}] [i{{[0-9]+}} 3, i{{[0-9]+}} 3],
|
|
|
|
// TLS-CHECK-DAG: [[TMAIN_S_ARR:@.+]] = linkonce_odr {{(dso_local )?}}thread_local global [2 x [[S_INT_TY]]] zeroinitializer,
|
|
|
|
// TLS-CHECK-DAG: [[TMAIN_VAR:@.+]] = linkonce_odr {{(dso_local )?}}thread_local global [[S_INT_TY]] zeroinitializer,
|
2015-07-28 00:38:06 +08:00
|
|
|
|
2015-04-16 13:39:01 +08:00
|
|
|
template <typename T>
|
|
|
|
T tmain() {
|
|
|
|
S<T> test;
|
|
|
|
test = S<T>();
|
2015-09-10 17:48:30 +08:00
|
|
|
static T t_var __attribute__((aligned(128))) = 333;
|
|
|
|
static T vec[] __attribute__((aligned(128))) = {3, 3};
|
|
|
|
static S<T> s_arr[] __attribute__((aligned(128))) = {1, 2};
|
|
|
|
static S<T> var __attribute__((aligned(128))) (3);
|
2015-04-16 13:39:01 +08:00
|
|
|
#pragma omp threadprivate(t_var, vec, s_arr, var)
|
|
|
|
#pragma omp parallel copyin(t_var, vec, s_arr, var)
|
|
|
|
{
|
|
|
|
vec[0] = t_var;
|
|
|
|
s_arr[0] = var;
|
|
|
|
}
|
|
|
|
#pragma omp parallel copyin(t_var)
|
|
|
|
{}
|
|
|
|
return T();
|
|
|
|
}
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
#ifdef LAMBDA
|
2018-02-24 03:30:48 +08:00
|
|
|
// LAMBDA: [[G:@.+]] = {{(dso_local )?}}global i{{[0-9]+}} 1212,
|
2015-04-16 13:39:01 +08:00
|
|
|
// LAMBDA-LABEL: @main
|
2015-06-30 01:29:50 +08:00
|
|
|
// LAMBDA: call{{.*}} void [[OUTER_LAMBDA:@.+]](
|
2015-07-28 01:30:41 +08:00
|
|
|
// TLS-LAMBDA: [[G:@.+]] = {{.*}}thread_local {{.*}}global i{{[0-9]+}} 1212,
|
2015-07-28 00:38:06 +08:00
|
|
|
// TLS-LAMBDA-LABEL: @main
|
|
|
|
// TLS-LAMBDA: call{{.*}} void [[OUTER_LAMBDA:@.+]](
|
2015-04-16 13:39:01 +08:00
|
|
|
[&]() {
|
|
|
|
// LAMBDA: define{{.*}} internal{{.*}} void [[OUTER_LAMBDA]](
|
2015-09-10 16:12:02 +08:00
|
|
|
// LAMBDA: call {{.*}}void {{.+}} @__kmpc_fork_call({{.+}}, i32 0, {{.+}}* [[OMP_REGION:@.+]] to {{.+}})
|
2015-07-28 00:38:06 +08:00
|
|
|
|
2019-09-13 04:00:24 +08:00
|
|
|
// TLS-LAMBDA: call {{.*}}void {{.+}} @__kmpc_fork_call({{.+}}, i32 1, {{.+}}* [[OMP_REGION:@.+]] to {{.+}}, i32* @g)
|
2015-07-28 00:38:06 +08:00
|
|
|
|
2015-04-16 13:39:01 +08:00
|
|
|
#pragma omp parallel copyin(g)
|
|
|
|
{
|
2015-09-10 16:12:02 +08:00
|
|
|
// LAMBDA: define{{.*}} internal{{.*}} void [[OMP_REGION]](i32* noalias %{{.+}}, i32* noalias %{{.+}})
|
2020-05-19 02:29:11 +08:00
|
|
|
// TLS-LAMBDA: define{{.*}} internal{{.*}} void [[OMP_REGION]](i32* noalias %{{.+}}, i32* noalias %{{.+}}, i32* nonnull align 4 dereferenceable(4) %{{.+}})
|
2015-04-16 13:39:01 +08:00
|
|
|
|
|
|
|
// threadprivate_g = g;
|
2015-06-30 01:29:50 +08:00
|
|
|
// LAMBDA: call {{.*}}i8* @__kmpc_threadprivate_cached({{.+}} [[G]]
|
2015-04-16 13:39:01 +08:00
|
|
|
// LAMBDA: ptrtoint i{{[0-9]+}}* %{{.+}} to i{{[0-9]+}}
|
|
|
|
// LAMBDA: icmp ne i{{[0-9]+}} ptrtoint (i{{[0-9]+}}* [[G]] to i{{[0-9]+}}), %{{.+}}
|
|
|
|
// LAMBDA: br i1 %{{.+}}, label %[[NOT_MASTER:.+]], label %[[DONE:.+]]
|
|
|
|
// LAMBDA: [[NOT_MASTER]]
|
2015-09-10 17:48:30 +08:00
|
|
|
// LAMBDA: load i{{[0-9]+}}, i{{[0-9]+}}* [[G]], align 128
|
|
|
|
// LAMBDA: store volatile i{{[0-9]+}} %{{.+}}, i{{[0-9]+}}* %{{.+}}, align 128
|
2015-04-16 13:39:01 +08:00
|
|
|
// LAMBDA: [[DONE]]
|
|
|
|
|
2015-09-10 16:12:02 +08:00
|
|
|
// TLS-LAMBDA-DAG: [[G_CAPTURE_SRC:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** %
|
2015-07-28 01:30:41 +08:00
|
|
|
// TLS-LAMBDA-DAG: [[G_CAPTURE_SRCC:%.+]] = ptrtoint i{{[0-9]+}}* [[G_CAPTURE_SRC]] to i{{[0-9]+}}
|
2019-09-13 04:00:24 +08:00
|
|
|
// TLS-LAMBDA: icmp ne i{{[0-9]+}} {{%.+}}, ptrtoint (i{{[0-9]+}}* @g to i{{[0-9]+}})
|
2015-07-28 00:38:06 +08:00
|
|
|
// TLS-LAMBDA: br i1 %{{.+}}, label %[[NOT_MASTER:.+]], label %[[DONE:.+]]
|
|
|
|
// TLS-LAMBDA: [[NOT_MASTER]]
|
|
|
|
// TLS-LAMBDA: load i{{[0-9]+}}, i{{[0-9]+}}* [[G_CAPTURE_SRC]],
|
2019-09-13 04:00:24 +08:00
|
|
|
// TLS-LAMBDA: store volatile i{{[0-9]+}} %{{.+}}, i{{[0-9]+}}* @g, align 128
|
2015-07-28 00:38:06 +08:00
|
|
|
// TLS-LAMBDA: [[DONE]]
|
|
|
|
|
2015-09-15 20:52:43 +08:00
|
|
|
// LAMBDA: call {{.*}}void @__kmpc_barrier(
|
|
|
|
// TLS-LAMBDA: call {{.*}}void @__kmpc_barrier(
|
2015-04-16 13:39:01 +08:00
|
|
|
g = 1;
|
2015-06-30 01:29:50 +08:00
|
|
|
// LAMBDA: call{{.*}} void [[INNER_LAMBDA:@.+]](%{{.+}}*
|
2015-07-28 00:38:06 +08:00
|
|
|
// TLS-LAMBDA: call{{.*}} void [[INNER_LAMBDA:@.+]](%{{.+}}*
|
2016-03-29 13:34:15 +08:00
|
|
|
|
2015-04-16 13:39:01 +08:00
|
|
|
[&]() {
|
|
|
|
// LAMBDA: define {{.+}} void [[INNER_LAMBDA]](%{{.+}}* [[ARG_PTR:%.+]])
|
|
|
|
// LAMBDA: store %{{.+}}* [[ARG_PTR]], %{{.+}}** [[ARG_PTR_REF:%.+]],
|
|
|
|
g = 2;
|
|
|
|
// LAMBDA: [[ARG_PTR:%.+]] = load %{{.+}}*, %{{.+}}** [[ARG_PTR_REF]]
|
2015-07-28 00:38:06 +08:00
|
|
|
|
2019-09-13 04:00:24 +08:00
|
|
|
// TLS-LAMBDA: store volatile i{{[0-9]+}} 2, i{{[0-9]+}}* @g, align 128
|
2015-04-16 13:39:01 +08:00
|
|
|
}();
|
|
|
|
}
|
|
|
|
}();
|
|
|
|
return 0;
|
|
|
|
#elif defined(BLOCKS)
|
2018-02-24 03:30:48 +08:00
|
|
|
// BLOCKS: [[G:@.+]] = {{(dso_local )?}}global i{{[0-9]+}} 1212,
|
2015-04-16 13:39:01 +08:00
|
|
|
// BLOCKS-LABEL: @main
|
2015-06-30 01:29:50 +08:00
|
|
|
// BLOCKS: call {{.*}}void {{%.+}}(i8
|
2015-07-28 00:38:06 +08:00
|
|
|
|
2015-07-28 01:49:18 +08:00
|
|
|
// TLS-BLOCKS: [[G:@.+]] = {{.*}}thread_local {{.*}}global i{{[0-9]+}} 1212,
|
2015-07-28 00:38:06 +08:00
|
|
|
// TLS-BLOCKS-LABEL: @main
|
|
|
|
// TLS-BLOCKS: call {{.*}}void {{%.+}}(i8
|
2015-04-16 13:39:01 +08:00
|
|
|
^{
|
|
|
|
// BLOCKS: define{{.*}} internal{{.*}} void {{.+}}(i8*
|
2015-09-10 16:12:02 +08:00
|
|
|
// BLOCKS: call {{.*}}void {{.+}} @__kmpc_fork_call({{.+}}, i32 0, {{.+}}* [[OMP_REGION:@.+]] to {{.+}})
|
2015-07-28 00:38:06 +08:00
|
|
|
|
2019-09-13 04:00:24 +08:00
|
|
|
// TLS-BLOCKS: call {{.*}}void {{.+}} @__kmpc_fork_call({{.+}}, i32 1, {{.+}}* [[OMP_REGION:@.+]] to {{.+}}, i32* @g)
|
2015-07-28 00:38:06 +08:00
|
|
|
|
2015-04-16 13:39:01 +08:00
|
|
|
#pragma omp parallel copyin(g)
|
|
|
|
{
|
2015-09-10 16:12:02 +08:00
|
|
|
// BLOCKS: define{{.*}} internal{{.*}} void [[OMP_REGION]](i32* noalias %{{.+}}, i32* noalias %{{.+}})
|
2020-05-19 02:29:11 +08:00
|
|
|
// TLS-BLOCKS: define{{.*}} internal{{.*}} void [[OMP_REGION]](i32* noalias %{{.+}}, i32* noalias %{{.+}}, i32* nonnull align 4 dereferenceable(4) %{{.+}})
|
2015-04-16 13:39:01 +08:00
|
|
|
|
|
|
|
// threadprivate_g = g;
|
2015-06-30 01:29:50 +08:00
|
|
|
// BLOCKS: call {{.*}}i8* @__kmpc_threadprivate_cached({{.+}} [[G]]
|
2015-04-16 13:39:01 +08:00
|
|
|
// BLOCKS: ptrtoint i{{[0-9]+}}* %{{.+}} to i{{[0-9]+}}
|
|
|
|
// BLOCKS: icmp ne i{{[0-9]+}} ptrtoint (i{{[0-9]+}}* [[G]] to i{{[0-9]+}}), %{{.+}}
|
|
|
|
// BLOCKS: br i1 %{{.+}}, label %[[NOT_MASTER:.+]], label %[[DONE:.+]]
|
|
|
|
// BLOCKS: [[NOT_MASTER]]
|
2015-09-10 17:48:30 +08:00
|
|
|
// BLOCKS: load i{{[0-9]+}}, i{{[0-9]+}}* [[G]], align 128
|
|
|
|
// BLOCKS: store volatile i{{[0-9]+}} %{{.+}}, i{{[0-9]+}}* %{{.+}}, align 128
|
2015-04-16 13:39:01 +08:00
|
|
|
// BLOCKS: [[DONE]]
|
|
|
|
|
2015-09-10 16:12:02 +08:00
|
|
|
// TLS-BLOCKS-DAG: [[G_CAPTURE_SRC:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** %
|
2015-07-28 01:30:41 +08:00
|
|
|
// TLS-BLOCKS-DAG: [[G_CAPTURE_SRCC:%.+]] = ptrtoint i{{[0-9]+}}* [[G_CAPTURE_SRC]] to i{{[0-9]+}}
|
2019-09-13 04:00:24 +08:00
|
|
|
// TLS-BLOCKS: icmp ne i{{[0-9]+}} {{%.+}}, ptrtoint (i{{[0-9]+}}* @g to i{{[0-9]+}})
|
2015-07-28 00:38:06 +08:00
|
|
|
// TLS-BLOCKS: br i1 %{{.+}}, label %[[NOT_MASTER:.+]], label %[[DONE:.+]]
|
|
|
|
// TLS-BLOCKS: [[NOT_MASTER]]
|
|
|
|
// TLS-BLOCKS: load i{{[0-9]+}}, i{{[0-9]+}}* [[G_CAPTURE_SRC]],
|
2019-09-13 04:00:24 +08:00
|
|
|
// TLS-BLOCKS: store volatile i{{[0-9]+}} %{{.+}}, i{{[0-9]+}}* @g, align 128
|
2015-07-28 00:38:06 +08:00
|
|
|
// TLS-BLOCKS: [[DONE]]
|
|
|
|
|
2015-09-15 20:52:43 +08:00
|
|
|
// BLOCKS: call {{.*}}void @__kmpc_barrier(
|
|
|
|
// TLS-BLOCKS: call {{.*}}void @__kmpc_barrier(
|
2015-04-16 13:39:01 +08:00
|
|
|
g = 1;
|
|
|
|
// BLOCKS: store volatile i{{[0-9]+}} 1, i{{[0-9]+}}*
|
|
|
|
// BLOCKS-NOT: [[G]]{{[[^:word:]]}}
|
2015-06-30 01:29:50 +08:00
|
|
|
// BLOCKS: call {{.*}}void {{%.+}}(i8
|
2015-07-28 00:38:06 +08:00
|
|
|
|
2019-09-13 04:00:24 +08:00
|
|
|
// TLS-BLOCKS: store volatile i{{[0-9]+}} 1, i{{[0-9]+}}* @g
|
2015-07-28 00:38:06 +08:00
|
|
|
// TLS-BLOCKS-NOT: [[G]]{{[[^:word:]]}}
|
|
|
|
// TLS-BLOCKS: call {{.*}}void {{%.+}}(i8
|
2016-03-29 13:34:15 +08:00
|
|
|
|
2015-04-16 13:39:01 +08:00
|
|
|
^{
|
|
|
|
// BLOCKS: define {{.+}} void {{@.+}}(i8*
|
2015-07-28 00:38:06 +08:00
|
|
|
// TLS-BLOCKS: define {{.+}} void {{@.+}}(i8*
|
2015-04-16 13:39:01 +08:00
|
|
|
g = 2;
|
|
|
|
// BLOCKS-NOT: [[G]]{{[[^:word:]]}}
|
2015-06-30 01:29:50 +08:00
|
|
|
// BLOCKS: call {{.*}}i8* @__kmpc_threadprivate_cached({{.+}} [[G]]
|
2015-04-16 13:39:01 +08:00
|
|
|
// BLOCKS: store volatile i{{[0-9]+}} 2, i{{[0-9]+}}*
|
|
|
|
// BLOCKS-NOT: [[G]]{{[[^:word:]]}}
|
|
|
|
// BLOCKS: ret
|
2015-07-28 00:38:06 +08:00
|
|
|
|
|
|
|
// TLS-BLOCKS-NOT: [[G]]{{[[^:word:]]}}
|
2019-09-13 04:00:24 +08:00
|
|
|
// TLS-BLOCKS: store volatile i{{[0-9]+}} 2, i{{[0-9]+}}* @g
|
2015-07-28 00:38:06 +08:00
|
|
|
// TLS-BLOCKS-NOT: [[G]]{{[[^:word:]]}}
|
|
|
|
// TLS-BLOCKS: ret
|
2015-04-16 13:39:01 +08:00
|
|
|
}();
|
|
|
|
}
|
|
|
|
}();
|
|
|
|
return 0;
|
|
|
|
#else
|
|
|
|
S<float> test;
|
|
|
|
test = S<float>();
|
|
|
|
static int t_var = 1122;
|
|
|
|
static int vec[] = {1, 2};
|
|
|
|
static S<float> s_arr[] = {1, 2};
|
|
|
|
static S<float> var(3);
|
|
|
|
#pragma omp threadprivate(t_var, vec, s_arr, var)
|
|
|
|
#pragma omp parallel copyin(t_var, vec, s_arr, var)
|
|
|
|
{
|
|
|
|
vec[0] = t_var;
|
|
|
|
s_arr[0] = var;
|
|
|
|
}
|
2019-06-21 23:08:30 +08:00
|
|
|
#pragma omp parallel copyin(t_var) default(none)
|
|
|
|
++t_var;
|
2015-04-16 13:39:01 +08:00
|
|
|
return tmain<int>();
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: @main
|
|
|
|
// CHECK: [[TEST:%.+]] = alloca [[S_FLOAT_TY]],
|
|
|
|
// CHECK: call {{.*}} [[S_FLOAT_TY_COPY_ASSIGN:@.+]]([[S_FLOAT_TY]]* [[TEST]], [[S_FLOAT_TY]]*
|
2015-09-10 16:12:02 +08:00
|
|
|
// CHECK: call {{.*}}void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 0, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*)* [[MAIN_MICROTASK:@.+]] to void (i32*, i32*, ...)*))
|
|
|
|
// CHECK: call {{.*}}void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 0, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*)* [[MAIN_MICROTASK1:@.+]] to void (i32*, i32*, ...)*))
|
2015-04-16 13:39:01 +08:00
|
|
|
// CHECK: = call {{.*}}i{{.+}} [[TMAIN_INT:@.+]]()
|
|
|
|
// CHECK: call {{.*}} [[S_FLOAT_TY_DESTR:@.+]]([[S_FLOAT_TY]]*
|
|
|
|
// CHECK: ret
|
2015-07-28 00:38:06 +08:00
|
|
|
|
|
|
|
// TLS-CHECK-LABEL: @main
|
|
|
|
// TLS-CHECK: [[TEST:%.+]] = alloca [[S_FLOAT_TY]],
|
|
|
|
// TLS-CHECK: call {{.*}} [[S_FLOAT_TY_COPY_ASSIGN:@.+]]([[S_FLOAT_TY]]* [[TEST]], [[S_FLOAT_TY]]*
|
2015-09-10 16:12:02 +08:00
|
|
|
// TLS-CHECK: call {{.*}}void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 4, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*, i32*, [2 x i32]*, [2 x [[S_FLOAT_TY]]]*, [[S_FLOAT_TY]]*)* [[MAIN_MICROTASK:@.+]] to void (i32*, i32*, ...)*),
|
|
|
|
// TLS-CHECK: call {{.*}}void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 1, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*, i32*)* [[MAIN_MICROTASK1:@.+]] to void (i32*, i32*, ...)*),
|
2015-07-28 00:38:06 +08:00
|
|
|
// TLS-CHECK: = call {{.*}}i{{.+}} [[TMAIN_INT:@.+]]()
|
|
|
|
// TLS-CHECK: call {{.*}} [[S_FLOAT_TY_DESTR:@.+]]([[S_FLOAT_TY]]*
|
|
|
|
// TLS-CHECK: ret
|
|
|
|
|
2015-09-10 16:12:02 +08:00
|
|
|
// CHECK: define internal {{.*}}void [[MAIN_MICROTASK]](i{{[0-9]+}}* noalias [[GTID_ADDR:%.+]], i{{[0-9]+}}* noalias %{{.+}})
|
2015-04-16 13:39:01 +08:00
|
|
|
// CHECK: store i{{[0-9]+}}* [[GTID_ADDR]], i{{[0-9]+}}** [[GTID_ADDR_ADDR:%.+]],
|
|
|
|
// CHECK: [[GTID_ADDR:%.+]] = load i32*, i32** [[GTID_ADDR_ADDR]],
|
|
|
|
// CHECK: [[GTID:%.+]] = load i32, i32* [[GTID_ADDR]],
|
|
|
|
|
2015-09-10 16:12:02 +08:00
|
|
|
// TLS-CHECK: define internal {{.*}}void [[MAIN_MICROTASK]](i{{[0-9]+}}* noalias [[GTID_ADDR:%.+]], i{{[0-9]+}}* noalias %{{.+}},
|
2015-07-28 00:38:06 +08:00
|
|
|
// TLS-CHECK: store i{{[0-9]+}}* [[GTID_ADDR]], i{{[0-9]+}}** [[GTID_ADDR_ADDR:%.+]],
|
|
|
|
|
2015-04-16 13:39:01 +08:00
|
|
|
// threadprivate_t_var = t_var;
|
2015-06-30 01:29:50 +08:00
|
|
|
// CHECK: call {{.*}}i8* @__kmpc_threadprivate_cached({{.+}} [[T_VAR]]
|
2015-04-16 13:39:01 +08:00
|
|
|
// CHECK: ptrtoint i{{[0-9]+}}* %{{.+}} to i{{[0-9]+}}
|
|
|
|
// CHECK: icmp ne i{{[0-9]+}} ptrtoint (i{{[0-9]+}}* [[T_VAR]] to i{{[0-9]+}}), %{{.+}}
|
|
|
|
// CHECK: br i1 %{{.+}}, label %[[NOT_MASTER:.+]], label %[[DONE:.+]]
|
|
|
|
// CHECK: [[NOT_MASTER]]
|
|
|
|
// CHECK: load i{{[0-9]+}}, i{{[0-9]+}}* [[T_VAR]],
|
|
|
|
// CHECK: store i{{[0-9]+}} %{{.+}}, i{{[0-9]+}}* %{{.+}},
|
|
|
|
|
2015-09-10 16:12:02 +08:00
|
|
|
// TLS-CHECK: [[MASTER_REF:%.+]] = load i32*, i32** %
|
|
|
|
// TLS-CHECK: [[MASTER_REF2:%.+]] = load [2 x i32]*, [2 x i32]** %
|
|
|
|
// TLS-CHECK: [[MASTER_REF3:%.+]] = load [2 x [[S_FLOAT_TY]]]*, [2 x [[S_FLOAT_TY]]]** %
|
|
|
|
// TLS-CHECK: [[MASTER_REF4:%.+]] = load [[S_FLOAT_TY]]*, [[S_FLOAT_TY]]** %
|
|
|
|
|
2015-07-28 00:38:06 +08:00
|
|
|
// TLS-CHECK: [[MASTER_LONG:%.+]] = ptrtoint i32* [[MASTER_REF]] to i{{[0-9]+}}
|
|
|
|
// TLS-CHECK: icmp ne i{{[0-9]+}} [[MASTER_LONG]], ptrtoint (i{{[0-9]+}}* [[T_VAR]] to i{{[0-9]+}})
|
|
|
|
// TLS-CHECK: br i1 %{{.+}}, label %[[NOT_MASTER:.+]], label %[[DONE:.+]]
|
|
|
|
// TLS-CHECK: [[NOT_MASTER]]
|
|
|
|
// TLS-CHECK: [[MASTER_VAL:%.+]] = load i32, i32* [[MASTER_REF]]
|
|
|
|
// TLS-CHECK: store i32 [[MASTER_VAL]], i32* [[T_VAR]]
|
|
|
|
|
2015-04-16 13:39:01 +08:00
|
|
|
// threadprivate_vec = vec;
|
2015-06-30 01:29:50 +08:00
|
|
|
// CHECK: call {{.*}}i8* @__kmpc_threadprivate_cached({{.+}} [[VEC]]
|
Change memcpy/memove/memset to have dest and source alignment attributes (Step 1).
Summary:
Upstream LLVM is changing the the prototypes of the @llvm.memcpy/memmove/memset
intrinsics. This change updates the Clang tests for this change.
The @llvm.memcpy/memmove/memset intrinsics currently have an explicit argument
which is required to be a constant integer. It represents the alignment of the
dest (and source), and so must be the minimum of the actual alignment of the
two.
This change removes the alignment argument in favour of placing the alignment
attribute on the source and destination pointers of the memory intrinsic call.
For example, code which used to read:
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 100, i32 4, i1 false)
will now read
call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %dest, i8* align 4 %src, i32 100, i1 false)
At this time the source and destination alignments must be the same (Step 1).
Step 2 of the change, to be landed shortly, will relax that contraint and allow
the source and destination to have different alignments.
llvm-svn: 322964
2018-01-20 01:12:54 +08:00
|
|
|
// CHECK: call void @llvm.memcpy{{.*}}(i8* align {{[0-9]+}} %{{.+}}, i8* align {{[0-9]+}} bitcast ([2 x i{{[0-9]+}}]* [[VEC]] to i8*),
|
2015-04-16 13:39:01 +08:00
|
|
|
|
2015-09-10 16:12:02 +08:00
|
|
|
// TLS-CHECK: [[MASTER_CAST:%.+]] = bitcast [2 x i32]* [[MASTER_REF2]] to i8*
|
Change memcpy/memove/memset to have dest and source alignment attributes (Step 1).
Summary:
Upstream LLVM is changing the the prototypes of the @llvm.memcpy/memmove/memset
intrinsics. This change updates the Clang tests for this change.
The @llvm.memcpy/memmove/memset intrinsics currently have an explicit argument
which is required to be a constant integer. It represents the alignment of the
dest (and source), and so must be the minimum of the actual alignment of the
two.
This change removes the alignment argument in favour of placing the alignment
attribute on the source and destination pointers of the memory intrinsic call.
For example, code which used to read:
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 100, i32 4, i1 false)
will now read
call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %dest, i8* align 4 %src, i32 100, i1 false)
At this time the source and destination alignments must be the same (Step 1).
Step 2 of the change, to be landed shortly, will relax that contraint and allow
the source and destination to have different alignments.
llvm-svn: 322964
2018-01-20 01:12:54 +08:00
|
|
|
// TLS-CHECK: call void @llvm.memcpy{{.*}}(i8* align {{[0-9]+}} bitcast ([2 x i{{[0-9]+}}]* [[VEC]] to i8*), i8* align {{[0-9]+}} [[MASTER_CAST]]
|
2015-07-28 00:38:06 +08:00
|
|
|
|
2015-04-16 13:39:01 +08:00
|
|
|
// threadprivate_s_arr = s_arr;
|
2015-06-30 01:29:50 +08:00
|
|
|
// CHECK: call {{.*}}i8* @__kmpc_threadprivate_cached({{.+}} [[S_ARR]]
|
2015-04-16 13:39:01 +08:00
|
|
|
// CHECK: [[S_ARR_PRIV_BEGIN:%.+]] = getelementptr inbounds [2 x [[S_FLOAT_TY]]], [2 x [[S_FLOAT_TY]]]* {{%.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 0
|
|
|
|
// CHECK: [[S_ARR_PRIV_END:%.+]] = getelementptr [[S_FLOAT_TY]], [[S_FLOAT_TY]]* [[S_ARR_PRIV_BEGIN]], i{{[0-9]+}} 2
|
|
|
|
// CHECK: [[IS_EMPTY:%.+]] = icmp eq [[S_FLOAT_TY]]* [[S_ARR_PRIV_BEGIN]], [[S_ARR_PRIV_END]]
|
|
|
|
// CHECK: br i1 [[IS_EMPTY]], label %[[S_ARR_BODY_DONE:.+]], label %[[S_ARR_BODY:.+]]
|
|
|
|
// CHECK: [[S_ARR_BODY]]
|
|
|
|
// CHECK: call {{.*}} [[S_FLOAT_TY_COPY_ASSIGN]]([[S_FLOAT_TY]]* {{.+}}, [[S_FLOAT_TY]]* {{.+}})
|
|
|
|
// CHECK: br i1 {{.+}}, label %{{.+}}, label %[[S_ARR_BODY]]
|
|
|
|
|
2015-09-10 16:12:02 +08:00
|
|
|
// TLS-CHECK: [[MASTER_CAST:%.+]] = bitcast [2 x [[S_FLOAT_TY]]]* [[MASTER_REF3]] to [[S_FLOAT_TY]]*
|
2015-07-28 00:38:06 +08:00
|
|
|
// TLS-CHECK-DAG: [[S_ARR_SRC_BEGIN:%.+]] = phi [[S_FLOAT_TY]]* {{.*}}[[MASTER_CAST]]
|
|
|
|
// TLS-CHECK-DAG: [[S_ARR_DST_BEGIN:%.+]] = phi [[S_FLOAT_TY]]* {{.*}}getelementptr inbounds ([2 x [[S_FLOAT_TY]]], [2 x [[S_FLOAT_TY]]]* [[S_ARR]], i{{[0-9]+}} 0, i{{[0-9]+}} 0)
|
|
|
|
// TLS-CHECK: call {{.*}} [[S_FLOAT_TY_COPY_ASSIGN]]([[S_FLOAT_TY]]* {{.+}}, [[S_FLOAT_TY]]* {{.+}})
|
|
|
|
// TLS-CHECK-DAG: [[S_ARR_SRC_END:%.+]] = getelementptr [[S_FLOAT_TY]], [[S_FLOAT_TY]]* [[S_ARR_SRC_BEGIN]], i{{[0-9]+}} 1
|
|
|
|
// TLS-CHECK-DAG: [[S_ARR_DST_END:%.+]] = getelementptr [[S_FLOAT_TY]], [[S_FLOAT_TY]]* [[S_ARR_DST_BEGIN]], i{{[0-9]+}} 1
|
|
|
|
// TLS-CHECK: icmp eq [[S_FLOAT_TY]]* [[S_ARR_DST_END]], getelementptr ([[S_FLOAT_TY]], [[S_FLOAT_TY]]* getelementptr inbounds ([2 x [[S_FLOAT_TY]]], [2 x [[S_FLOAT_TY]]]* [[S_ARR]], i{{[0-9]+}} 0, i{{[0-9]+}} 0), i{{[0-9]+}} 2)
|
|
|
|
// TLS-CHECK: br i1 %{{.*}}, label %[[ARR_DONE:.+]], label {{.*}}
|
|
|
|
// TLS-CHECK: [[ARR_DONE]]
|
|
|
|
|
2015-04-16 13:39:01 +08:00
|
|
|
// threadprivate_var = var;
|
2015-06-30 01:29:50 +08:00
|
|
|
// CHECK: call {{.*}}i8* @__kmpc_threadprivate_cached({{.+}} [[VAR]]
|
2015-04-16 13:39:01 +08:00
|
|
|
// CHECK: call {{.*}} [[S_FLOAT_TY_COPY_ASSIGN]]([[S_FLOAT_TY]]* {{%.+}}, [[S_FLOAT_TY]]* {{.*}}[[VAR]])
|
|
|
|
// CHECK: [[DONE]]
|
|
|
|
|
2015-09-10 16:12:02 +08:00
|
|
|
// TLS-CHECK: call {{.*}} [[S_FLOAT_TY_COPY_ASSIGN]]([[S_FLOAT_TY]]* {{.*}}[[VAR]], [[S_FLOAT_TY]]* {{.*}}[[MASTER_REF4]])
|
2015-07-28 00:38:06 +08:00
|
|
|
|
2015-09-15 20:52:43 +08:00
|
|
|
// CHECK: call {{.*}}void @__kmpc_barrier(%{{.+}}* [[IMPLICIT_BARRIER_LOC]], i32 [[GTID]])
|
2015-04-16 13:39:01 +08:00
|
|
|
// CHECK: ret void
|
|
|
|
|
2015-07-28 00:38:06 +08:00
|
|
|
// TLS-CHECK: [[GTID_ADDR:%.+]] = load i32*, i32** [[GTID_ADDR_ADDR]],
|
|
|
|
// TLS-CHECK: [[GTID:%.+]] = load i32, i32* [[GTID_ADDR]],
|
2015-09-15 20:52:43 +08:00
|
|
|
// TLS-CHECK: call {{.*}}void @__kmpc_barrier(%{{.+}}* [[IMPLICIT_BARRIER_LOC]], i32 [[GTID]])
|
2015-07-28 00:38:06 +08:00
|
|
|
// TLS-CHECK: ret void
|
|
|
|
|
2015-09-10 16:12:02 +08:00
|
|
|
// CHECK: define internal {{.*}}void [[MAIN_MICROTASK1]](i{{[0-9]+}}* noalias [[GTID_ADDR:%.+]], i{{[0-9]+}}* noalias %{{.+}})
|
2015-04-16 13:39:01 +08:00
|
|
|
// CHECK: store i{{[0-9]+}}* [[GTID_ADDR]], i{{[0-9]+}}** [[GTID_ADDR_ADDR:%.+]],
|
|
|
|
// CHECK: [[GTID_ADDR:%.+]] = load i32*, i32** [[GTID_ADDR_ADDR]],
|
|
|
|
// CHECK: [[GTID:%.+]] = load i32, i32* [[GTID_ADDR]],
|
|
|
|
|
2015-09-10 16:12:02 +08:00
|
|
|
// TLS-CHECK: define internal {{.*}}void [[MAIN_MICROTASK1]](i{{[0-9]+}}* noalias [[GTID_ADDR:%.+]], i{{[0-9]+}}* noalias %{{.+}})
|
2015-07-28 00:38:06 +08:00
|
|
|
// TLS-CHECK: store i{{[0-9]+}}* [[GTID_ADDR]], i{{[0-9]+}}** [[GTID_ADDR_ADDR:%.+]],
|
|
|
|
|
2015-04-16 13:39:01 +08:00
|
|
|
// threadprivate_t_var = t_var;
|
2015-06-30 01:29:50 +08:00
|
|
|
// CHECK: call {{.*}}i8* @__kmpc_threadprivate_cached({{.+}} [[T_VAR]]
|
2015-04-16 13:39:01 +08:00
|
|
|
// CHECK: ptrtoint i{{[0-9]+}}* %{{.+}} to i{{[0-9]+}}
|
|
|
|
// CHECK: icmp ne i{{[0-9]+}} ptrtoint (i{{[0-9]+}}* [[T_VAR]] to i{{[0-9]+}}), %{{.+}}
|
|
|
|
// CHECK: br i1 %{{.+}}, label %[[NOT_MASTER:.+]], label %[[DONE:.+]]
|
|
|
|
// CHECK: [[NOT_MASTER]]
|
|
|
|
// CHECK: load i{{[0-9]+}}, i{{[0-9]+}}* [[T_VAR]],
|
|
|
|
// CHECK: store i{{[0-9]+}} %{{.+}}, i{{[0-9]+}}* %{{.+}},
|
|
|
|
// CHECK: [[DONE]]
|
|
|
|
|
2015-09-10 16:12:02 +08:00
|
|
|
// TLS-CHECK: [[MASTER_REF:%.+]] = load i32*, i32** %
|
|
|
|
|
2015-07-28 00:38:06 +08:00
|
|
|
// TLS-CHECK: [[MASTER_LONG:%.+]] = ptrtoint i32* [[MASTER_REF]] to i{{[0-9]+}}
|
|
|
|
// TLS-CHECK: icmp ne i{{[0-9]+}} [[MASTER_LONG]], ptrtoint (i{{[0-9]+}}* [[T_VAR]] to i{{[0-9]+}})
|
|
|
|
// TLS-CHECK: br i1 %{{.+}}, label %[[NOT_MASTER:.+]], label %[[DONE:.+]]
|
|
|
|
// TLS-CHECK: [[NOT_MASTER]]
|
|
|
|
// TLS-CHECK: [[MASTER_VAL:%.+]] = load i32, i32* [[MASTER_REF]]
|
|
|
|
// TLS-CHECK: store i32 [[MASTER_VAL]], i32* [[T_VAR]]
|
|
|
|
// TLS-CHECK: [[DONE]]
|
|
|
|
|
2015-09-15 20:52:43 +08:00
|
|
|
// CHECK: call {{.*}}void @__kmpc_barrier(%{{.+}}* [[IMPLICIT_BARRIER_LOC]], i32 [[GTID]])
|
2019-06-21 23:08:30 +08:00
|
|
|
// CHECK: add nsw i32 %{{.+}}, 1
|
2015-04-16 13:39:01 +08:00
|
|
|
// CHECK: ret void
|
|
|
|
|
2015-07-28 00:38:06 +08:00
|
|
|
// TLS-CHECK: [[GTID_ADDR:%.+]] = load i32*, i32** [[GTID_ADDR_ADDR]],
|
|
|
|
// TLS-CHECK: [[GTID:%.+]] = load i32, i32* [[GTID_ADDR]],
|
2015-09-15 20:52:43 +08:00
|
|
|
// TLS-CHECK: call {{.*}}void @__kmpc_barrier(%{{.+}}* [[IMPLICIT_BARRIER_LOC]], i32 [[GTID]])
|
2015-07-28 00:38:06 +08:00
|
|
|
// TLS-CHECK: ret void
|
|
|
|
|
2015-04-16 13:39:01 +08:00
|
|
|
// CHECK: define {{.*}} i{{[0-9]+}} [[TMAIN_INT]]()
|
|
|
|
// CHECK: [[TEST:%.+]] = alloca [[S_INT_TY]],
|
|
|
|
// CHECK: call {{.*}} [[S_INT_TY_COPY_ASSIGN:@.+]]([[S_INT_TY]]* [[TEST]], [[S_INT_TY]]*
|
2015-09-10 16:12:02 +08:00
|
|
|
// CHECK: call {{.*}}void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 0, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*)* [[TMAIN_MICROTASK:@.+]] to void (i32*, i32*, ...)*))
|
|
|
|
// CHECK: call {{.*}}void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 0, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*)* [[TMAIN_MICROTASK1:@.+]] to void (i32*, i32*, ...)*))
|
2015-04-16 13:39:01 +08:00
|
|
|
// CHECK: call {{.*}} [[S_INT_TY_DESTR:@.+]]([[S_INT_TY]]*
|
|
|
|
// CHECK: ret
|
2015-07-28 00:38:06 +08:00
|
|
|
|
|
|
|
// TLS-CHECK: define {{.*}} i{{[0-9]+}} [[TMAIN_INT]]()
|
|
|
|
// TLS-CHECK: [[TEST:%.+]] = alloca [[S_INT_TY]],
|
|
|
|
// TLS-CHECK: call {{.*}} [[S_INT_TY_COPY_ASSIGN:@.+]]([[S_INT_TY]]* [[TEST]], [[S_INT_TY]]*
|
2015-09-10 16:12:02 +08:00
|
|
|
// TLS-CHECK: call {{.*}}void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 4, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*, i32*, [2 x i32]*, [2 x [[S_INT_TY]]]*, [[S_INT_TY]]*)* [[TMAIN_MICROTASK:@.+]] to void (i32*, i32*, ...)*),
|
|
|
|
// TLS-CHECK: call {{.*}}void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 1, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*, i32*)* [[TMAIN_MICROTASK1:@.+]] to void (i32*, i32*, ...)*),
|
2015-04-16 13:39:01 +08:00
|
|
|
//
|
2015-09-10 16:12:02 +08:00
|
|
|
// CHECK: define internal {{.*}}void [[TMAIN_MICROTASK]](i{{[0-9]+}}* noalias [[GTID_ADDR:%.+]], i{{[0-9]+}}* noalias %{{.+}})
|
2015-04-16 13:39:01 +08:00
|
|
|
// CHECK: store i{{[0-9]+}}* [[GTID_ADDR]], i{{[0-9]+}}** [[GTID_ADDR_ADDR:%.+]],
|
|
|
|
// CHECK: [[GTID_ADDR:%.+]] = load i32*, i32** [[GTID_ADDR_ADDR]],
|
|
|
|
// CHECK: [[GTID:%.+]] = load i32, i32* [[GTID_ADDR]],
|
2015-07-28 00:38:06 +08:00
|
|
|
//
|
2015-09-10 16:12:02 +08:00
|
|
|
// TLS-CHECK: define internal {{.*}}void [[TMAIN_MICROTASK]](i{{[0-9]+}}* noalias [[GTID_ADDR:%.+]], i{{[0-9]+}}* noalias %{{.+}})
|
2015-07-28 00:38:06 +08:00
|
|
|
// TLS-CHECK: store i{{[0-9]+}}* [[GTID_ADDR]], i{{[0-9]+}}** [[GTID_ADDR_ADDR:%.+]],
|
2015-04-16 13:39:01 +08:00
|
|
|
|
|
|
|
// threadprivate_t_var = t_var;
|
2015-06-30 01:29:50 +08:00
|
|
|
// CHECK: call {{.*}}i8* @__kmpc_threadprivate_cached({{.+}} [[TMAIN_T_VAR]]
|
2015-04-16 13:39:01 +08:00
|
|
|
// CHECK: ptrtoint i{{[0-9]+}}* %{{.+}} to i{{[0-9]+}}
|
|
|
|
// CHECK: icmp ne i{{[0-9]+}} ptrtoint (i{{[0-9]+}}* [[TMAIN_T_VAR]] to i{{[0-9]+}}), %{{.+}}
|
|
|
|
// CHECK: br i1 %{{.+}}, label %[[NOT_MASTER:.+]], label %[[DONE:.+]]
|
|
|
|
// CHECK: [[NOT_MASTER]]
|
2015-09-10 17:48:30 +08:00
|
|
|
// CHECK: load i{{[0-9]+}}, i{{[0-9]+}}* [[TMAIN_T_VAR]], align 128
|
|
|
|
// CHECK: store i{{[0-9]+}} %{{.+}}, i{{[0-9]+}}* %{{.+}}, align 128
|
2015-04-16 13:39:01 +08:00
|
|
|
|
2015-09-10 16:12:02 +08:00
|
|
|
// TLS-CHECK: [[MASTER_REF:%.+]] = load i32*, i32** %
|
|
|
|
// TLS-CHECK: [[MASTER_REF1:%.+]] = load [2 x i32]*, [2 x i32]** %
|
|
|
|
// TLS-CHECK: [[MASTER_REF2:%.+]] = load [2 x [[S_INT_TY]]]*, [2 x [[S_INT_TY]]]** %
|
|
|
|
// TLS-CHECK: [[MASTER_REF3:%.+]] = load [[S_INT_TY]]*, [[S_INT_TY]]** %
|
|
|
|
|
2015-07-28 00:38:06 +08:00
|
|
|
// TLS-CHECK: [[MASTER_LONG:%.+]] = ptrtoint i32* [[MASTER_REF]] to i{{[0-9]+}}
|
|
|
|
// TLS-CHECK: icmp ne i{{[0-9]+}} [[MASTER_LONG]], ptrtoint (i{{[0-9]+}}* [[TMAIN_T_VAR]] to i{{[0-9]+}})
|
|
|
|
// TLS-CHECK: br i1 %{{.+}}, label %[[NOT_MASTER:.+]], label %[[DONE:.+]]
|
|
|
|
// TLS-CHECK: [[NOT_MASTER]]
|
2015-09-10 17:48:30 +08:00
|
|
|
// TLS-CHECK: [[MASTER_VAL:%.+]] = load i32, i32* [[MASTER_REF]],
|
|
|
|
// TLS-CHECK: store i32 [[MASTER_VAL]], i32* [[TMAIN_T_VAR]], align 128
|
2015-07-28 00:38:06 +08:00
|
|
|
|
2015-04-16 13:39:01 +08:00
|
|
|
// threadprivate_vec = vec;
|
2015-06-30 01:29:50 +08:00
|
|
|
// CHECK: call {{.*}}i8* @__kmpc_threadprivate_cached({{.+}} [[TMAIN_VEC]]
|
Change memcpy/memove/memset to have dest and source alignment attributes (Step 1).
Summary:
Upstream LLVM is changing the the prototypes of the @llvm.memcpy/memmove/memset
intrinsics. This change updates the Clang tests for this change.
The @llvm.memcpy/memmove/memset intrinsics currently have an explicit argument
which is required to be a constant integer. It represents the alignment of the
dest (and source), and so must be the minimum of the actual alignment of the
two.
This change removes the alignment argument in favour of placing the alignment
attribute on the source and destination pointers of the memory intrinsic call.
For example, code which used to read:
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 100, i32 4, i1 false)
will now read
call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %dest, i8* align 4 %src, i32 100, i1 false)
At this time the source and destination alignments must be the same (Step 1).
Step 2 of the change, to be landed shortly, will relax that contraint and allow
the source and destination to have different alignments.
llvm-svn: 322964
2018-01-20 01:12:54 +08:00
|
|
|
// CHECK: call {{.*}}void @llvm.memcpy{{.*}}(i8* align {{[0-9]+}} %{{.+}}, i8* align {{[0-9]+}} bitcast ([2 x i{{[0-9]+}}]* [[TMAIN_VEC]] to i8*),
|
2015-04-16 13:39:01 +08:00
|
|
|
|
2015-09-10 16:12:02 +08:00
|
|
|
// TLS-CHECK: [[MASTER_CAST:%.+]] = bitcast [2 x i32]* [[MASTER_REF1]] to i8*
|
Change memcpy/memove/memset to have dest and source alignment attributes (Step 1).
Summary:
Upstream LLVM is changing the the prototypes of the @llvm.memcpy/memmove/memset
intrinsics. This change updates the Clang tests for this change.
The @llvm.memcpy/memmove/memset intrinsics currently have an explicit argument
which is required to be a constant integer. It represents the alignment of the
dest (and source), and so must be the minimum of the actual alignment of the
two.
This change removes the alignment argument in favour of placing the alignment
attribute on the source and destination pointers of the memory intrinsic call.
For example, code which used to read:
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 100, i32 4, i1 false)
will now read
call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %dest, i8* align 4 %src, i32 100, i1 false)
At this time the source and destination alignments must be the same (Step 1).
Step 2 of the change, to be landed shortly, will relax that contraint and allow
the source and destination to have different alignments.
llvm-svn: 322964
2018-01-20 01:12:54 +08:00
|
|
|
// TLS-CHECK: call void @llvm.memcpy{{.*}}(i8* align {{[0-9]+}} bitcast ([2 x i{{[0-9]+}}]* [[TMAIN_VEC]] to i8*), i8* align {{[0-9]+}} [[MASTER_CAST]]
|
2015-07-28 00:38:06 +08:00
|
|
|
|
2015-04-16 13:39:01 +08:00
|
|
|
// threadprivate_s_arr = s_arr;
|
2015-06-30 01:29:50 +08:00
|
|
|
// CHECK: call {{.*}}i8* @__kmpc_threadprivate_cached({{.+}} [[TMAIN_S_ARR]]
|
2015-04-16 13:39:01 +08:00
|
|
|
// CHECK: [[S_ARR_PRIV_BEGIN:%.+]] = getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* {{%.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 0
|
|
|
|
// CHECK: [[S_ARR_PRIV_END:%.+]] = getelementptr [[S_INT_TY]], [[S_INT_TY]]* [[S_ARR_PRIV_BEGIN]], i{{[0-9]+}} 2
|
|
|
|
// CHECK: [[IS_EMPTY:%.+]] = icmp eq [[S_INT_TY]]* [[S_ARR_PRIV_BEGIN]], [[S_ARR_PRIV_END]]
|
|
|
|
// CHECK: br i1 [[IS_EMPTY]], label %[[S_ARR_BODY_DONE:.+]], label %[[S_ARR_BODY:.+]]
|
|
|
|
// CHECK: [[S_ARR_BODY]]
|
|
|
|
// CHECK: call {{.*}} [[S_INT_TY_COPY_ASSIGN]]([[S_INT_TY]]* {{.+}}, [[S_INT_TY]]* {{.+}})
|
|
|
|
// CHECK: br i1 {{.+}}, label %{{.+}}, label %[[S_ARR_BODY]]
|
|
|
|
|
2015-09-10 16:12:02 +08:00
|
|
|
// TLS-CHECK: [[MASTER_CAST:%.+]] = bitcast [2 x [[S_INT_TY]]]* [[MASTER_REF2]] to [[S_INT_TY]]*
|
2015-07-28 00:38:06 +08:00
|
|
|
// TLS-CHECK-DAG: [[S_ARR_SRC_BEGIN:%.+]] = phi [[S_INT_TY]]* {{.*}}[[MASTER_CAST]]
|
|
|
|
// TLS-CHECK-DAG: [[S_ARR_DST_BEGIN:%.+]] = phi [[S_INT_TY]]* {{.*}}getelementptr inbounds ([2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* [[TMAIN_S_ARR]], i{{[0-9]+}} 0, i{{[0-9]+}} 0)
|
|
|
|
// TLS-CHECK: call {{.*}} [[S_INT_TY_COPY_ASSIGN]]([[S_INT_TY]]* {{.+}}, [[S_INT_TY]]* {{.+}})
|
|
|
|
// TLS-CHECK-DAG: [[S_ARR_SRC_END:%.+]] = getelementptr [[S_INT_TY]], [[S_INT_TY]]* [[S_ARR_SRC_BEGIN]], i{{[0-9]+}} 1
|
|
|
|
// TLS-CHECK-DAG: [[S_ARR_DST_END:%.+]] = getelementptr [[S_INT_TY]], [[S_INT_TY]]* [[S_ARR_DST_BEGIN]], i{{[0-9]+}} 1
|
|
|
|
// TLS-CHECK: icmp eq [[S_INT_TY]]* [[S_ARR_DST_END]], getelementptr ([[S_INT_TY]], [[S_INT_TY]]* getelementptr inbounds ([2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* [[TMAIN_S_ARR]], i{{[0-9]+}} 0, i{{[0-9]+}} 0), i{{[0-9]+}} 2)
|
|
|
|
// TLS-CHECK: br i1 %{{.*}}, label %[[ARR_DONE:.+]], label {{.*}}
|
|
|
|
// TLS-CHECK: [[ARR_DONE]]
|
|
|
|
|
2015-04-16 13:39:01 +08:00
|
|
|
// threadprivate_var = var;
|
2015-06-30 01:29:50 +08:00
|
|
|
// CHECK: call {{.*}}i8* @__kmpc_threadprivate_cached({{.+}} [[TMAIN_VAR]]
|
2015-04-16 13:39:01 +08:00
|
|
|
// CHECK: call {{.*}} [[S_INT_TY_COPY_ASSIGN]]([[S_INT_TY]]* {{%.+}}, [[S_INT_TY]]* {{.*}}[[TMAIN_VAR]])
|
|
|
|
// CHECK: [[DONE]]
|
|
|
|
|
2015-09-10 16:12:02 +08:00
|
|
|
// TLS-CHECK: call {{.*}} [[S_INT_TY_COPY_ASSIGN]]([[S_INT_TY]]* {{.*}}[[TMAIN_VAR]], [[S_INT_TY]]* {{.*}}[[MASTER_REF3]])
|
2015-07-28 00:38:06 +08:00
|
|
|
|
2015-09-15 20:52:43 +08:00
|
|
|
// CHECK: call {{.*}}void @__kmpc_barrier(%{{.+}}* [[IMPLICIT_BARRIER_LOC]], i32 [[GTID]])
|
2015-04-16 13:39:01 +08:00
|
|
|
// CHECK: ret void
|
|
|
|
|
2015-07-28 00:38:06 +08:00
|
|
|
// TLS-CHECK: [[GTID_ADDR:%.+]] = load i32*, i32** [[GTID_ADDR_ADDR]],
|
|
|
|
// TLS-CHECK: [[GTID:%.+]] = load i32, i32* [[GTID_ADDR]],
|
2015-09-15 20:52:43 +08:00
|
|
|
// TLS-CHECK: call {{.*}}void @__kmpc_barrier(%{{.+}}* [[IMPLICIT_BARRIER_LOC]], i32 [[GTID]])
|
2015-07-28 00:38:06 +08:00
|
|
|
// TLS-CHECK: ret void
|
|
|
|
|
2015-09-10 16:12:02 +08:00
|
|
|
// CHECK: define internal {{.*}}void [[TMAIN_MICROTASK1]](i{{[0-9]+}}* noalias [[GTID_ADDR:%.+]], i{{[0-9]+}}* noalias %{{.+}})
|
2015-04-16 13:39:01 +08:00
|
|
|
// CHECK: store i{{[0-9]+}}* [[GTID_ADDR]], i{{[0-9]+}}** [[GTID_ADDR_ADDR:%.+]],
|
|
|
|
// CHECK: [[GTID_ADDR:%.+]] = load i32*, i32** [[GTID_ADDR_ADDR]],
|
|
|
|
// CHECK: [[GTID:%.+]] = load i32, i32* [[GTID_ADDR]],
|
|
|
|
|
2015-09-10 16:12:02 +08:00
|
|
|
// TLS-CHECK: define internal {{.*}}void [[TMAIN_MICROTASK1]](i{{[0-9]+}}* noalias [[GTID_ADDR:%.+]], i{{[0-9]+}}* noalias %{{.+}},
|
2015-07-28 00:38:06 +08:00
|
|
|
// TLS-CHECK: store i{{[0-9]+}}* [[GTID_ADDR]], i{{[0-9]+}}** [[GTID_ADDR_ADDR:%.+]],
|
|
|
|
|
2015-04-16 13:39:01 +08:00
|
|
|
// threadprivate_t_var = t_var;
|
2015-06-30 01:29:50 +08:00
|
|
|
// CHECK: call {{.*}}i8* @__kmpc_threadprivate_cached({{.+}} [[TMAIN_T_VAR]]
|
2015-04-16 13:39:01 +08:00
|
|
|
// CHECK: ptrtoint i{{[0-9]+}}* %{{.+}} to i{{[0-9]+}}
|
|
|
|
// CHECK: icmp ne i{{[0-9]+}} ptrtoint (i{{[0-9]+}}* [[TMAIN_T_VAR]] to i{{[0-9]+}}), %{{.+}}
|
|
|
|
// CHECK: br i1 %{{.+}}, label %[[NOT_MASTER:.+]], label %[[DONE:.+]]
|
|
|
|
// CHECK: [[NOT_MASTER]]
|
|
|
|
// CHECK: load i{{[0-9]+}}, i{{[0-9]+}}* [[TMAIN_T_VAR]],
|
|
|
|
// CHECK: store i{{[0-9]+}} %{{.+}}, i{{[0-9]+}}* %{{.+}},
|
|
|
|
// CHECK: [[DONE]]
|
|
|
|
|
2015-09-10 16:12:02 +08:00
|
|
|
// TLS-CHECK: [[MASTER_REF:%.+]] = load i32*, i32** %
|
|
|
|
|
2015-07-28 00:38:06 +08:00
|
|
|
// TLS-CHECK: [[MASTER_LONG:%.+]] = ptrtoint i32* [[MASTER_REF]] to i{{[0-9]+}}
|
|
|
|
// TLS-CHECK: icmp ne i{{[0-9]+}} [[MASTER_LONG]], ptrtoint (i{{[0-9]+}}* [[TMAIN_T_VAR]] to i{{[0-9]+}})
|
|
|
|
// TLS-CHECK: br i1 %{{.+}}, label %[[NOT_MASTER:.+]], label %[[DONE:.+]]
|
|
|
|
// TLS-CHECK: [[NOT_MASTER]]
|
|
|
|
// TLS-CHECK: [[MASTER_VAL:%.+]] = load i32, i32* [[MASTER_REF]]
|
|
|
|
// TLS-CHECK: store i32 [[MASTER_VAL]], i32* [[TMAIN_T_VAR]]
|
|
|
|
// TLS-CHECK: [[DONE]]
|
|
|
|
|
2015-09-15 20:52:43 +08:00
|
|
|
// CHECK: call {{.*}}void @__kmpc_barrier(%{{.+}}* [[IMPLICIT_BARRIER_LOC]], i32 [[GTID]])
|
2015-04-16 13:39:01 +08:00
|
|
|
// CHECK: ret void
|
|
|
|
|
2015-07-28 00:38:06 +08:00
|
|
|
// TLS-CHECK: [[GTID_ADDR:%.+]] = load i32*, i32** [[GTID_ADDR_ADDR]],
|
|
|
|
// TLS-CHECK: [[GTID:%.+]] = load i32, i32* [[GTID_ADDR]],
|
2015-09-15 20:52:43 +08:00
|
|
|
// TLS-CHECK: call {{.*}}void @__kmpc_barrier(%{{.+}}* [[IMPLICIT_BARRIER_LOC]], i32 [[GTID]])
|
2015-07-28 00:38:06 +08:00
|
|
|
// TLS-CHECK: ret void
|
|
|
|
|
2015-04-16 13:39:01 +08:00
|
|
|
#endif
|
2019-07-19 03:40:24 +08:00
|
|
|
#elif defined(ARRAY)
|
2015-05-19 20:31:28 +08:00
|
|
|
// ARRAY-LABEL: array_func
|
2015-07-28 00:38:06 +08:00
|
|
|
// TLS-ARRAY-LABEL: array_func
|
|
|
|
|
2015-05-19 20:31:28 +08:00
|
|
|
struct St {
|
|
|
|
int a, b;
|
|
|
|
St() : a(0), b(0) {}
|
|
|
|
St &operator=(const St &) { return *this; };
|
|
|
|
~St() {}
|
|
|
|
};
|
|
|
|
|
|
|
|
void array_func() {
|
|
|
|
static int a[2];
|
|
|
|
static St s[2];
|
|
|
|
// ARRAY: @__kmpc_fork_call(
|
|
|
|
// ARRAY: call i8* @__kmpc_threadprivate_cached(
|
Change memcpy/memove/memset to have dest and source alignment attributes (Step 1).
Summary:
Upstream LLVM is changing the the prototypes of the @llvm.memcpy/memmove/memset
intrinsics. This change updates the Clang tests for this change.
The @llvm.memcpy/memmove/memset intrinsics currently have an explicit argument
which is required to be a constant integer. It represents the alignment of the
dest (and source), and so must be the minimum of the actual alignment of the
two.
This change removes the alignment argument in favour of placing the alignment
attribute on the source and destination pointers of the memory intrinsic call.
For example, code which used to read:
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 100, i32 4, i1 false)
will now read
call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %dest, i8* align 4 %src, i32 100, i1 false)
At this time the source and destination alignments must be the same (Step 1).
Step 2 of the change, to be landed shortly, will relax that contraint and allow
the source and destination to have different alignments.
llvm-svn: 322964
2018-01-20 01:12:54 +08:00
|
|
|
// ARRAY: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %{{.+}}, i8* align 4 bitcast ([2 x i32]* @{{.+}} to i8*), i64 8, i1 false)
|
2020-05-19 02:29:11 +08:00
|
|
|
// ARRAY: call nonnull align 4 dereferenceable(8) %struct.St* @{{.+}}(%struct.St* %{{.+}}, %struct.St* nonnull align 4 dereferenceable(8) %{{.+}})
|
2015-07-28 00:38:06 +08:00
|
|
|
|
|
|
|
// TLS-ARRAY: @__kmpc_fork_call(
|
2015-09-10 16:12:02 +08:00
|
|
|
// TLS-ARRAY: [[REFT:%.+]] = load [2 x i32]*, [2 x i32]** [[ADDR:%.+]],
|
|
|
|
// TLS-ARRAY: [[REF:%.+]] = bitcast [2 x i32]* [[REFT]] to i8*
|
Change memcpy/memove/memset to have dest and source alignment attributes (Step 1).
Summary:
Upstream LLVM is changing the the prototypes of the @llvm.memcpy/memmove/memset
intrinsics. This change updates the Clang tests for this change.
The @llvm.memcpy/memmove/memset intrinsics currently have an explicit argument
which is required to be a constant integer. It represents the alignment of the
dest (and source), and so must be the minimum of the actual alignment of the
two.
This change removes the alignment argument in favour of placing the alignment
attribute on the source and destination pointers of the memory intrinsic call.
For example, code which used to read:
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 100, i32 4, i1 false)
will now read
call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %dest, i8* align 4 %src, i32 100, i1 false)
At this time the source and destination alignments must be the same (Step 1).
Step 2 of the change, to be landed shortly, will relax that contraint and allow
the source and destination to have different alignments.
llvm-svn: 322964
2018-01-20 01:12:54 +08:00
|
|
|
// TLS-ARRAY: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 bitcast ([2 x i32]* @{{.+}} to i8*), i8* align 4 [[REF]], i64 8, i1 false)
|
2020-05-19 02:29:11 +08:00
|
|
|
// TLS-ARRAY: call nonnull align 4 dereferenceable(8) %struct.St* @{{.+}}(%struct.St* %{{.+}}, %struct.St* nonnull align 4 dereferenceable(8) %{{.+}})
|
2015-07-28 00:38:06 +08:00
|
|
|
|
2015-05-19 20:31:28 +08:00
|
|
|
#pragma omp threadprivate(a, s)
|
|
|
|
#pragma omp parallel copyin(a, s)
|
|
|
|
;
|
|
|
|
}
|
2019-07-19 03:40:24 +08:00
|
|
|
#elif defined(NESTED)
|
2019-09-13 04:00:24 +08:00
|
|
|
int t_init();
|
|
|
|
int t = t_init();
|
2019-07-19 03:40:24 +08:00
|
|
|
#pragma omp threadprivate(t)
|
|
|
|
// NESTED: foo
|
|
|
|
void foo() {
|
|
|
|
// NESTED: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @{{.+}}, i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* [[OUTLINED:@.+]] to void (i32*, i32*, ...)*))
|
|
|
|
#pragma omp parallel
|
|
|
|
#pragma omp parallel copyin(t)
|
|
|
|
++t;
|
|
|
|
}
|
|
|
|
// NESTED: define {{.*}}void [[OUTLINED]](
|
|
|
|
// NESTED: [[T:%.+]] = call i32* [[THRP_T:@.+]]()
|
|
|
|
// NESTED: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @{{.+}}, i32 1, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32*)* [[OUTLINED1:@.+]] to void (i32*, i32*, ...)*), i32* [[T]])
|
|
|
|
|
|
|
|
// NESTED: define {{.*}}void [[OUTLINED1]](
|
|
|
|
// NESTED: [[T_MASTER:%.+]] = load i32*, i32** %
|
|
|
|
// NESTED: [[T:%.+]] = call i32* [[THRP_T]]()
|
|
|
|
// NESTED: [[T_MASTER_VAL:%.+]] = load i32, i32* [[T_MASTER]],
|
|
|
|
// NESTED: store i32 [[T_MASTER_VAL]], i32* [[T]],
|
|
|
|
#endif // NESTED
|
2015-04-16 13:39:01 +08:00
|
|
|
|