-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Revert "[Clang][OpenMP] Bug fix Default clause variable category" #168083
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
Revert "[Clang][OpenMP] Bug fix Default clause variable category" #168083
Conversation
|
@llvm/pr-subscribers-clang Author: None (SunilKuravinakop) ChangesReverts llvm/llvm-project#165276 Full diff: https://github.com/llvm/llvm-project/pull/168083.diff 2 Files Affected:
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp
index 31c8f0cd30c56..81c591a00cfc6 100644
--- a/clang/lib/Sema/SemaOpenMP.cpp
+++ b/clang/lib/Sema/SemaOpenMP.cpp
@@ -1364,15 +1364,15 @@ DSAStackTy::DSAVarData DSAStackTy::getDSA(const_iterator &Iter,
DefaultDataSharingAttributes IterDA = Iter->DefaultAttr;
switch (Iter->DefaultVCAttr) {
case DSA_VC_aggregate:
- if (!D->getType()->isAggregateType())
+ if (!VD->getType()->isAggregateType())
IterDA = DSA_none;
break;
case DSA_VC_pointer:
- if (!D->getType()->isPointerType())
+ if (!VD->getType()->isPointerType())
IterDA = DSA_none;
break;
case DSA_VC_scalar:
- if (!D->getType()->isScalarType())
+ if (!VD->getType()->isScalarType())
IterDA = DSA_none;
break;
case DSA_VC_all:
diff --git a/clang/test/OpenMP/parallel_default_variableCategory_codegen.cpp b/clang/test/OpenMP/parallel_default_variableCategory_codegen.cpp
deleted file mode 100644
index f7dc74c503537..0000000000000
--- a/clang/test/OpenMP/parallel_default_variableCategory_codegen.cpp
+++ /dev/null
@@ -1,92 +0,0 @@
-// RUN: %clangxx -Xclang -verify -Wno-vla -fopenmp -fopenmp-version=60 -x c++ -S -emit-llvm %s -o - | FileCheck %s
-// expected-no-diagnostics
-#ifndef HEADER
-#define HEADER
-
-#include <vector>
-
-int global;
-#define VECTOR_SIZE 4
-int main (int argc, char **argv) {
- int i,n;
- int x;
-
- n = VECTOR_SIZE;
-
- #pragma omp parallel masked firstprivate(x) num_threads(2)
- {
- int *xPtr = nullptr;
- // scalar
- #pragma omp task default(shared:scalar)
- {
- xPtr = &x;
- }
- #pragma omp taskwait
-
- // pointer
- #pragma omp task default(shared:pointer) shared(x)
- {
- xPtr = &x;
- }
- #pragma omp taskwait
- }
-
- int *aggregate[VECTOR_SIZE] = {0,0,0,0};
-
- #pragma omp parallel masked num_threads(2)
- {
- // aggregate
- #pragma omp task default(shared:aggregate)
- for(i=0;i<n;i++) {
- aggregate[i] = &x;
- }
- #pragma omp taskwait
-
- #pragma omp task default(shared:aggregate) shared(x)
- for(i=0;i<n;i++) {
- aggregate[i] = &x;
- }
- #pragma omp taskwait
-
- // all
- #pragma omp task default(shared:all)
- for(i=0;i<n;i++) {
- aggregate[i] = &x;
- }
- #pragma omp taskwait
- }
-}
-
-#endif
-
-// CHECK-LABEL: define {{.*}}main.omp_outlined{{.*}}
-// CHECK-NEXT: entry:
-// CHECK: %x.addr = alloca{{.*}}
-// CHECK: %xPtr = alloca{{.*}}
-// CHECK: store ptr null, ptr %xPtr{{.*}}
-// CHECK: store ptr %xPtr{{.*}}
-// CHECK: store ptr %x.addr{{.*}}
-// CHECK-NEXT: {{.*}}call{{.*}}__kmpc_omp_task_alloc{{.*}}
-// CHECK: ret void
-//
-// CHECK: define {{.*}}main.omp_outlined{{.*}}
-// CHECK-NEXT: entry:
-// CHECK-DAG: %i.addr = alloca{{.*}}
-// CHECK-DAG: %n.addr = alloca{{.*}}
-// CHECK-DAG: %aggregate.addr = alloca{{.*}}
-// CHECK-DAG: %x.addr = alloca{{.*}}
-// CHECK: [[TMP0:%.*]] = load{{.*}}%i.addr{{.*}}
-// CHECK-NEXT: [[TMP1:%.*]] = load{{.*}}%n.addr{{.*}}
-// CHECK-NEXT: [[TMP2:%.*]] = load{{.*}}%aggregate.addr{{.*}}
-// CHECK-NEXT: [[TMP3:%.*]] = load{{.*}}%x.addr{{.*}}
-// CHECK: store ptr [[TMP2]]{{.*}}
-// CHECK-NEXT: {{.*}}call{{.*}}__kmpc_omp_task_alloc{{.*}}
-// CHECK: store ptr [[TMP2]]{{.*}}
-// CHECK: store ptr [[TMP3]]{{.*}}
-// CHECK-NEXT: {{.*}}call{{.*}}__kmpc_omp_task_alloc{{.*}}
-// CHECK: store ptr [[TMP0]]{{.*}}
-// CHECK: store ptr [[TMP1]]{{.*}}
-// CHECK: store ptr [[TMP2]]{{.*}}
-// CHECK: store ptr [[TMP3]]{{.*}}
-// CHECK-NEXT: {{.*}}call{{.*}}__kmpc_omp_task_alloc{{.*}}
-// CHECK: ret void
|
|
|
asb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverting LGTM. The added test is causing failures for RISC-V as well https://lab.llvm.org/buildbot/#/builders/87/builds/4136
|
In line with our revert policy I've gone ahead and merged this so as to unbreak the bots (at least llvm-clang-win-x-aarch64, llvm-clang-win-x-armv7l, llvm-clang-x86_64-gcc-ubuntu-no-asserts also fail on the newly added test). |
Reverts #165276