Skip to content

Conversation

@SunilKuravinakop
Copy link
Contributor

Reverts #165276

@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" clang:openmp OpenMP related changes to Clang labels Nov 14, 2025
@llvmbot
Copy link
Member

llvmbot commented Nov 14, 2025

@llvm/pr-subscribers-clang

Author: None (SunilKuravinakop)

Changes

Reverts llvm/llvm-project#165276


Full diff: https://github.com/llvm/llvm-project/pull/168083.diff

2 Files Affected:

  • (modified) clang/lib/Sema/SemaOpenMP.cpp (+3-3)
  • (removed) clang/test/OpenMP/parallel_default_variableCategory_codegen.cpp (-92)
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

@github-actions
Copy link

⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo.
Please turn off Keep my email addresses private setting in your account.
See LLVM Developer Policy and LLVM Discourse for more information.

Copy link
Contributor

@asb asb left a 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

@asb asb merged commit 8b105cb into llvm:main Nov 14, 2025
14 checks passed
@asb
Copy link
Contributor

asb commented Nov 14, 2025

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:frontend Language frontend issues, e.g. anything involving "Sema" clang:openmp OpenMP related changes to Clang clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants