2020-06-25 15:01:15 +08:00
|
|
|
// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -fnoopenmp-use-tls -x c++ -std=c++11 -triple x86_64-unknown-unknown -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s --check-prefixes=OMP50,CHECK
|
|
|
|
// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -fnoopenmp-use-tls -x c++ -std=c++11 -triple x86_64-unknown-unknown -emit-llvm %s -fexceptions -fcxx-exceptions -fopenmp-version=45 -o - | FileCheck %s --check-prefixes=OMP45,CHECK
|
|
|
|
|
|
|
|
// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fnoopenmp-use-tls -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
|
|
|
|
// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fnoopenmp-use-tls -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefixes=OMP50,CHECK
|
|
|
|
|
|
|
|
// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -fnoopenmp-use-tls -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
|
|
|
|
// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -fnoopenmp-use-tls -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefixes=OMP45,CHECK
|
|
|
|
|
2016-03-17 18:50:17 +08:00
|
|
|
// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -std=c++11 -fopenmp -fnoopenmp-use-tls -fexceptions -fcxx-exceptions -debug-info-kind=line-tables-only -x c++ -emit-llvm %s -o - | FileCheck %s --check-prefix=TERM_DEBUG
|
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
|
2017-12-30 02:07:07 +08:00
|
|
|
|
2020-02-04 02:09:39 +08:00
|
|
|
// RUN: %clang_cc1 -verify -fopenmp-simd -fnoopenmp-use-tls -x c++ -std=c++11 -triple x86_64-unknown-unknown -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck --check-prefix SIMD-ONLY0 %s
|
2017-12-30 02:07:07 +08:00
|
|
|
// RUN: %clang_cc1 -fopenmp-simd -fnoopenmp-use-tls -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
|
2020-02-04 02:09:39 +08:00
|
|
|
// RUN: %clang_cc1 -fopenmp-simd -fnoopenmp-use-tls -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
|
2017-12-30 02:07:07 +08:00
|
|
|
// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -std=c++11 -fopenmp-simd -fnoopenmp-use-tls -fexceptions -fcxx-exceptions -debug-info-kind=line-tables-only -x c++ -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
|
|
|
|
// 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}}
|
2015-02-05 14:35:41 +08:00
|
|
|
// expected-no-diagnostics
|
2015-05-19 20:31:28 +08:00
|
|
|
#ifndef ARRAY
|
2015-02-05 14:35:41 +08:00
|
|
|
#ifndef HEADER
|
|
|
|
#define HEADER
|
|
|
|
|
2015-03-23 14:18:07 +08:00
|
|
|
class TestClass {
|
|
|
|
public:
|
|
|
|
int a;
|
|
|
|
TestClass() : a(0) {}
|
|
|
|
TestClass(const TestClass &C) : a(C.a) {}
|
|
|
|
TestClass &operator=(const TestClass &) { return *this;}
|
|
|
|
~TestClass(){};
|
|
|
|
};
|
|
|
|
|
|
|
|
// CHECK-DAG: [[TEST_CLASS_TY:%.+]] = type { i{{[0-9]+}} }
|
2016-03-17 18:50:17 +08:00
|
|
|
// CHECK-DAG: [[SST_TY:%.+]] = type { double }
|
|
|
|
// CHECK-DAG: [[SS_TY:%.+]] = type { i32, i8, i32* }
|
|
|
|
// CHECK-DAG: [[IDENT_T_TY:%.+]] = type { i32, i32, i32, i32, i8* }
|
2020-05-28 22:41:01 +08:00
|
|
|
// CHECK: [[IMPLICIT_BARRIER_SINGLE_LOC:@.+]] = private unnamed_addr constant %{{.+}} { i32 0, i32 322, i32 0, i32 0, i8*
|
2015-02-05 14:35:41 +08:00
|
|
|
|
|
|
|
// CHECK: define void [[FOO:@.+]]()
|
|
|
|
|
2015-03-23 14:18:07 +08:00
|
|
|
TestClass tc;
|
2015-04-14 13:11:24 +08:00
|
|
|
TestClass tc2[2];
|
|
|
|
#pragma omp threadprivate(tc, tc2)
|
2015-03-23 14:18:07 +08:00
|
|
|
|
2020-07-16 05:47:45 +08:00
|
|
|
void foo() { extern void mayThrow(); mayThrow(); }
|
2015-02-05 14:35:41 +08:00
|
|
|
|
2016-03-17 18:50:17 +08:00
|
|
|
struct SS {
|
|
|
|
int a;
|
|
|
|
int b : 4;
|
|
|
|
int &c;
|
|
|
|
SS(int &d) : a(0), b(0), c(d) {
|
|
|
|
#pragma omp parallel firstprivate(a, b, c)
|
|
|
|
#pragma omp single copyprivate(a, this->b, (this)->c)
|
|
|
|
[&]() {
|
|
|
|
++this->a, --b, (this)->c /= 1;
|
|
|
|
#pragma omp parallel firstprivate(a, b, c)
|
|
|
|
#pragma omp single copyprivate(a, this->b, (this)->c)
|
|
|
|
++(this)->a, --b, this->c /= 1;
|
|
|
|
}();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template<typename T>
|
|
|
|
struct SST {
|
|
|
|
T a;
|
|
|
|
SST() : a(T()) {
|
|
|
|
#pragma omp parallel firstprivate(a)
|
|
|
|
#pragma omp single copyprivate(this->a)
|
|
|
|
[&]() {
|
|
|
|
[&]() {
|
|
|
|
++this->a;
|
|
|
|
#pragma omp parallel firstprivate(a)
|
|
|
|
#pragma omp single copyprivate((this)->a)
|
|
|
|
++(this)->a;
|
|
|
|
}();
|
|
|
|
}();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2015-02-05 14:35:41 +08:00
|
|
|
// CHECK-LABEL: @main
|
2015-03-10 13:15:26 +08:00
|
|
|
// TERM_DEBUG-LABEL: @main
|
2015-02-05 14:35:41 +08:00
|
|
|
int main() {
|
2018-10-05 23:08:53 +08:00
|
|
|
// CHECK: alloca i32
|
2015-03-23 14:18:07 +08:00
|
|
|
// CHECK-DAG: [[A_ADDR:%.+]] = alloca i8
|
2015-04-14 13:11:24 +08:00
|
|
|
// CHECK-DAG: [[A2_ADDR:%.+]] = alloca [2 x i8]
|
2015-03-23 14:18:07 +08:00
|
|
|
// CHECK-DAG: [[C_ADDR:%.+]] = alloca [[TEST_CLASS_TY]]
|
2018-10-05 23:08:53 +08:00
|
|
|
// CHECK-DAG: [[DID_IT:%.+]] = alloca i32,
|
|
|
|
// CHECK-DAG: [[COPY_LIST:%.+]] = alloca [5 x i8*],
|
2015-02-05 14:35:41 +08:00
|
|
|
char a;
|
2015-04-14 13:11:24 +08:00
|
|
|
char a2[2];
|
2015-09-04 19:26:21 +08:00
|
|
|
TestClass &c = tc;
|
2016-03-17 18:50:17 +08:00
|
|
|
SST<double> sst;
|
|
|
|
SS ss(c.a);
|
2015-02-05 14:35:41 +08:00
|
|
|
|
|
|
|
// CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num([[IDENT_T_TY]]* [[DEFAULT_LOC:@.+]])
|
|
|
|
// CHECK: [[RES:%.+]] = call i32 @__kmpc_single([[IDENT_T_TY]]* [[DEFAULT_LOC]], i32 [[GTID]])
|
|
|
|
// CHECK-NEXT: [[IS_SINGLE:%.+]] = icmp ne i32 [[RES]], 0
|
|
|
|
// CHECK-NEXT: br i1 [[IS_SINGLE]], label {{%?}}[[THEN:.+]], label {{%?}}[[EXIT:.+]]
|
|
|
|
// CHECK: [[THEN]]
|
|
|
|
// CHECK-NEXT: store i8 2, i8* [[A_ADDR]]
|
|
|
|
// CHECK-NEXT: call void @__kmpc_end_single([[IDENT_T_TY]]* [[DEFAULT_LOC]], i32 [[GTID]])
|
|
|
|
// CHECK-NEXT: br label {{%?}}[[EXIT]]
|
|
|
|
// CHECK: [[EXIT]]
|
2015-04-24 12:00:39 +08:00
|
|
|
// CHECK-NOT: call {{.+}} @__kmpc_cancel_barrier
|
2015-03-23 14:18:07 +08:00
|
|
|
#pragma omp single nowait
|
2015-02-05 14:35:41 +08:00
|
|
|
a = 2;
|
|
|
|
// CHECK: [[RES:%.+]] = call i32 @__kmpc_single([[IDENT_T_TY]]* [[DEFAULT_LOC]], i32 [[GTID]])
|
|
|
|
// CHECK-NEXT: [[IS_SINGLE:%.+]] = icmp ne i32 [[RES]], 0
|
|
|
|
// CHECK-NEXT: br i1 [[IS_SINGLE]], label {{%?}}[[THEN:.+]], label {{%?}}[[EXIT:.+]]
|
|
|
|
// CHECK: [[THEN]]
|
2015-04-24 12:00:39 +08:00
|
|
|
// CHECK-NEXT: store i8 2, i8* [[A_ADDR]]
|
|
|
|
// CHECK-NEXT: call void @__kmpc_end_single([[IDENT_T_TY]]* [[DEFAULT_LOC]], i32 [[GTID]])
|
|
|
|
// CHECK-NEXT: br label {{%?}}[[EXIT]]
|
|
|
|
// CHECK: [[EXIT]]
|
2015-07-03 17:56:58 +08:00
|
|
|
// CHECK: call{{.*}} @__kmpc_barrier([[IDENT_T_TY]]* [[IMPLICIT_BARRIER_SINGLE_LOC]], i32 [[GTID]])
|
2015-04-24 12:00:39 +08:00
|
|
|
#pragma omp single
|
|
|
|
a = 2;
|
2015-04-30 11:47:32 +08:00
|
|
|
// CHECK: store i32 0, i32* [[DID_IT]]
|
2015-04-24 12:00:39 +08:00
|
|
|
// CHECK: [[RES:%.+]] = call i32 @__kmpc_single([[IDENT_T_TY]]* [[DEFAULT_LOC]], i32 [[GTID]])
|
|
|
|
// CHECK-NEXT: [[IS_SINGLE:%.+]] = icmp ne i32 [[RES]], 0
|
|
|
|
// CHECK-NEXT: br i1 [[IS_SINGLE]], label {{%?}}[[THEN:.+]], label {{%?}}[[EXIT:.+]]
|
|
|
|
// CHECK: [[THEN]]
|
2015-03-10 13:15:26 +08:00
|
|
|
// CHECK-NEXT: invoke void [[FOO]]()
|
2015-03-23 14:18:07 +08:00
|
|
|
// CHECK: to label {{%?}}[[CONT:.+]] unwind
|
|
|
|
// CHECK: [[CONT]]
|
2016-03-28 20:58:34 +08:00
|
|
|
// CHECK: call void @__kmpc_end_single([[IDENT_T_TY]]* [[DEFAULT_LOC]], i32 [[GTID]])
|
2016-03-29 13:34:15 +08:00
|
|
|
// CHECK: store i32 1, i32* [[DID_IT]]
|
2015-02-05 14:35:41 +08:00
|
|
|
// CHECK-NEXT: br label {{%?}}[[EXIT]]
|
|
|
|
// CHECK: [[EXIT]]
|
2015-04-14 13:11:24 +08:00
|
|
|
// CHECK: [[A_PTR_REF:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[COPY_LIST]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
|
2015-03-23 14:18:07 +08:00
|
|
|
// CHECK: store i8* [[A_ADDR]], i8** [[A_PTR_REF]],
|
2015-04-14 13:11:24 +08:00
|
|
|
// CHECK: [[C_PTR_REF:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[COPY_LIST]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
|
2015-09-04 19:26:21 +08:00
|
|
|
// CHECK: store i8* {{.+}}, i8** [[C_PTR_REF]],
|
2015-04-14 13:11:24 +08:00
|
|
|
// CHECK: [[TC_PTR_REF:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[COPY_LIST]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
|
2015-03-23 14:18:07 +08:00
|
|
|
// CHECK: [[TC_THREADPRIVATE_ADDR_VOID_PTR:%.+]] = call{{.*}} i8* @__kmpc_threadprivate_cached
|
|
|
|
// CHECK: [[TC_THREADPRIVATE_ADDR:%.+]] = bitcast i8* [[TC_THREADPRIVATE_ADDR_VOID_PTR]] to [[TEST_CLASS_TY]]*
|
|
|
|
// CHECK: [[TC_PTR_REF_VOID_PTR:%.+]] = bitcast [[TEST_CLASS_TY]]* [[TC_THREADPRIVATE_ADDR]] to i8*
|
|
|
|
// CHECK: store i8* [[TC_PTR_REF_VOID_PTR]], i8** [[TC_PTR_REF]],
|
2015-04-14 13:11:24 +08:00
|
|
|
// CHECK: [[A2_PTR_REF:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[COPY_LIST]], i{{[0-9]+}} 0, i{{[0-9]+}} 3
|
|
|
|
// CHECK: [[BITCAST:%.+]] = bitcast [2 x i8]* [[A2_ADDR]] to i8*
|
|
|
|
// CHECK: store i8* [[BITCAST]], i8** [[A2_PTR_REF]],
|
|
|
|
// CHECK: [[TC2_PTR_REF:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[COPY_LIST]], i{{[0-9]+}} 0, i{{[0-9]+}} 4
|
|
|
|
// CHECK: [[TC2_THREADPRIVATE_ADDR_VOID_PTR:%.+]] = call{{.*}} i8* @__kmpc_threadprivate_cached
|
|
|
|
// CHECK: [[TC2_THREADPRIVATE_ADDR:%.+]] = bitcast i8* [[TC2_THREADPRIVATE_ADDR_VOID_PTR]] to [2 x [[TEST_CLASS_TY]]]*
|
|
|
|
// CHECK: [[TC2_PTR_REF_VOID_PTR:%.+]] = bitcast [2 x [[TEST_CLASS_TY]]]* [[TC2_THREADPRIVATE_ADDR]] to i8*
|
|
|
|
// CHECK: store i8* [[TC2_PTR_REF_VOID_PTR]], i8** [[TC2_PTR_REF]],
|
|
|
|
// CHECK: [[COPY_LIST_VOID_PTR:%.+]] = bitcast [5 x i8*]* [[COPY_LIST]] to i8*
|
2015-03-23 14:18:07 +08:00
|
|
|
// CHECK: [[DID_IT_VAL:%.+]] = load i32, i32* [[DID_IT]],
|
2015-04-30 11:47:32 +08:00
|
|
|
// CHECK: call void @__kmpc_copyprivate([[IDENT_T_TY]]* [[DEFAULT_LOC]], i32 [[GTID]], i64 40, i8* [[COPY_LIST_VOID_PTR]], void (i8*, i8*)* [[COPY_FUNC:@.+]], i32 [[DID_IT_VAL]])
|
2015-04-24 12:00:39 +08:00
|
|
|
// CHECK-NOT: call {{.+}} @__kmpc_cancel_barrier
|
2015-04-14 13:11:24 +08:00
|
|
|
#pragma omp single copyprivate(a, c, tc, a2, tc2)
|
2015-02-05 14:35:41 +08:00
|
|
|
foo();
|
|
|
|
// CHECK-NOT: call i32 @__kmpc_single
|
|
|
|
// CHECK-NOT: call void @__kmpc_end_single
|
|
|
|
return a;
|
|
|
|
}
|
|
|
|
|
2020-06-25 15:01:15 +08:00
|
|
|
// OMP50-LABEL: declare i8* @__kmpc_threadprivate_cached(
|
2019-08-03 22:28:34 +08:00
|
|
|
// CHECK: void [[COPY_FUNC]](i8* %0, i8* %1)
|
2015-03-23 14:18:07 +08:00
|
|
|
// CHECK: store i8* %0, i8** [[DST_ADDR_REF:%.+]],
|
|
|
|
// CHECK: store i8* %1, i8** [[SRC_ADDR_REF:%.+]],
|
|
|
|
// CHECK: [[DST_ADDR_VOID_PTR:%.+]] = load i8*, i8** [[DST_ADDR_REF]],
|
2015-04-14 13:11:24 +08:00
|
|
|
// CHECK: [[DST_ADDR:%.+]] = bitcast i8* [[DST_ADDR_VOID_PTR]] to [5 x i8*]*
|
2015-03-23 14:18:07 +08:00
|
|
|
// CHECK: [[SRC_ADDR_VOID_PTR:%.+]] = load i8*, i8** [[SRC_ADDR_REF]],
|
2015-04-14 13:11:24 +08:00
|
|
|
// CHECK: [[SRC_ADDR:%.+]] = bitcast i8* [[SRC_ADDR_VOID_PTR]] to [5 x i8*]*
|
|
|
|
// CHECK: [[DST_A_ADDR_REF:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[DST_ADDR]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
|
2015-03-23 14:18:07 +08:00
|
|
|
// CHECK: [[DST_A_ADDR:%.+]] = load i8*, i8** [[DST_A_ADDR_REF]],
|
2015-04-14 13:11:24 +08:00
|
|
|
// CHECK: [[SRC_A_ADDR_REF:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[SRC_ADDR]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
|
|
|
|
// CHECK: [[SRC_A_ADDR:%.+]] = load i8*, i8** [[SRC_A_ADDR_REF]],
|
2015-03-23 14:18:07 +08:00
|
|
|
// CHECK: [[SRC_A_VAL:%.+]] = load i8, i8* [[SRC_A_ADDR]],
|
|
|
|
// CHECK: store i8 [[SRC_A_VAL]], i8* [[DST_A_ADDR]],
|
2015-04-14 13:11:24 +08:00
|
|
|
// CHECK: [[DST_C_ADDR_REF:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[DST_ADDR]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
|
|
|
|
// CHECK: [[DST_C_ADDR_VOID_PTR:%.+]] = load i8*, i8** [[DST_C_ADDR_REF]],
|
|
|
|
// CHECK: [[DST_C_ADDR:%.+]] = bitcast i8* [[DST_C_ADDR_VOID_PTR]] to [[TEST_CLASS_TY]]*
|
|
|
|
// CHECK: [[SRC_C_ADDR_REF:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[SRC_ADDR]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
|
|
|
|
// CHECK: [[SRC_C_ADDR_VOID_PTR:%.+]] = load i8*, i8** [[SRC_C_ADDR_REF]],
|
|
|
|
// CHECK: [[SRC_C_ADDR:%.+]] = bitcast i8* [[SRC_C_ADDR_VOID_PTR]] to [[TEST_CLASS_TY]]*
|
2015-03-23 14:18:07 +08:00
|
|
|
// CHECK: call{{.*}} [[TEST_CLASS_TY_ASSIGN:@.+]]([[TEST_CLASS_TY]]* [[DST_C_ADDR]], [[TEST_CLASS_TY]]* {{.*}}[[SRC_C_ADDR]])
|
2015-04-14 13:11:24 +08:00
|
|
|
// CHECK: [[DST_TC_ADDR_REF:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[DST_ADDR]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
|
|
|
|
// CHECK: [[DST_TC_ADDR_VOID_PTR:%.+]] = load i8*, i8** [[DST_TC_ADDR_REF]],
|
|
|
|
// CHECK: [[DST_TC_ADDR:%.+]] = bitcast i8* [[DST_TC_ADDR_VOID_PTR]] to [[TEST_CLASS_TY]]*
|
|
|
|
// CHECK: [[SRC_TC_ADDR_REF:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[SRC_ADDR]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
|
|
|
|
// CHECK: [[SRC_TC_ADDR_VOID_PTR:%.+]] = load i8*, i8** [[SRC_TC_ADDR_REF]],
|
|
|
|
// CHECK: [[SRC_TC_ADDR:%.+]] = bitcast i8* [[SRC_TC_ADDR_VOID_PTR]] to [[TEST_CLASS_TY]]*
|
|
|
|
// CHECK: call{{.*}} [[TEST_CLASS_TY_ASSIGN]]([[TEST_CLASS_TY]]* [[DST_TC_ADDR]], [[TEST_CLASS_TY]]* {{.*}}[[SRC_TC_ADDR]])
|
|
|
|
// CHECK: [[DST_A2_ADDR_REF:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[DST_ADDR]], i{{[0-9]+}} 0, i{{[0-9]+}} 3
|
|
|
|
// CHECK: [[DST_A2_ADDR:%.+]] = load i8*, i8** [[DST_A2_ADDR_REF]],
|
|
|
|
// CHECK: [[SRC_A2_ADDR_REF:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[SRC_ADDR]], i{{[0-9]+}} 0, i{{[0-9]+}} 3
|
|
|
|
// CHECK: [[SRC_A2_ADDR:%.+]] = load i8*, i8** [[SRC_A2_ADDR_REF]],
|
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 1 [[DST_A2_ADDR]], i8* align 1 [[SRC_A2_ADDR]], i{{[0-9]+}} 2, i1 false)
|
2015-04-14 13:11:24 +08:00
|
|
|
// CHECK: [[DST_TC2_ADDR_REF:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[DST_ADDR]], i{{[0-9]+}} 0, i{{[0-9]+}} 4
|
|
|
|
// CHECK: [[DST_TC2_ADDR_VOID_PTR:%.+]] = load i8*, i8** [[DST_TC2_ADDR_REF]],
|
|
|
|
// CHECK: [[DST_TC2_ADDR:%.+]] = bitcast i8* [[DST_TC2_ADDR_VOID_PTR]] to [[TEST_CLASS_TY]]*
|
|
|
|
// CHECK: [[SRC_TC2_ADDR_REF:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[SRC_ADDR]], i{{[0-9]+}} 0, i{{[0-9]+}} 4
|
|
|
|
// CHECK: [[SRC_TC2_ADDR_VOID_PTR:%.+]] = load i8*, i8** [[SRC_TC2_ADDR_REF]],
|
|
|
|
// CHECK: [[SRC_TC2_ADDR:%.+]] = bitcast i8* [[SRC_TC2_ADDR_VOID_PTR]] to [[TEST_CLASS_TY]]*
|
|
|
|
// CHECK: br i1
|
|
|
|
// CHECK: call{{.*}} [[TEST_CLASS_TY_ASSIGN]]([[TEST_CLASS_TY]]* %{{.+}}, [[TEST_CLASS_TY]]* {{.*}})
|
|
|
|
// CHECK: br i1
|
2015-03-23 14:18:07 +08:00
|
|
|
// CHECK: ret void
|
|
|
|
|
2020-06-25 15:01:15 +08:00
|
|
|
|
|
|
|
// OMP50-LABEL: void @_ZN3SSTIdEC2Ev(
|
|
|
|
// OMP50: getelementptr inbounds [[SST_TY]], [[SST_TY]]* %{{.+}}, i32 0, i32 0
|
|
|
|
// OMP50-NEXT: store double 0.000000e+00, double* %
|
|
|
|
// OMP50-NEXT: getelementptr inbounds [[SST_TY]], [[SST_TY]]* %{{.+}}, i32 0, i32 0
|
|
|
|
// OMP50-NEXT: store double* %{{.+}}, double** %
|
|
|
|
// OMP50-NEXT: load double*, double** %
|
|
|
|
// OMP50-NEXT: load double, double* %
|
|
|
|
// OMP50-NEXT: bitcast i64* %{{.+}} to double*
|
|
|
|
// OMP50-NEXT: store double %{{.+}}, double* %
|
|
|
|
// OMP50-NEXT: load i64, i64* %
|
|
|
|
// OMP50-NEXT: call void ([[IDENT_T_TY]]*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call([[IDENT_T_TY]]* @{{.+}}, i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, [[SST_TY]]*, i64)* [[SST_MICROTASK:@.+]] to void
|
|
|
|
// OMP50-NEXT: ret void
|
|
|
|
|
|
|
|
// OMP50: define internal void [[SST_MICROTASK]](i32* {{[^,]+}}, i32* {{[^,]+}}, [[SST_TY]]* {{.+}}, i64 {{.+}})
|
|
|
|
// OMP50: [[RES:%.+]] = call i32 @__kmpc_single([[IDENT_T_TY]]* @{{.+}}, i32 %{{.+}})
|
|
|
|
// OMP50-NEXT: icmp ne i32 [[RES]], 0
|
|
|
|
// OMP50-NEXT: br i1
|
|
|
|
|
|
|
|
// OMP50: getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 1
|
|
|
|
// OMP50-NEXT: load double*, double** %
|
|
|
|
// OMP50-NEXT: store double* %
|
|
|
|
// OMP50-LABEL: invoke void @_ZZN3SSTIdEC1EvENKUlvE_clEv(
|
|
|
|
|
|
|
|
// OMP50: call void @__kmpc_end_single([[IDENT_T_TY]]* @{{.+}}, i32 %{{.+}})
|
|
|
|
// OMP50-NEXT: store i32 1, i32* [[DID_IT]],
|
|
|
|
// OMP50-NEXT: br label
|
|
|
|
|
|
|
|
// OMP50: call void @__kmpc_end_single([[IDENT_T_TY]]* @{{.+}}, i32 %{{.+}})
|
|
|
|
// OMP50-NEXT: br label
|
|
|
|
|
|
|
|
// OMP50: getelementptr inbounds [1 x i8*], [1 x i8*]* [[LIST:%.+]], i64 0, i64 0
|
|
|
|
// OMP50: load double*, double** %
|
|
|
|
// OMP50-NEXT: bitcast double* %
|
|
|
|
// OMP50-NEXT: store i8* %
|
|
|
|
// OMP50-NEXT: bitcast [1 x i8*]* [[LIST]] to i8*
|
|
|
|
// OMP50-NEXT: load i32, i32* [[DID_IT]],
|
|
|
|
// OMP50-NEXT: call void @__kmpc_copyprivate([[IDENT_T_TY]]* @{{.+}}, i32 %{{.+}}, i64 8, i8* %{{.+}}, void (i8*, i8*)* [[COPY_FUNC:@[^,]+]], i32 %{{.+}})
|
|
|
|
// OMP50-NEXT: ret void
|
|
|
|
|
|
|
|
// OMP50-LABEL: @_ZZN3SSTIdEC1EvENKUlvE_clEv(
|
|
|
|
// OMP50: getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 1
|
|
|
|
// OMP50-NEXT: getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 1
|
|
|
|
// OMP50-NEXT: load double*, double** %
|
|
|
|
// OMP50-NEXT: store double* %
|
|
|
|
// OMP50-LABEL: call void @_ZZZN3SSTIdEC1EvENKUlvE_clEvENKUlvE_clEv(
|
|
|
|
// OMP50-NEXT: ret void
|
|
|
|
|
|
|
|
// OMP50: define internal void [[COPY_FUNC]](i8* %0, i8* %1)
|
|
|
|
// OMP50: ret void
|
|
|
|
|
|
|
|
// OMP45-LABEL: parallel_single
|
2015-03-10 13:15:26 +08:00
|
|
|
// TERM_DEBUG-LABEL: parallel_single
|
|
|
|
void parallel_single() {
|
2015-02-26 18:27:34 +08:00
|
|
|
#pragma omp parallel
|
|
|
|
#pragma omp single
|
2017-11-02 22:25:34 +08:00
|
|
|
// TERM_DEBUG-NOT: __kmpc_global_thread_num
|
2015-03-10 13:15:26 +08:00
|
|
|
// TERM_DEBUG: call i32 @__kmpc_single({{.+}}), !dbg [[DBG_LOC_START:![0-9]+]]
|
|
|
|
// TERM_DEBUG: invoke void {{.*}}foo{{.*}}()
|
|
|
|
// TERM_DEBUG: unwind label %[[TERM_LPAD:.+]],
|
|
|
|
// TERM_DEBUG-NOT: __kmpc_global_thread_num
|
|
|
|
// TERM_DEBUG: call void @__kmpc_end_single({{.+}}), !dbg [[DBG_LOC_END:![0-9]+]]
|
2015-03-10 13:28:46 +08:00
|
|
|
// TERM_DEBUG: [[TERM_LPAD]]
|
2015-03-10 13:15:26 +08:00
|
|
|
// TERM_DEBUG: call void @__clang_call_terminate
|
|
|
|
// TERM_DEBUG: unreachable
|
|
|
|
foo();
|
2015-02-26 18:27:34 +08:00
|
|
|
}
|
2015-04-30 00:40:08 +08:00
|
|
|
// TERM_DEBUG-DAG: [[DBG_LOC_START]] = !DILocation(line: [[@LINE-12]],
|
|
|
|
// TERM_DEBUG-DAG: [[DBG_LOC_END]] = !DILocation(line: [[@LINE-3]],
|
2015-05-19 20:31:28 +08:00
|
|
|
#endif
|
|
|
|
#else
|
|
|
|
// ARRAY-LABEL: array_func
|
|
|
|
struct St {
|
|
|
|
int a, b;
|
|
|
|
St() : a(0), b(0) {}
|
|
|
|
St &operator=(const St &) { return *this; };
|
|
|
|
~St() {}
|
|
|
|
};
|
2015-02-26 18:27:34 +08:00
|
|
|
|
2015-05-21 17:47:46 +08:00
|
|
|
void array_func(int n, int a[n], St s[2]) {
|
2018-04-17 01:59:34 +08:00
|
|
|
// ARRAY: call void @__kmpc_copyprivate(%struct.ident_t* @{{.+}}, i32 %{{.+}}, i64 16, i8* %{{.+}}, void (i8*, i8*)* [[CPY:@.+]], i32 %{{.+}})
|
2015-05-19 20:31:28 +08:00
|
|
|
#pragma omp single copyprivate(a, s)
|
|
|
|
;
|
|
|
|
}
|
|
|
|
// ARRAY: define internal void [[CPY]]
|
2015-05-21 17:47:46 +08:00
|
|
|
// ARRAY: store i32* %{{.+}}, i32** %{{.+}},
|
|
|
|
// ARRAY: store %struct.St* %{{.+}}, %struct.St** %{{.+}},
|
2015-02-05 14:35:41 +08:00
|
|
|
#endif
|
2016-03-17 18:50:17 +08:00
|
|
|
|
|
|
|
// CHECK-LABEL:@_ZN2SSC2ERi(
|
2016-06-17 02:39:34 +08:00
|
|
|
// CHECK: call void ([[IDENT_T_TY]]*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call([[IDENT_T_TY]]* @{{.+}}, i32 4, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, [[SS_TY]]*, i64, i64, i64)* [[SS_MICROTASK:@.+]] to void
|
2016-03-17 18:50:17 +08:00
|
|
|
// CHECK-NEXT: ret void
|
|
|
|
|
2016-06-17 02:39:34 +08:00
|
|
|
// CHECK: define internal void [[SS_MICROTASK]](i32* {{[^,]+}}, i32* {{[^,]+}}, [[SS_TY]]* {{.+}}, i64 {{.+}}, i64 {{.+}}, i64 {{.+}})
|
2016-03-17 18:50:17 +08:00
|
|
|
// Private a
|
2016-06-17 02:39:34 +08:00
|
|
|
// CHECK: alloca i64,
|
2016-03-17 18:50:17 +08:00
|
|
|
// Private b
|
2016-06-17 02:39:34 +08:00
|
|
|
// CHECK: alloca i64,
|
2016-03-17 18:50:17 +08:00
|
|
|
// Private c
|
2016-06-17 02:39:34 +08:00
|
|
|
// CHECK: alloca i64,
|
2016-03-17 18:50:17 +08:00
|
|
|
// CHECK: alloca i32*,
|
2016-05-17 16:55:33 +08:00
|
|
|
// CHECK: alloca i32*,
|
|
|
|
// CHECK: alloca i32*,
|
|
|
|
// CHECK: alloca i32*,
|
2016-03-17 18:50:17 +08:00
|
|
|
// CHECK: [[DID_IT:%.+]] = alloca i32,
|
2016-06-17 02:39:34 +08:00
|
|
|
// CHECK: bitcast i64* %{{.+}} to i32*
|
|
|
|
// CHECK: bitcast i64* %{{.+}} to i32*
|
|
|
|
// CHECK: bitcast i64* %{{.+}} to i32*
|
2016-03-17 18:50:17 +08:00
|
|
|
// CHECK: store i32 0, i32* [[DID_IT]],
|
|
|
|
// CHECK: [[RES:%.+]] = call i32 @__kmpc_single([[IDENT_T_TY]]* @{{.+}}, i32 %{{.+}})
|
|
|
|
// CHECK-NEXT: icmp ne i32 [[RES]], 0
|
|
|
|
// CHECK-NEXT: br i1
|
|
|
|
|
|
|
|
// CHECK: getelementptr inbounds [[CAP_TY:%.+]], [[CAP_TY]]* [[CAP:%.+]], i32 0, i32 0
|
|
|
|
// CHECK: getelementptr inbounds [[CAP_TY]], [[CAP_TY]]* [[CAP]], i32 0, i32 1
|
|
|
|
// CHECK-NEXT: load i32*, i32** %
|
|
|
|
// CHECK-NEXT: store i32* %
|
|
|
|
// CHECK-NEXT: getelementptr inbounds [[CAP_TY]], [[CAP_TY]]* [[CAP]], i32 0, i32 2
|
|
|
|
// CHECK-NEXT: store i32* %
|
|
|
|
// CHECK-NEXT: getelementptr inbounds [[CAP_TY]], [[CAP_TY]]* [[CAP]], i32 0, i32 3
|
|
|
|
// CHECK-NEXT: load i32*, i32** %
|
|
|
|
// CHECK-NEXT: store i32* %
|
|
|
|
// CHECK-LABEL: invoke void @_ZZN2SSC1ERiENKUlvE_clEv(
|
|
|
|
// CHECK-SAME: [[CAP_TY]]* [[CAP]])
|
|
|
|
|
2016-03-28 20:58:34 +08:00
|
|
|
// CHECK: call void @__kmpc_end_single([[IDENT_T_TY]]* @{{.+}}, i32 %{{.+}})
|
2016-03-29 13:34:15 +08:00
|
|
|
// CHECK: store i32 1, i32* [[DID_IT]],
|
2016-03-17 18:50:17 +08:00
|
|
|
// CHECK: br label
|
|
|
|
|
|
|
|
// CHECK: call void @__kmpc_end_single(%{{.+}}* @{{.+}}, i32 %{{.+}})
|
|
|
|
// CHECK: br label
|
|
|
|
|
|
|
|
// CHECK: getelementptr inbounds [3 x i8*], [3 x i8*]* [[LIST:%.+]], i64 0, i64 0
|
|
|
|
// CHECK: load i32*, i32** %
|
|
|
|
// CHECK-NEXT: bitcast i32* %
|
|
|
|
// CHECK-NEXT: store i8* %
|
|
|
|
// CHECK: getelementptr inbounds [3 x i8*], [3 x i8*]* [[LIST]], i64 0, i64 1
|
|
|
|
// CHECK-NEXT: bitcast i32* %
|
|
|
|
// CHECK-NEXT: store i8* %
|
|
|
|
// CHECK: getelementptr inbounds [3 x i8*], [3 x i8*]* [[LIST]], i64 0, i64 2
|
|
|
|
// CHECK: load i32*, i32** %
|
|
|
|
// CHECK-NEXT: bitcast i32* %
|
|
|
|
// CHECK-NEXT: store i8* %
|
|
|
|
// CHECK-NEXT: bitcast [3 x i8*]* [[LIST]] to i8*
|
|
|
|
// CHECK-NEXT: load i32, i32* [[DID_IT]],
|
|
|
|
// CHECK-NEXT: call void @__kmpc_copyprivate([[IDENT_T_TY]]* @{{.+}}, i32 %{{.+}}, i64 24, i8* %{{.+}}, void (i8*, i8*)* [[COPY_FUNC:@[^,]+]], i32 %{{.+}})
|
|
|
|
// CHECK-NEXT: ret void
|
|
|
|
|
|
|
|
// CHECK-LABEL: @_ZZN2SSC1ERiENKUlvE_clEv(
|
|
|
|
// CHECK: getelementptr inbounds [[CAP_TY]], [[CAP_TY]]* [[CAP:%.+]], i32 0, i32 1
|
|
|
|
// CHECK-NEXT: load i32*, i32** %
|
|
|
|
// CHECK-NEXT: load i32, i32* %
|
|
|
|
// CHECK-NEXT: add nsw i32 %{{.+}}, 1
|
|
|
|
// CHECK-NEXT: store i32 %
|
|
|
|
// CHECK-NEXT: getelementptr inbounds [[CAP_TY]], [[CAP_TY]]* [[CAP]], i32 0, i32 2
|
|
|
|
// CHECK-NEXT: load i32*, i32** %
|
|
|
|
// CHECK-NEXT: load i32, i32* %
|
|
|
|
// CHECK-NEXT: add nsw i32 %{{.+}}, -1
|
|
|
|
// CHECK-NEXT: store i32 %
|
|
|
|
// CHECK-NEXT: getelementptr inbounds [[CAP_TY]], [[CAP_TY]]* [[CAP]], i32 0, i32 3
|
|
|
|
// CHECK-NEXT: load i32*, i32** %
|
|
|
|
// CHECK-NEXT: load i32, i32* %
|
|
|
|
// CHECK-NEXT: sdiv i32 %{{.+}}, 1
|
|
|
|
// CHECK-NEXT: store i32 %
|
|
|
|
// CHECK-NEXT: getelementptr inbounds [[CAP_TY]], [[CAP_TY]]* [[CAP]], i32 0, i32 1
|
|
|
|
// CHECK-NEXT: load i32*, i32** %
|
2016-05-17 16:55:33 +08:00
|
|
|
// CHECK-NEXT: load i32, i32* %
|
2016-06-17 02:39:34 +08:00
|
|
|
// CHECK-NEXT: bitcast i64* %
|
|
|
|
// CHECK-NEXT: store i32 %{{.+}}, i32* %
|
|
|
|
// CHECK-NEXT: load i64, i64* %
|
2016-03-17 18:50:17 +08:00
|
|
|
// CHECK-NEXT: getelementptr inbounds [[CAP_TY]], [[CAP_TY]]* [[CAP]], i32 0, i32 2
|
|
|
|
// CHECK-NEXT: load i32*, i32** %
|
2016-05-17 16:55:33 +08:00
|
|
|
// CHECK-NEXT: load i32, i32* %
|
2016-06-17 02:39:34 +08:00
|
|
|
// CHECK-NEXT: bitcast i64* %
|
|
|
|
// CHECK-NEXT: store i32 %{{.+}}, i32* %
|
|
|
|
// CHECK-NEXT: load i64, i64* %
|
2016-03-17 18:50:17 +08:00
|
|
|
// CHECK-NEXT: getelementptr inbounds [[CAP_TY]], [[CAP_TY]]* [[CAP]], i32 0, i32 3
|
|
|
|
// CHECK-NEXT: load i32*, i32** %
|
2016-05-17 16:55:33 +08:00
|
|
|
// CHECK-NEXT: load i32, i32* %
|
2016-06-17 02:39:34 +08:00
|
|
|
// CHECK-NEXT: bitcast i64* %
|
|
|
|
// CHECK-NEXT: store i32 %{{.+}}, i32* %
|
|
|
|
// CHECK-NEXT: load i64, i64* %
|
|
|
|
// CHECK-NEXT: call void ([[IDENT_T_TY]]*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call([[IDENT_T_TY]]* @{{.+}}, i32 4, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, [[SS_TY]]*, i64, i64, i64)* [[SS_MICROTASK1:@.+]] to void
|
2016-03-17 18:50:17 +08:00
|
|
|
// CHECK-NEXT: ret void
|
|
|
|
|
2019-08-03 22:28:34 +08:00
|
|
|
// CHECK: define internal void [[COPY_FUNC]](i8* %0, i8* %1)
|
2016-03-17 18:50:17 +08:00
|
|
|
// CHECK: ret void
|
|
|
|
|
2016-06-17 02:39:34 +08:00
|
|
|
// CHECK: define internal void [[SS_MICROTASK1]](i32* {{[^,]+}}, i32* {{[^,]+}}, [[SS_TY]]* {{.+}}, i64 {{.+}}, i64 {{.+}}, i64 {{.+}})
|
2016-03-17 18:50:17 +08:00
|
|
|
// Private a
|
2016-06-17 02:39:34 +08:00
|
|
|
// CHECK: alloca i64,
|
2016-03-17 18:50:17 +08:00
|
|
|
// Private b
|
2016-06-17 02:39:34 +08:00
|
|
|
// CHECK: alloca i64,
|
2016-03-17 18:50:17 +08:00
|
|
|
// Private c
|
2016-06-17 02:39:34 +08:00
|
|
|
// CHECK: alloca i64,
|
2016-03-17 18:50:17 +08:00
|
|
|
// CHECK: alloca i32*,
|
2016-05-17 16:55:33 +08:00
|
|
|
// CHECK: alloca i32*,
|
|
|
|
// CHECK: alloca i32*,
|
|
|
|
// CHECK: alloca i32*,
|
2016-03-17 18:50:17 +08:00
|
|
|
// CHECK: [[DID_IT:%.+]] = alloca i32,
|
2016-06-17 02:39:34 +08:00
|
|
|
// CHECK: bitcast i64* %{{.+}} to i32*
|
|
|
|
// CHECK: bitcast i64* %{{.+}} to i32*
|
|
|
|
// CHECK: bitcast i64* %{{.+}} to i32*
|
2016-03-17 18:50:17 +08:00
|
|
|
// CHECK: [[RES:%.+]] = call i32 @__kmpc_single([[IDENT_T_TY]]* @{{.+}}, i32 %{{.+}})
|
|
|
|
// CHECK-NEXT: icmp ne i32 [[RES]], 0
|
|
|
|
// CHECK-NEXT: br i1
|
|
|
|
|
|
|
|
// CHECK-NOT: getelementptr inbounds
|
|
|
|
// CHECK: load i32*, i32** %
|
|
|
|
// CHECK-NEXT: load i32, i32* %
|
|
|
|
// CHECK-NEXT: add nsw i32 %{{.+}}, 1
|
|
|
|
// CHECK-NEXT: store i32 %
|
|
|
|
// CHECK-NOT: getelementptr inbounds
|
|
|
|
// CHECK: load i32, i32* %
|
|
|
|
// CHECK-NEXT: add nsw i32 %{{.+}}, -1
|
|
|
|
// CHECK-NEXT: store i32 %
|
|
|
|
// CHECK-NOT: getelementptr inbounds
|
|
|
|
// CHECK: load i32*, i32** %
|
|
|
|
// CHECK-NEXT: load i32, i32* %
|
|
|
|
// CHECK-NEXT: sdiv i32 %{{.+}}, 1
|
|
|
|
// CHECK-NEXT: store i32 %
|
2016-03-28 20:58:34 +08:00
|
|
|
// CHECK-NEXT: call void @__kmpc_end_single([[IDENT_T_TY]]* @{{.+}}, i32 %{{.+}})
|
2016-03-29 13:34:15 +08:00
|
|
|
// CHECK-NEXT: store i32 1, i32* [[DID_IT]],
|
2016-03-17 18:50:17 +08:00
|
|
|
// CHECK-NEXT: br label
|
|
|
|
|
|
|
|
// CHECK: getelementptr inbounds [3 x i8*], [3 x i8*]* [[LIST:%.+]], i64 0, i64 0
|
|
|
|
// CHECK: load i32*, i32** %
|
|
|
|
// CHECK-NEXT: bitcast i32* %
|
|
|
|
// CHECK-NEXT: store i8* %
|
|
|
|
// CHECK: getelementptr inbounds [3 x i8*], [3 x i8*]* [[LIST]], i64 0, i64 1
|
|
|
|
// CHECK-NEXT: bitcast i32* %
|
|
|
|
// CHECK-NEXT: store i8* %
|
|
|
|
// CHECK: getelementptr inbounds [3 x i8*], [3 x i8*]* [[LIST]], i64 0, i64 2
|
|
|
|
// CHECK: load i32*, i32** %
|
|
|
|
// CHECK-NEXT: bitcast i32* %
|
|
|
|
// CHECK-NEXT: store i8* %
|
|
|
|
// CHECK-NEXT: bitcast [3 x i8*]* [[LIST]] to i8*
|
|
|
|
// CHECK-NEXT: load i32, i32* [[DID_IT]],
|
|
|
|
// CHECK-NEXT: call void @__kmpc_copyprivate([[IDENT_T_TY]]* @{{.+}}, i32 %{{.+}}, i64 24, i8* %{{.+}}, void (i8*, i8*)* [[COPY_FUNC:@[^,]+]], i32 %{{.+}})
|
|
|
|
// CHECK-NEXT: ret void
|
|
|
|
|
2019-08-03 22:28:34 +08:00
|
|
|
// CHECK: define internal void [[COPY_FUNC]](i8* %0, i8* %1)
|
2016-03-17 18:50:17 +08:00
|
|
|
// CHECK: ret void
|
|
|
|
|
2020-06-25 15:01:15 +08:00
|
|
|
// OMP45-LABEL: void @_ZN3SSTIdEC2Ev(
|
|
|
|
// OMP45: getelementptr inbounds [[SST_TY]], [[SST_TY]]* %{{.+}}, i32 0, i32 0
|
|
|
|
// OMP45-NEXT: store double 0.000000e+00, double* %
|
|
|
|
// OMP45-NEXT: getelementptr inbounds [[SST_TY]], [[SST_TY]]* %{{.+}}, i32 0, i32 0
|
|
|
|
// OMP45-NEXT: store double* %{{.+}}, double** %
|
|
|
|
// OMP45-NEXT: load double*, double** %
|
|
|
|
// OMP45-NEXT: load double, double* %
|
|
|
|
// OMP45-NEXT: bitcast i64* %{{.+}} to double*
|
|
|
|
// OMP45-NEXT: store double %{{.+}}, double* %
|
|
|
|
// OMP45-NEXT: load i64, i64* %
|
|
|
|
// OMP45-NEXT: call void ([[IDENT_T_TY]]*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call([[IDENT_T_TY]]* @{{.+}}, i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, [[SST_TY]]*, i64)* [[SST_MICROTASK:@.+]] to void
|
|
|
|
// OMP45-NEXT: ret void
|
|
|
|
|
|
|
|
// OMP45: define internal void [[SST_MICROTASK]](i32* {{[^,]+}}, i32* {{[^,]+}}, [[SST_TY]]* {{.+}}, i64 {{.+}})
|
|
|
|
// OMP45: [[RES:%.+]] = call i32 @__kmpc_single([[IDENT_T_TY]]* @{{.+}}, i32 %{{.+}})
|
|
|
|
// OMP45-NEXT: icmp ne i32 [[RES]], 0
|
|
|
|
// OMP45-NEXT: br i1
|
|
|
|
|
|
|
|
// OMP45: getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 1
|
|
|
|
// OMP45-NEXT: load double*, double** %
|
|
|
|
// OMP45-NEXT: store double* %
|
|
|
|
// OMP45-LABEL: invoke void @_ZZN3SSTIdEC1EvENKUlvE_clEv(
|
|
|
|
|
|
|
|
// OMP45: call void @__kmpc_end_single([[IDENT_T_TY]]* @{{.+}}, i32 %{{.+}})
|
|
|
|
// OMP45-NEXT: store i32 1, i32* [[DID_IT]],
|
|
|
|
// OMP45-NEXT: br label
|
|
|
|
|
|
|
|
// OMP45: call void @__kmpc_end_single([[IDENT_T_TY]]* @{{.+}}, i32 %{{.+}})
|
|
|
|
// OMP45-NEXT: br label
|
|
|
|
|
|
|
|
// OMP45: getelementptr inbounds [1 x i8*], [1 x i8*]* [[LIST:%.+]], i64 0, i64 0
|
|
|
|
// OMP45: load double*, double** %
|
|
|
|
// OMP45-NEXT: bitcast double* %
|
|
|
|
// OMP45-NEXT: store i8* %
|
|
|
|
// OMP45-NEXT: bitcast [1 x i8*]* [[LIST]] to i8*
|
|
|
|
// OMP45-NEXT: load i32, i32* [[DID_IT]],
|
|
|
|
// OMP45-NEXT: call void @__kmpc_copyprivate([[IDENT_T_TY]]* @{{.+}}, i32 %{{.+}}, i64 8, i8* %{{.+}}, void (i8*, i8*)* [[COPY_FUNC:@[^,]+]], i32 %{{.+}})
|
|
|
|
// OMP45-NEXT: ret void
|
|
|
|
|
|
|
|
// OMP45-LABEL: @_ZZN3SSTIdEC1EvENKUlvE_clEv(
|
|
|
|
// OMP45: getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 1
|
|
|
|
// OMP45-NEXT: getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 1
|
|
|
|
// OMP45-NEXT: load double*, double** %
|
|
|
|
// OMP45-NEXT: store double* %
|
|
|
|
// OMP45-LABEL: call void @_ZZZN3SSTIdEC1EvENKUlvE_clEvENKUlvE_clEv(
|
|
|
|
// OMP45-NEXT: ret void
|
|
|
|
|
|
|
|
// OMP45: define internal void [[COPY_FUNC]](i8* %0, i8* %1)
|
|
|
|
// OMP45: ret void
|
|
|
|
|
|
|
|
// OMP45-LABEL: @_ZZZN3SSTIdEC1EvENKUlvE_clEvENKUlvE_clEv(
|