Author: Zahira Ammarguellat Date: 2026-02-03T08:14:31-05:00 New Revision: 9b5099acabb1419902d12e4871ed690f1d95ab02
URL: https://github.com/llvm/llvm-project/commit/9b5099acabb1419902d12e4871ed690f1d95ab02 DIFF: https://github.com/llvm/llvm-project/commit/9b5099acabb1419902d12e4871ed690f1d95ab02.diff LOG: [OpenMP][Clang] Support transparent clause with no argument provided. (#177684) According to the `OpenMP 6.0` specification (Section 17.9.6 511:18), if the `impex-type` is not explicitly specified, the behavior defaults to treating it as `omp_impex`. This patch ensures proper handling of the `transparent` clause when no specific `impex-type` is provided. Added: Modified: clang/lib/AST/OpenMPClause.cpp clang/lib/Parse/ParseOpenMP.cpp clang/lib/Sema/SemaOpenMP.cpp clang/test/OpenMP/task_ast_print.cpp clang/test/OpenMP/task_codegen.cpp clang/test/OpenMP/taskloop_ast_print.cpp clang/test/OpenMP/taskloop_codegen.cpp Removed: ################################################################################ diff --git a/clang/lib/AST/OpenMPClause.cpp b/clang/lib/AST/OpenMPClause.cpp index 62d78660570de..9e7a8a48372c7 100644 --- a/clang/lib/AST/OpenMPClause.cpp +++ b/clang/lib/AST/OpenMPClause.cpp @@ -2057,7 +2057,10 @@ void OMPClausePrinter::VisitOMPThreadsetClause(OMPThreadsetClause *Node) { void OMPClausePrinter::VisitOMPTransparentClause(OMPTransparentClause *Node) { OS << "transparent("; - Node->getImpexType()->printPretty(OS, nullptr, Policy, 0); + if (Node->getImpexType()) + Node->getImpexType()->printPretty(OS, nullptr, Policy, 0); + else + OS << "omp_impex"; OS << ")"; } diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp index ec62df83a203e..b41803d23cb25 100644 --- a/clang/lib/Parse/ParseOpenMP.cpp +++ b/clang/lib/Parse/ParseOpenMP.cpp @@ -3214,6 +3214,13 @@ OMPClause *Parser::ParseOpenMPClause(OpenMPDirectiveKind DKind, ErrorFound = true; } + if (CKind == OMPC_transparent && PP.LookAhead(0).isNot(tok::l_paren)) { + SourceLocation Loc = ConsumeToken(); + SourceLocation LLoc = Tok.getLocation(); + Clause = Actions.OpenMP().ActOnOpenMPTransparentClause(nullptr, LLoc, + LLoc, Loc); + break; + } if ((CKind == OMPC_ordered || CKind == OMPC_partial) && PP.LookAhead(/*N=*/0).isNot(tok::l_paren)) Clause = ParseOpenMPClause(CKind, WrongDirective); diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp index 456e94a009d2f..e90884a89bf6e 100644 --- a/clang/lib/Sema/SemaOpenMP.cpp +++ b/clang/lib/Sema/SemaOpenMP.cpp @@ -17476,6 +17476,10 @@ OMPClause *SemaOpenMP::ActOnOpenMPTransparentClause(Expr *ImpexTypeArg, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc) { + if (!ImpexTypeArg) { + return new (getASTContext()) + OMPTransparentClause(ImpexTypeArg, StartLoc, LParenLoc, EndLoc); + } QualType Ty = ImpexTypeArg->getType(); if (const auto *TT = Ty->getAs<TypedefType>()) { diff --git a/clang/test/OpenMP/task_ast_print.cpp b/clang/test/OpenMP/task_ast_print.cpp index 4c59a7c7fafa1..5ed43d802b5a1 100644 --- a/clang/test/OpenMP/task_ast_print.cpp +++ b/clang/test/OpenMP/task_ast_print.cpp @@ -16,12 +16,6 @@ typedef void *omp_depend_t; typedef unsigned long omp_event_handle_t; -typedef void **omp_impex_t; -extern const omp_impex_t omp_not_impex; -extern const omp_impex_t omp_import; -extern const omp_impex_t omp_export; -extern const omp_impex_t omp_impex; - void foo() {} struct S1 { @@ -250,6 +244,9 @@ int main(int argc, char **argv) { #pragma omp task threadset(omp_team) foo(); +#pragma omp task transparent shared(x) +#pragma omp task transparent(omp_export) shared(x) +#pragma omp task transparent #pragma omp task transparent(omp_not_impex) #pragma omp task transparent(omp_import) #pragma omp task transparent(omp_export) @@ -273,9 +270,13 @@ int main(int argc, char **argv) { // CHECK60: #pragma omp task transparent(omp_import) // CHECK60: #pragma omp taskloop transparent(omp_impex) // CHECK60: #pragma omp task transparent(omp_import) + // CHECK60: #pragma omp taskloop transparent(omp_impex) // CHECK60: #pragma omp task threadset(omp_pool) // CHECK60: #pragma omp task threadset(omp_team) // CHECK60-NEXT: foo(); + // CHECK60: #pragma omp task transparent(omp_impex) shared(x) + // CHECK60: #pragma omp task transparent(omp_export) shared(x) + // CHECK60: #pragma omp task transparent(omp_impex) // CHECK60: #pragma omp task transparent(omp_not_impex) // CHECK60-NEXT: #pragma omp task transparent(omp_import) // CHECK60-NEXT: #pragma omp task transparent(omp_export) diff --git a/clang/test/OpenMP/task_codegen.cpp b/clang/test/OpenMP/task_codegen.cpp index faa9c3dfbcf61..764605e910338 100644 --- a/clang/test/OpenMP/task_codegen.cpp +++ b/clang/test/OpenMP/task_codegen.cpp @@ -240,6 +240,13 @@ void test_threadset() void test_transparent() { + int x; +#pragma omp task transparent shared(x) + {} +#pragma omp task transparent(omp_not_impex) shared(x) + {} +#pragma omp task transparent + {} #pragma omp task transparent(omp_not_impex) {} #pragma omp task transparent(omp_import) @@ -10304,14 +10311,18 @@ void test_transparent() // CHECK6-LABEL: define void @_Z16test_transparentv() #1 { // CHECK6-NEXT: entry: +// CHECK6-NEXT: [[X:.*]] = alloca i32, align 4 // CHECK6-NEXT: [[AGG_CAPTURED:%.*]] = alloca [[STRUCT_ANON_27:%.*]], align 1 // CHECK6-NEXT: [[AGG_CAPTURED2:%.*]] = alloca [[STRUCT_ANON_29:%.*]], align 1 // CHECK6-NEXT: [[AGG_CAPTURED5:%.*]] = alloca [[STRUCT_ANON_31:%.*]], align 1 // CHECK6-NEXT: [[AGG_CAPTURED8:%.*]] = alloca [[STRUCT_ANON_33:%.*]], align 1 -// CHECK6-NEXT: [[V:%.*]] = alloca ptr, align 8 -// CHECK6-NEXT: [[AGG_CAPTURED11:%.*]] = alloca [[STRUCT_ANON_35:%.*]], align 1 +// CHECK6-NEXT: [[AGG_CAPTURED11:%.*]] = alloca [[STRUCT_ANON_35:%.*]], align 1 //CHECK6-NEXT: [[AGG_CAPTURED14:%.*]] = alloca [[STRUCT_ANON_37:%.*]], align 1 -// CHECK6-NEXT: [[AGG_CAPTURED17:%.*]] = alloca [[STRUCT_ANON_39:%.*]], align 1 +// CHECK6-NEXT: [[AGG_CAPTURED17:%.*]] = alloca [[STRUCT_ANON_39:%.*]], align 1 +// CHECK6-NEXT: [[V:%.*]] = alloca ptr, align 8 +// CHECK6-NEXT: [[AGG_CAPTURED20:%.*]] = alloca [[STRUCT_ANON_41:%.*]], align 1 +// CHECK6-NEXT: [[AGG_CAPTURED23:%.*]] = alloca [[STRUCT_ANON_43:%.*]], align 1 +// CHECK6-NEXT: [[AGG_CAPTURED26:%.*]] = alloca [[STRUCT_ANON_45:%.*]], align 1 // CHECK6-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @31) // CHECK6-NEXT: [[TMP0:%.*]] = call ptr @__kmpc_omp_task_alloc(ptr @1, i32 [[OMP_GLOBAL_THREAD_NUM]], i32 257, i64 40, i64 1, ptr @.omp_task_entry..[[ENTRY1:[0-9]+]]) // CHECK6-NEXT: [[TMP1:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t_with_privates{{.*}}, ptr [[TMP0]], i32 0, i32 0 @@ -10348,5 +10359,22 @@ void test_transparent() // CHECK6-NEXT: [[TMP19:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t_with_privates{{.*}}, ptr [[TMP18]], i32 0, i32 0 // CHECK6-NEXT: [[OMP_GLOBAL_THREAD_NUM19:%.*]] = call i32 @__kmpc_global_thread_num(ptr @43) // CHECK6-NEXT: [[TMP20:%.*]] = call i32 @__kmpc_omp_task(ptr @1, i32 [[OMP_GLOBAL_THREAD_NUM19]], ptr [[TMP18]]) +// CHECK6-NEXT: [[OMP_GLOBAL_THREAD_NUM21:%.*]] = call i32 @__kmpc_global_thread_num(ptr @45) +// CHECK6-NEXT: [[TMP21:%.*]] = call ptr @__kmpc_omp_task_alloc(ptr @1, i32 [[OMP_GLOBAL_THREAD_NUM21]], i32 257, i64 40, i64 1, ptr @.omp_task_entry..[[ENTRY43:[0-9]+]]) +// CHECK6-NEXT: [[TMP22:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t_with_privates{{.*}}, ptr [[TMP21]], i32 0, i32 0 +// CHECK6-NEXT: [[OMP_GLOBAL_THREAD_NUM22:%.*]] = call i32 @__kmpc_global_thread_num(ptr @45) +// CHECK6-NEXT: [[TMP23:%.*]] = call i32 @__kmpc_omp_task(ptr @1, i32 [[OMP_GLOBAL_THREAD_NUM22]], ptr [[TMP21]]) + +// CHECK6-NEXT: [[OMP_GLOBAL_THREAD_NUM24:%.*]] = call i32 @__kmpc_global_thread_num(ptr @47) +// CHECK6-NEXT: [[TMP24:%.*]] = call ptr @__kmpc_omp_task_alloc(ptr @1, i32 [[OMP_GLOBAL_THREAD_NUM24]], i32 257, i64 40, i64 1, ptr @.omp_task_entry..[[ENTRY45:[0-9]+]]) +// CHECK6-NEXT: [[TMP25:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t_with_privates{{.*}}, ptr [[TMP24]], i32 0, i32 0 +// CHECK6-NEXT: [[OMP_GLOBAL_THREAD_NUM25:%.*]] = call i32 @__kmpc_global_thread_num(ptr @47) +// CHECK6-NEXT: [[TMP26:%.*]] = call i32 @__kmpc_omp_task(ptr @1, i32 [[OMP_GLOBAL_THREAD_NUM25]], ptr [[TMP24]]) +// CHECK6-NEXT: [[OMP_GLOBAL_THREAD_NUM27:%.*]] = call i32 @__kmpc_global_thread_num(ptr @49) +// CHECK6-NEXT: [[TMP27:%.*]] = call ptr @__kmpc_omp_task_alloc(ptr @1, i32 [[OMP_GLOBAL_THREAD_NUM27]], i32 257, i64 40, i64 1, ptr @.omp_task_entry..[[ENTRY47:[0-9]+]]) +// CHECK6-NEXT: [[TMP28:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t_with_privates{{.*}}, ptr [[TMP27]], i32 0, i32 0 +// CHECK6-NEXT: [[OMP_GLOBAL_THREAD_NUM28:%.*]] = call i32 @__kmpc_global_thread_num(ptr @49) +// CHECK6-NEXT: [[TMP29:%.*]] = call i32 @__kmpc_omp_task(ptr @1, i32 [[OMP_GLOBAL_THREAD_NUM28]], ptr [[TMP27]]) + // CHECK6-NEXT: ret void // CHECK6-NEXT:} diff --git a/clang/test/OpenMP/taskloop_ast_print.cpp b/clang/test/OpenMP/taskloop_ast_print.cpp index 9bca586937347..ff39f525435d4 100644 --- a/clang/test/OpenMP/taskloop_ast_print.cpp +++ b/clang/test/OpenMP/taskloop_ast_print.cpp @@ -104,14 +104,20 @@ int main(int argc, char **argv) { } } -#pragma omp taskloop transparent(omp_not_impex) +#pragma omp taskloop transparent priority(10) for (int i = 0; i < 10; ++i) { -#pragma omp task transparent(omp_import) +#pragma omp taskloop transparent for (int i = 0; i < 10; ++i) { -#pragma omp task transparent(omp_export) +#pragma omp taskloop transparent(omp_not_impex) for (int i = 0; i < 10; ++i) { +#pragma omp task transparent(omp_import) + for (int i = 0; i < 10; ++i) { +#pragma omp task transparent(omp_export) + for (int i = 0; i < 10; ++i) { #pragma omp task transparent(omp_impex) - foo(); + foo(); + } + } } } } @@ -122,14 +128,16 @@ int main(int argc, char **argv) { // CHECK60-NEXT: for (int j = 0; j < 10; ++j) { // CHECK60-NEXT: foo(); -// CHECK60: #pragma omp taskloop transparent(omp_not_impex) -// CHECK60-NEXT: for (int i = 0; i < 10; ++i) { -// CHECK60-NEXT: #pragma omp task transparent(omp_import) -// CHECK60-NEXT: for (int i = 0; i < 10; ++i) { -// CHECK60-NEXT: #pragma omp task transparent(omp_export) -// CHECK60-NEXT: for (int i = 0; i < 10; ++i) { -// CHECK60-NEXT: #pragma omp task transparent(omp_impex) -// CHECK60-NEXT: foo(); + // CHECK60: #pragma omp taskloop transparent(omp_impex) priority(10) + // CHECK60: #pragma omp taskloop transparent(omp_impex) + // CHECK60: #pragma omp taskloop transparent(omp_not_impex) + // CHECK60-NEXT: for (int i = 0; i < 10; ++i) { + // CHECK60-NEXT: #pragma omp task transparent(omp_import) + // CHECK60-NEXT: for (int i = 0; i < 10; ++i) { + // CHECK60-NEXT: #pragma omp task transparent(omp_export) + // CHECK60-NEXT: for (int i = 0; i < 10; ++i) { + // CHECK60-NEXT: #pragma omp task transparent(omp_impex) + // CHECK60-NEXT: foo(); return (tmain<int, 5>(argc) + tmain<char, 1>(argv[0][0])); } diff --git a/clang/test/OpenMP/taskloop_codegen.cpp b/clang/test/OpenMP/taskloop_codegen.cpp index 9073a2376f5b4..b5bbf6e259c35 100644 --- a/clang/test/OpenMP/taskloop_codegen.cpp +++ b/clang/test/OpenMP/taskloop_codegen.cpp @@ -265,6 +265,12 @@ void test_threadset() void test_transparent() { +#pragma omp taskloop transparent priority(10) + for (int i = 0; i < 10; ++i) { + } +#pragma omp taskloop transparent + for (int i = 0; i < 10; ++i) { + } #pragma omp taskloop transparent(omp_not_impex) for (int i = 0; i < 10; ++i) { } @@ -327,62 +333,95 @@ void test_transparent() // CHECK6: [[TMP4:%.*]] = alloca i32, align 4 // CHECK6: [[AGG_CAPTURED5:%.*]] = alloca [[STRUCT_ANON_24:%.*]], align 1 // CHECK6: [[TMP6:%.*]] = alloca i32, align 4 +// CHECK6: [[AGGD_CAPTURED9:%.*]] = alloca [[STRUCT_ANON_28:%.*]], align 1 +// CHECK6: [[TMP10:%.*]] = alloca i32, align 4 // CHECK6: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @1) // CHECK6: call void @__kmpc_taskgroup(ptr @1, i32 [[TMP0]]) -// CHECK6: [[TMP1:%.*]] = call ptr @__kmpc_omp_task_alloc(ptr @1, i32 [[TMP0]], i32 257, i64 80, i64 1, ptr @.omp_task_entry..[[ENTRY1:[0-9]+]]) +// CHECK6: [[TMP1:%.*]] = call ptr @__kmpc_omp_task_alloc(ptr @1, i32 [[TMP0]], i32 289, i64 80, i64 1, ptr @.omp_task_entry..[[ENTRY1:[0-9]+]]) // CHECK6: [[TMP2:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t_with_privates{{.*}}, ptr [[TMP1]], i32 0, i32 0 -// CHECK6: [[TMP3:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr [[TMP2]], i32 0, i32 5 -// CHECK6: store i64 0, ptr [[TMP3]], align 8 -// CHECK6: [[TMP4:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr [[TMP2]], i32 0, i32 6 -// CHECK6: store i64 9, ptr [[TMP4]], align 8 -// CHECK6: [[TMP5:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr [[TMP2]], i32 0, i32 7 -// CHECK6: store i64 1, ptr [[TMP5]], align 8 -// CHECK6: [[TMP6:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr [[TMP2]], i32 0, i32 9 -// CHECK6: call void @llvm.memset.p0.i64(ptr align 8 [[TMP6]], i8 0, i64 8, i1 false) -// CHECK6: [[TMP7:%.*]] = load i64, ptr [[TMP5]], align 8 -// CHECK6: call void @__kmpc_taskloop(ptr @1, i32 [[TMP0]], ptr [[TMP1]], i32 1, ptr [[TMP3]], ptr [[TMP4]], i64 [[TMP7]], i32 1, i32 0, i64 0, ptr null) +// CHECK6: [[TMP3:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr [[TMP2]], i32 0, i32 4 +// CHECK6: store i32 10, ptr [[TMP3]], align 8 +// CHECK6: [[TMP4:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t.2, ptr [[TMP2]], i32 0, i32 5 +// CHECK6: store i64 0, ptr [[TMP4]], align 8 +// CHECK6: [[TMP5:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr [[TMP2]], i32 0, i32 6 +// CHECK6: store i64 9, ptr [[TMP5]], align 8 +// CHECK6: [[TMP6:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr [[TMP2]], i32 0, i32 7 +// CHECK6: store i64 1, ptr [[TMP6]], align 8 +// CHECK6: [[TMP7:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr [[TMP2]], i32 0, i32 9 +// CHECK6: call void @llvm.memset.p0.i64(ptr align 8 [[TMP7]], i8 0, i64 8, i1 false) +// CHECK6: [[TMP8:%.*]] = load i64, ptr [[TMP6]], align 8 +// CHECK6: call void @__kmpc_taskloop(ptr @1, i32 [[TMP0]], ptr [[TMP1]], i32 1, ptr [[TMP4]], ptr [[TMP5]], i64 [[TMP8]], i32 1, i32 0, i64 0, ptr null) // CHECK6: call void @__kmpc_end_taskgroup(ptr @1, i32 [[TMP0]]) // CHECK6: call void @__kmpc_taskgroup(ptr @1, i32 [[TMP0]]) -// CHECK6: [[TMP8:%.*]] = call ptr @__kmpc_omp_task_alloc(ptr @1, i32 [[TMP0]], i32 257, i64 80, i64 1, ptr @.omp_task_entry..[[ENTRY2:[0-9]+]]) -// CHECK6: [[TMP9:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t_with_privates{{.*}}, ptr [[TMP8]], i32 0, i32 0 -// CHECK6: [[TMP10:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr [[TMP9]], i32 0, i32 5 -// CHECK6: store i64 0, ptr [[TMP10]], align 8 -// CHECK6: [[TMP11:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr [[TMP9]], i32 0, i32 6 -// CHECK6: store i64 9, ptr [[TMP11]], align 8 -// CHECK6: [[TMP12:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr [[TMP9]], i32 0, i32 7 -// CHECK6: store i64 1, ptr [[TMP12]], align 8 -// CHECK6: [[TMP13:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr [[TMP9]], i32 0, i32 9 -// CHECK6: call void @llvm.memset.p0.i64(ptr align 8 [[TMP13]], i8 0, i64 8, i1 false) -// CHECK6: [[TMP14:%.*]] = load i64, ptr [[TMP12]], align 8 -// CHECK6: call void @__kmpc_taskloop(ptr @1, i32 [[TMP0]], ptr [[TMP8]], i32 1, ptr [[TMP10]], ptr [[TMP11]], i64 [[TMP14]], i32 1, i32 0, i64 0, ptr null) +// CHECK6: [[TMP9:%.*]] = call ptr @__kmpc_omp_task_alloc(ptr @1, i32 [[TMP0]], i32 257, i64 80, i64 1, ptr @.omp_task_entry..[[ENTRY2:[0-9]+]]) +// CHECK6: [[TMP10:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t_with_privates{{.*}}, ptr [[TMP9]], i32 0, i32 0 +// CHECK6: [[TMP11:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr [[TMP10]], i32 0, i32 5 +// CHECK6: store i64 0, ptr [[TMP11]], align 8 +// CHECK6: [[TMP12:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr [[TMP10]], i32 0, i32 6 +// CHECK6: store i64 9, ptr [[TMP12]], align 8 +// CHECK6: [[TMP13:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr [[TMP10]], i32 0, i32 7 +// CHECK6: store i64 1, ptr [[TMP13]], align 8 +// CHECK6: [[TMP14:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr [[TMP10]], i32 0, i32 9 +// CHECK6: call void @llvm.memset.p0.i64(ptr align 8 [[TMP14]], i8 0, i64 8, i1 false) +// CHECK6: [[TMP15:%.*]] = load i64, ptr [[TMP13]], align 8 +// CHECK6: call void @__kmpc_taskloop(ptr @1, i32 [[TMP0]], ptr [[TMP9]], i32 1, ptr [[TMP11]], ptr [[TMP12]], i64 [[TMP15]], i32 1, i32 0, i64 0, ptr null) // CHECK6: call void @__kmpc_end_taskgroup(ptr @1, i32 [[TMP0]]) // CHECK6: call void @__kmpc_taskgroup(ptr @1, i32 [[TMP0]]) -// CHECK6: [[TMP15:%.*]] = call ptr @__kmpc_omp_task_alloc(ptr @1, i32 [[TMP0]], i32 257, i64 80, i64 1, ptr @.omp_task_entry..22) -// CHECK6: [[TMP16:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t_with_privates{{.*}}, ptr [[TMP15]], i32 0, i32 0 -// CHECK6: [[TMP17:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr [[TMP16]], i32 0, i32 5 -// CHECK6: store i64 0, ptr [[TMP17]], align 8 -// CHECK6: [[TMP18:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr [[TMP16]], i32 0, i32 6 -// CHECK6: store i64 9, ptr [[TMP18]], align 8 -// CHECK6: [[TMP19:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr [[TMP16]], i32 0, i32 7 -// CHECK6: store i64 1, ptr [[TMP19]], align 8 -// CHECK6: [[TMP20:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr [[TMP16]], i32 0, i32 9 -// CHECK6: call void @llvm.memset.p0.i64(ptr align 8 [[TMP20]], i8 0, i64 8, i1 false) -// CHECK6: [[TMP21:%.*]] = load i64, ptr [[TMP19]], align 8 -// CHECK6: call void @__kmpc_taskloop(ptr @1, i32 [[TMP0]], ptr [[TMP15]], i32 1, ptr [[TMP17]], ptr [[TMP18]], i64 [[TMP21]], i32 1, i32 0, i64 0, ptr null) +// CHECK6: [[TMP16:%.*]] = call ptr @__kmpc_omp_task_alloc(ptr @1, i32 [[TMP0]], i32 257, i64 80, i64 1, ptr @.omp_task_entry..22) +// CHECK6: [[TMP17:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t_with_privates{{.*}}, ptr [[TMP16]], i32 0, i32 0 +// CHECK6: [[TMP18:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr [[TMP17]], i32 0, i32 5 +// CHECK6: store i64 0, ptr [[TMP18]], align 8 +// CHECK6: [[TMP19:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr [[TMP17]], i32 0, i32 6 +// CHECK6: store i64 9, ptr [[TMP19]], align 8 +// CHECK6: [[TMP20:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr [[TMP17]], i32 0, i32 7 +// CHECK6: store i64 1, ptr [[TMP20]], align 8 +// CHECK6: [[TMP21:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr [[TMP17]], i32 0, i32 9 +// CHECK6: call void @llvm.memset.p0.i64(ptr align 8 [[TMP21]], i8 0, i64 8, i1 false) +// CHECK6: [[TMP22:%.*]] = load i64, ptr [[TMP20]], align 8 +// CHECK6: call void @__kmpc_taskloop(ptr @1, i32 [[TMP0]], ptr [[TMP16]], i32 1, ptr [[TMP18]], ptr [[TMP19]], i64 [[TMP22]], i32 1, i32 0, i64 0, ptr null) +// CHECK6: call void @__kmpc_end_taskgroup(ptr @1, i32 [[TMP0]]) +// CHECK6: call void @__kmpc_taskgroup(ptr @1, i32 [[TMP0]]) +// CHECK6: [[TMP23:%.*]] = call ptr @__kmpc_omp_task_alloc(ptr @1, i32 [[TMP0]], i32 257, i64 80, i64 1, ptr @.omp_task_entry..24) +// CHECK6: [[TMP24:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t_with_privates{{.*}}, ptr [[TMP23]], i32 0, i32 0 +// CHECK6: [[TMP25:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr [[TMP24]], i32 0, i32 5 +// CHECK6: store i64 0, ptr [[TMP25]], align 8 +// CHECK6: [[TMP26:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr [[TMP24]], i32 0, i32 6 +// CHECK6: store i64 9, ptr [[TMP26]], align 8 +// CHECK6: [[TMP27:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr [[TMP24]], i32 0, i32 7 +// CHECK6: store i64 1, ptr [[TMP27]], align 8 +// CHECK6: [[TMP28:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr [[TMP24]], i32 0, i32 9 +// CHECK6: call void @llvm.memset.p0.i64(ptr align 8 [[TMP28]], i8 0, i64 8, i1 false) +// CHECK6: [[TMP29:%.*]] = load i64, ptr [[TMP27]], align 8 +// CHECK6: call void @__kmpc_taskloop(ptr @1, i32 [[TMP0]], ptr [[TMP23]], i32 1, ptr [[TMP25]], ptr [[TMP26]], i64 [[TMP29]], i32 1, i32 0, i64 0, ptr null) +// CHECK6: call void @__kmpc_end_taskgroup(ptr @1, i32 [[TMP0]]) + +// CHECK6: call void @__kmpc_taskgroup(ptr @1, i32 [[TMP0]]) +// CHECK6: [[TMP30:%.*]] = call ptr @__kmpc_omp_task_alloc(ptr @1, i32 [[TMP0]], i32 257, i64 80, i64 1, ptr @.omp_task_entry..[[ENTRY26:[0-9]+]]) +// CHECK6: [[TMP31:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t_with_privates.27, ptr [[TMP30]], i32 0, i32 0 +// CHECK6: [[TMP32:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t.2, ptr [[TMP31]], i32 0, i32 5 +// CHECK6: store i64 0, ptr [[TMP32]], align 8 +// CHECK6: [[TMP33:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t.2, ptr [[TMP31]], i32 0, i32 6 +// CHECK6: store i64 9, ptr [[TMP33]], align 8 +// CHECK6: [[TMP34:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t.2, ptr [[TMP31]], i32 0, i32 7 +// CHECK6: store i64 1, ptr [[TMP34]], align 8 +// CHECK6: [[TMP35:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t.2, ptr [[TMP31]], i32 0, i32 9 +// CHECK6: call void @llvm.memset.p0.i64(ptr align 8 [[TMP35]], i8 0, i64 8, i1 false) +// CHECK6: [[TMP36:%.*]] = load i64, ptr [[TMP34]], align 8 +// CHECK6: call void @__kmpc_taskloop(ptr @1, i32 [[TMP0]], ptr [[TMP30]], i32 1, ptr [[TMP32]], ptr [[TMP33]], i64 [[TMP36]], i32 1, i32 0, i64 0, ptr null) // CHECK6: call void @__kmpc_end_taskgroup(ptr @1, i32 [[TMP0]]) // CHECK6: call void @__kmpc_taskgroup(ptr @1, i32 [[TMP0]]) -// CHECK6: [[TMP22:%.*]] = call ptr @__kmpc_omp_task_alloc(ptr @1, i32 [[TMP0]], i32 257, i64 80, i64 1, ptr @.omp_task_entry..24) -// CHECK6: [[TMP23:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t_with_privates{{.*}}, ptr [[TMP22]], i32 0, i32 0 -// CHECK6: [[TMP24:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr [[TMP23]], i32 0, i32 5 -// CHECK6: store i64 0, ptr [[TMP24]], align 8 -// CHECK6: [[TMP25:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr [[TMP23]], i32 0, i32 6 -// CHECK6: store i64 9, ptr [[TMP25]], align 8 -// CHECK6: [[TMP26:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr [[TMP23]], i32 0, i32 7 -// CHECK6: store i64 1, ptr [[TMP26]], align 8 -// CHECK6: [[TMP27:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr [[TMP23]], i32 0, i32 9 -// CHECK6: call void @llvm.memset.p0.i64(ptr align 8 [[TMP27]], i8 0, i64 8, i1 false) -// CHECK6: [[TMP28:%.*]] = load i64, ptr [[TMP26]], align 8 -// CHECK6: call void @__kmpc_taskloop(ptr @1, i32 [[TMP0]], ptr [[TMP22]], i32 1, ptr [[TMP24]], ptr [[TMP25]], i64 [[TMP28]], i32 1, i32 0, i64 0, ptr null) +// CHECK6: [[TMP37:%.*]] = call ptr @__kmpc_omp_task_alloc(ptr @1, i32 [[TMP0]], i32 257, i64 80, i64 1, ptr @.omp_task_entry..[[ENTRY28:[0-9]+]]) +// CHECK6: [[TMP38:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t_with_privates.29, ptr [[TMP37]], i32 0, i32 0 +// CHECK6: [[TMP39:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t.2, ptr [[TMP38]], i32 0, i32 5 +// CHECK6: store i64 0, ptr [[TMP39]], align 8 +// CHECK6: [[TMP40:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t.2, ptr [[TMP38]], i32 0, i32 6 +// CHECK6: store i64 9, ptr [[TMP40]], align 8 +// CHECK6: [[TMP41:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t.2, ptr [[TMP38]], i32 0, i32 7 +// CHECK6: store i64 1, ptr [[TMP41]], align 8 +// CHECK6: [[TMP42:%.*]] = getelementptr inbounds nuw %struct.kmp_task_t.2, ptr [[TMP38]], i32 0, i32 9 +// CHECK6: call void @llvm.memset.p0.i64(ptr align 8 [[TMP42]], i8 0, i64 8, i1 false) +// CHECK6: [[TMP43:%.*]] = load i64, ptr [[TMP41]], align 8 +// CHECK6: call void @__kmpc_taskloop(ptr @1, i32 [[TMP0]], ptr [[TMP37]], i32 1, ptr [[TMP39]], ptr [[TMP40]], i64 [[TMP43]], i32 1, i32 0, i64 0, ptr null) // CHECK6: call void @__kmpc_end_taskgroup(ptr @1, i32 [[TMP0]]) // CHECK6: ret void // CHECK6:} _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
