[llvm-branch-commits] [clang] 3c012fe - Revert "[OpenMP][Clang] Enable inscan modifier for generic datatypes (#82220)"

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Feb 28 22:58:32 PST 2024


Author: Animesh Kumar
Date: 2024-02-29T12:28:28+05:30
New Revision: 3c012fe491aa04a471e0d5ae6eb29e5b1fada65b

URL: https://github.com/llvm/llvm-project/commit/3c012fe491aa04a471e0d5ae6eb29e5b1fada65b
DIFF: https://github.com/llvm/llvm-project/commit/3c012fe491aa04a471e0d5ae6eb29e5b1fada65b.diff

LOG: Revert "[OpenMP][Clang] Enable inscan modifier for generic datatypes (#82220)"

This reverts commit 3246c44789546fa926784911e349202d8fd8e33b.

Added: 
    

Modified: 
    clang/lib/Sema/SemaOpenMP.cpp
    clang/test/OpenMP/scan_ast_print.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp
index f4364a259ad57f..7f75cfc5b54f35 100644
--- a/clang/lib/Sema/SemaOpenMP.cpp
+++ b/clang/lib/Sema/SemaOpenMP.cpp
@@ -4962,8 +4962,7 @@ StmtResult Sema::ActOnOpenMPRegionEnd(StmtResult S,
           if (RC->getModifier() != OMPC_REDUCTION_inscan)
             continue;
           for (Expr *E : RC->copy_array_temps())
-            if (E)
-              MarkDeclarationsReferencedInExpr(E);
+            MarkDeclarationsReferencedInExpr(E);
         }
         if (auto *AC = dyn_cast<OMPAlignedClause>(C)) {
           for (Expr *E : AC->varlists())

diff  --git a/clang/test/OpenMP/scan_ast_print.cpp b/clang/test/OpenMP/scan_ast_print.cpp
index 82cb13eb6e70f7..3bbd3b60c3e8c4 100644
--- a/clang/test/OpenMP/scan_ast_print.cpp
+++ b/clang/test/OpenMP/scan_ast_print.cpp
@@ -17,10 +17,6 @@ T tmain(T argc) {
   static T a;
 #pragma omp for reduction(inscan, +: a)
   for (int i = 0; i < 10; ++i) {
-#pragma omp scan inclusive(a)
-  }
-#pragma omp parallel for reduction(inscan, +:a)
-  for (int i = 0; i < 10; ++i) {
 #pragma omp scan inclusive(a)
   }
   return a + argc;
@@ -29,29 +25,15 @@ T tmain(T argc) {
 // CHECK-NEXT: #pragma omp for reduction(inscan, +: a)
 // CHECK-NEXT: for (int i = 0; i < 10; ++i) {
 // CHECK-NEXT: #pragma omp scan inclusive(a){{$}}
-
-// CHECK: #pragma omp parallel for reduction(inscan, +: a)
-// CHECK-NEXT: for (int i = 0; i < 10; ++i) {
-// CHECK-NEXT: #pragma omp scan inclusive(a){{$}}
-
 // CHECK:      static int a;
 // CHECK-NEXT: #pragma omp for reduction(inscan, +: a)
 // CHECK-NEXT: for (int i = 0; i < 10; ++i) {
 // CHECK-NEXT: #pragma omp scan inclusive(a)
-
-// CHECK: #pragma omp parallel for reduction(inscan, +: a)
-// CHECK-NEXT: for (int i = 0; i < 10; ++i) {
-// CHECK-NEXT: #pragma omp scan inclusive(a)
-
 // CHECK:      static char a;
 // CHECK-NEXT: #pragma omp for reduction(inscan, +: a)
 // CHECK-NEXT: for (int i = 0; i < 10; ++i) {
 // CHECK-NEXT: #pragma omp scan inclusive(a)
 
-// CHECK: #pragma omp parallel for reduction(inscan, +: a)
-// CHECK-NEXT: for (int i = 0; i < 10; ++i) {
-// CHECK-NEXT: #pragma omp scan inclusive(a)
-
 int main(int argc, char **argv) {
   static int a;
 // CHECK: static int a;


        


More information about the llvm-branch-commits mailing list