[all-commits] [llvm/llvm-project] bf39ff: [flang][OpenMP] Overhaul implementation of ATOMIC ...

Krzysztof Parzyszek via All-commits all-commits at lists.llvm.org
Tue Apr 29 11:51:35 PDT 2025


  Branch: refs/heads/users/kparzysz/spr/a04-atomic-one
  Home:   https://github.com/llvm/llvm-project
  Commit: bf39ff5f8869c7197a48fe410042533f102ddec9
      https://github.com/llvm/llvm-project/commit/bf39ff5f8869c7197a48fe410042533f102ddec9
  Author: Krzysztof Parzyszek <Krzysztof.Parzyszek at amd.com>
  Date:   2025-04-29 (Tue, 29 Apr 2025)

  Changed paths:
    M flang/include/flang/Parser/dump-parse-tree.h
    M flang/include/flang/Parser/parse-tree.h
    M flang/include/flang/Semantics/tools.h
    M flang/lib/Lower/OpenMP/DataSharingProcessor.cpp
    M flang/lib/Lower/OpenMP/OpenMP.cpp
    M flang/lib/Parser/openmp-parsers.cpp
    M flang/lib/Parser/parse-tree.cpp
    M flang/lib/Parser/unparse.cpp
    M flang/lib/Semantics/check-omp-structure.cpp
    M flang/lib/Semantics/check-omp-structure.h
    M flang/lib/Semantics/resolve-names.cpp
    M flang/lib/Semantics/rewrite-directives.cpp
    M flang/test/Lower/OpenMP/Todo/atomic-compare-fail.f90
    M flang/test/Lower/OpenMP/Todo/atomic-compare.f90
    M flang/test/Lower/OpenMP/atomic-capture.f90
    M flang/test/Lower/OpenMP/atomic-write.f90
    R flang/test/Parser/OpenMP/atomic-compare.f90
    M flang/test/Semantics/OpenMP/atomic-compare.f90
    M flang/test/Semantics/OpenMP/atomic-hint-clause.f90
    A flang/test/Semantics/OpenMP/atomic-read.f90
    A flang/test/Semantics/OpenMP/atomic-update-capture.f90
    A flang/test/Semantics/OpenMP/atomic-update-only.f90
    M flang/test/Semantics/OpenMP/atomic-update-overloaded-ops.f90
    A flang/test/Semantics/OpenMP/atomic-write.f90
    M flang/test/Semantics/OpenMP/atomic.f90
    M flang/test/Semantics/OpenMP/atomic01.f90
    M flang/test/Semantics/OpenMP/atomic02.f90
    M flang/test/Semantics/OpenMP/atomic03.f90
    M flang/test/Semantics/OpenMP/atomic04.f90
    M flang/test/Semantics/OpenMP/atomic05.f90
    M flang/test/Semantics/OpenMP/critical-hint-clause.f90
    M flang/test/Semantics/OpenMP/omp-atomic-assignment-stmt.f90
    M flang/test/Semantics/OpenMP/requires-atomic01.f90
    M flang/test/Semantics/OpenMP/requires-atomic02.f90

  Log Message:
  -----------
  [flang][OpenMP] Overhaul implementation of ATOMIC construct

The parser will accept a wide variety of illegal attempts at forming
an ATOMIC construct, leaving it to the semantic analysis to diagnose
any issues. This consolidates the analysis into one place and allows
us to produce more informative diagnostics.

The parser's outcome will be parser::OpenMPAtomicConstruct object
holding the directive, parser::Body, and an optional end-directive.
The prior variety of OmpAtomicXyz classes, as well as OmpAtomicClause
have been removed. READ, WRITE, etc. are now proper clauses.

The semantic analysis consistently operates on "evaluation" represen-
tations, mainly evaluate::Expr (as SomeExpr) and evaluate::Assignment.
The results of the semantic analysis are stored in a mutable member
of the OpenMPAtomicConstruct node. This follows a precedent of having
`typedExpr` member in parser::Expr, for example. This allows the
lowering code to avoid duplicated handling of AST nodes.

Using a BLOCK construct containing multiple statements for an ATOMIC
construct that requires multiple statements is now allowed. In fact,
any nesting of such BLOCK constructs is allowed.

This implementation will parse, and perform semantic checks for both
conditional-update and conditional-update-capture, although no MLIR
will be generated for those. Instead, a TODO error will be issues
prior to lowering.

The allowed forms of the ATOMIC construct were based on the OpenMP 6.0
spec.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list