Skip to content

[Frontend][OpenMP] Remove reduction from allowed clauses for target #90754

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions clang/test/Analysis/cfg-openmp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,21 +195,20 @@ void xxx(int argc) {
#pragma omp single
argc = x;
// CHECK-NEXT: [[#TARGET:]]:
// CHECK-SAME: [B1.[[#TARGET+10]]]
// CHECK-NEXT: [[#TARGET+1]]: [B1.[[#TARGET+10]]] (ImplicitCastExpr, LValueToRValue, int)
// CHECK-NEXT: [[#TARGET+2]]: [B1.[[#TARGET+9]]]
// CHECK-NEXT: [[#TARGET+3]]: [B1.[[#TARGET+9]]] = [B1.[[#TARGET+1]]]
// CHECK-SAME: [B1.[[#TARGET+9]]]
// CHECK-NEXT: [[#TARGET+1]]: [B1.[[#TARGET+9]]] (ImplicitCastExpr, LValueToRValue, int)
// CHECK-NEXT: [[#TARGET+2]]: [B1.[[#TARGET+8]]]
// CHECK-NEXT: [[#TARGET+3]]: [B1.[[#TARGET+8]]] = [B1.[[#TARGET+1]]]
// CHECK-NEXT: [[#TARGET+4]]: cond
// CHECK-NEXT: [[#TARGET+5]]: [B1.[[#TARGET+4]]] (ImplicitCastExpr, LValueToRValue, int)
// CHECK-NEXT: [[#TARGET+6]]: [B1.[[#TARGET+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
// CHECK-NEXT: [[#TARGET+7]]: fp
// CHECK-NEXT: [[#TARGET+8]]: rd
// CHECK-NEXT: [[#TARGET+9]]: argc
// CHECK-NEXT: [[#TARGET+10]]: x
// CHECK-NEXT: [[#TARGET+11]]: #pragma omp target depend(in : argc) if(cond) firstprivate(fp) reduction(-: rd)
// CHECK-NEXT: [[#TARGET+8]]: argc
// CHECK-NEXT: [[#TARGET+9]]: x
// CHECK-NEXT: [[#TARGET+10]]: #pragma omp target depend(in : argc) if(cond) firstprivate(fp)
// CHECK-NEXT: [B1.[[#TARGET+3]]];
#pragma omp target depend(in \
: argc) if(cond) firstprivate(fp) reduction(-:rd)
: argc) if(cond) firstprivate(fp)
argc = x;
// CHECK-NEXT: [[#TP:]]:
// CHECK-SAME: [B1.[[#TP+11]]]
Expand Down
18 changes: 0 additions & 18 deletions clang/test/OpenMP/nvptx_target_cuda_mode_messages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,6 @@ int foo(int n, double *ptr) {
return a;
}

template <typename tx>
tx ftemplate(int n) {
tx a = 0;
tx b[10];

#pragma omp target reduction(+ \
: a, b) // expected-note {{defined as threadprivate or thread local}}
{
int e; // expected-note {{defined as threadprivate or thread local}}
#pragma omp parallel shared(a, e) // expected-error 2 {{threadprivate or thread local variable cannot be shared}}
a += 1;
b[2] += 1;
}

return a;
}

static int fstatic(int n) {
int a = 0;
char aaa = 0;
Expand Down Expand Up @@ -101,7 +84,6 @@ int bar(int n, double *ptr) {
S1 S;
a += S.r1(n);
a += fstatic(n);
a += ftemplate<int>(n); // expected-note {{in instantiation of function template specialization 'ftemplate<int>' requested here}}

return a;
}
Expand Down
231 changes: 0 additions & 231 deletions clang/test/OpenMP/target_reduction_codegen.cpp

This file was deleted.

Loading
Loading