summaryrefslogtreecommitdiff
path: root/flang/lib/Parser/openmp-utils.cpp
AgeCommit message (Collapse)Author
2025-11-22[flang][OpenMP] Canonicalize loops with intervening OpenMP constructs (#169191)Krzysztof Parzyszek
Example based on the gfortran test a.6.1.f90 ``` do 100 i = 1,10 !$omp do do 100 j = 1,10 call work(i,j) 100 continue ``` During canonicalization of label-DO loops, if the body of an OpenMP construct ends with a label, treat the label as ending the construct itself. This will also allow handling of cases like ``` do 100 i = 1, 10 !$omp atomic write 100 x = i ``` which we were unable to before.
2025-11-22[flang][OpenMP] Move some utilities from openmp-parsers to openmp-uti… ↵Krzysztof Parzyszek
(#169188) …ls, NFC
2025-11-21[Flang][OpenMP] Add semantic support for Loop Sequences and OpenMP loop fuse ↵Ferran Toda
(#161213) This patch adds semantics for the `omp fuse` directive in flang, as specified in OpenMP 6.0. This patch also enables semantic support for loop sequences which are needed for the fuse directive along with semantics for the `looprange` clause. These changes are only semantic. Relevant tests have been added , and previous behavior is retained with no changes. --------- Co-authored-by: Ferran Toda <ferran.todacasaban@bsc.es> Co-authored-by: Krzysztof Parzyszek <Krzysztof.Parzyszek@amd.com>
2025-11-18[flang][OpenMP] Move two utilities from Semantics to Parser, NFC (#168549)Krzysztof Parzyszek
Move `GetInnermostExecPart` and `IsStrictlyStructuredBlock` from Semantics/openmp-utils.* to Parser/openmp-utils.*. These two only depend on the AST contents and properties.
2025-11-03[flang][OpenMP] Use OmpDirectiveSpecification in ALLOCATE (#165865)Krzysztof Parzyszek
The ALLOCATE directive has two forms: - A declarative form with a standalone directive: ``` !$OMP ALLOCATE (variable-list-item...) ``` - An executable form that consists of several directives followed by an ALLOCATE statement: ``` !$OMP ALLOCATE (variable-list-item...) !$OMP ALLOCATE (variable-list-item...) ... ALLOCATE (...) ``` The second form was deprecated in OpenMP 5.2 in favor of the ALLOCATORS construct. Since in the parse tree every type corresponding to a directive only corresponds to a single directive, the executable form is represented by a sequence of nested OmpAllocateDirectives, e.g. ``` !$OMP ALLOCATE(x) !$OMP ALLOCATE(y) ALLOCATE(x, y) ``` will become ``` OmpAllocateDirective |- ALLOCATE(x) // begin directive `- OmpAllocateDirective // block |- ALLOCATE(y) // begin directive `- ALLOCATE(x, y) // block ``` With this change all AST nodes for directives use OmpDirectiveSpecification as the directive representation.
2025-10-28[flang][OpenMP] Implement OpenMP stylized expressions (#165049)Krzysztof Parzyszek
Consider OpenMP stylized expression to be a template to be instantiated with a series of types listed on the containing directive (currently DECLARE_REDUCTION). Create a series of instantiations in the parser, allowing OpenMP special variables to be declared separately for each type. --------- Co-authored-by: Tom Eccles <tom.eccles@arm.com>
2025-09-12[flang][OpenMP] Turn IsStrictlyStructuredBlock into utility function,… ↵Krzysztof Parzyszek
(#158111) … NFC
2025-08-20[flang][OpenMP] Update GetOmpObjectList, move to parser utils (#154389)Krzysztof Parzyszek
`GetOmpObjectList` takes a clause, and returns the pointer to the contained OmpObjectList, or nullptr if the clause does not contain one. Some clauses with object list were not recognized: handle all clauses, and move the implementation to flang/Parser/openmp-utils.cpp.