[flang-commits] [flang] d77ae42 - Revert "[compiler-rt] Use just built libatomic if available"

Valentin Clement via flang-commits flang-commits at lists.llvm.org
Tue Aug 29 14:55:13 PDT 2023


Author: Valentin Clement
Date: 2023-08-29T14:54:33-07:00
New Revision: d77ae428e08609ada9868d719a100c144c873974

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

LOG: Revert "[compiler-rt] Use just built libatomic if available"

This reverts commit 02fa9fc018db5b757a4ce129d85d64efefc8645c.

Commit message and content does not match. Revert to commit with
a proper commit message.

Added: 
    

Modified: 
    flang/docs/OpenACC.md
    flang/lib/Lower/OpenACC.cpp
    flang/lib/Semantics/check-acc-structure.cpp
    flang/lib/Semantics/check-directive-structure.h
    flang/test/Lower/OpenACC/acc-data.f90
    flang/test/Semantics/OpenACC/acc-data.f90

Removed: 
    


################################################################################
diff  --git a/flang/docs/OpenACC.md b/flang/docs/OpenACC.md
index 2becfb1aeac1a6..79b7e3000b02aa 100644
--- a/flang/docs/OpenACC.md
+++ b/flang/docs/OpenACC.md
@@ -18,5 +18,3 @@
 * An `!$acc routine` with no parallelism clause is treated as if the `seq`
   clause was present.
 * `!$acc end loop` does not trigger a parsing error and is just ignored.
-* The restriction on `!$acc data` required clauses is emitted as a portability
-  warning instead of an error as other compiler accepts it.

diff  --git a/flang/lib/Lower/OpenACC.cpp b/flang/lib/Lower/OpenACC.cpp
index d6f6ae18a40116..5ec04722cd5e11 100644
--- a/flang/lib/Lower/OpenACC.cpp
+++ b/flang/lib/Lower/OpenACC.cpp
@@ -1937,9 +1937,6 @@ static void genACCDataOp(Fortran::lower::AbstractConverter &converter,
   addOperands(operands, operandSegments, waitOperands);
   addOperands(operands, operandSegments, dataClauseOperands);
 
-  if (dataClauseOperands.empty() && !hasDefaultNone && !hasDefaultPresent)
-    return;
-
   auto dataOp = createRegionOp<mlir::acc::DataOp, mlir::acc::TerminatorOp>(
       builder, currentLocation, operands, operandSegments);
 

diff  --git a/flang/lib/Semantics/check-acc-structure.cpp b/flang/lib/Semantics/check-acc-structure.cpp
index 692a7a408947aa..677a1d65b13ee5 100644
--- a/flang/lib/Semantics/check-acc-structure.cpp
+++ b/flang/lib/Semantics/check-acc-structure.cpp
@@ -147,9 +147,8 @@ void AccStructureChecker::Leave(const parser::OpenACCBlockConstruct &x) {
     CheckNoBranching(block, GetContext().directive, blockDir.source);
     break;
   case llvm::acc::Directive::ACCD_data:
-    // Restriction - 2.6.5 pt 1
-    // Only a warning is emitted here for portability reason.
-    CheckRequireAtLeastOneOf(/*warnInsteadOfError=*/true);
+    // Restriction - line 1249-1250
+    CheckRequireAtLeastOneOf();
     // Restriction is not formally in the specification but all compilers emit
     // an error and it is likely to be omitted from the spec.
     CheckNoBranching(block, GetContext().directive, blockDir.source);

diff  --git a/flang/lib/Semantics/check-directive-structure.h b/flang/lib/Semantics/check-directive-structure.h
index 14a3151e672685..5dc1d7b4885578 100644
--- a/flang/lib/Semantics/check-directive-structure.h
+++ b/flang/lib/Semantics/check-directive-structure.h
@@ -331,7 +331,7 @@ class DirectiveStructureChecker : public virtual BaseChecker {
   // Check that only clauses in set are after the specific clauses.
   void CheckOnlyAllowedAfter(C clause, common::EnumSet<C, ClauseEnumSize> set);
 
-  void CheckRequireAtLeastOneOf(bool warnInsteadOfError = false);
+  void CheckRequireAtLeastOneOf();
 
   void CheckAllowed(C clause);
 
@@ -422,7 +422,7 @@ DirectiveStructureChecker<D, C, PC, ClauseEnumSize>::ClauseSetToString(
 // directive.
 template <typename D, typename C, typename PC, std::size_t ClauseEnumSize>
 void DirectiveStructureChecker<D, C, PC,
-    ClauseEnumSize>::CheckRequireAtLeastOneOf(bool warnInsteadOfError) {
+    ClauseEnumSize>::CheckRequireAtLeastOneOf() {
   if (GetContext().requiredClauses.empty())
     return;
   for (auto cl : GetContext().actualClauses) {
@@ -430,16 +430,10 @@ void DirectiveStructureChecker<D, C, PC,
       return;
   }
   // No clause matched in the actual clauses list
-  if (warnInsteadOfError)
-    context_.Say(GetContext().directiveSource,
-        "At least one of %s clause should appear on the %s directive"_port_en_US,
-        ClauseSetToString(GetContext().requiredClauses),
-        ContextDirectiveAsFortran());
-  else
-    context_.Say(GetContext().directiveSource,
-        "At least one of %s clause must appear on the %s directive"_err_en_US,
-        ClauseSetToString(GetContext().requiredClauses),
-        ContextDirectiveAsFortran());
+  context_.Say(GetContext().directiveSource,
+      "At least one of %s clause must appear on the %s directive"_err_en_US,
+      ClauseSetToString(GetContext().requiredClauses),
+      ContextDirectiveAsFortran());
 }
 
 template <typename D, typename C, typename PC, std::size_t ClauseEnumSize>

diff  --git a/flang/test/Lower/OpenACC/acc-data.f90 b/flang/test/Lower/OpenACC/acc-data.f90
index 5226474d012c13..57336a761c73ea 100644
--- a/flang/test/Lower/OpenACC/acc-data.f90
+++ b/flang/test/Lower/OpenACC/acc-data.f90
@@ -188,9 +188,5 @@ subroutine acc_data
 ! CHECK:   acc.terminator
 ! CHECK: } attributes {defaultAttr = #acc<defaultvalue present>}
 
-  !$acc data
-  !$acc end data
-! CHECK-NOT: acc.data
-
 end subroutine acc_data
 

diff  --git a/flang/test/Semantics/OpenACC/acc-data.f90 b/flang/test/Semantics/OpenACC/acc-data.f90
index 17e0624b8cf24d..de168ba70d19b9 100644
--- a/flang/test/Semantics/OpenACC/acc-data.f90
+++ b/flang/test/Semantics/OpenACC/acc-data.f90
@@ -132,7 +132,7 @@ program openacc_data_validity
   !ERROR: At least one of COPYOUT, DELETE, DETACH clause must appear on the EXIT DATA directive
   !$acc exit data
 
-  !PORTABILITY: At least one of ATTACH, COPY, COPYIN, COPYOUT, CREATE, DEFAULT, DEVICEPTR, NO_CREATE, PRESENT clause should appear on the DATA directive
+  !ERROR: At least one of ATTACH, COPY, COPYIN, COPYOUT, CREATE, DEFAULT, DEVICEPTR, NO_CREATE, PRESENT clause must appear on the DATA directive
   !$acc data
   !$acc end data
 


        


More information about the flang-commits mailing list