aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/OpenMPKinds.cpp
AgeCommit message (Collapse)AuthorFilesLines
2025-09-29[Clang][OpenMP][LoopTransformations] Implement "#pragma omp fuse" loop ↵Walter J.T.V1-2/+9
transformation directive and "looprange" clause (#139293) This change implements the fuse directive, `#pragma omp fuse`, as specified in the OpenMP 6.0, along with the `looprange` clause in clang. This change also adds minimal stubs so flang keeps compiling (a full implementation in flang of this directive is still pending). --------- Co-authored-by: Roger Ferrer Ibanez <roger.ferrer@bsc.es>
2025-09-25[NFC][Clang][OpenMP] Add helper functions/utils for finding/comparing attach ↵Abhinav Gaba1-0/+5
base-ptrs. (#155625) These have been pulled out of the codegen PR #153683, to reduce the size of that PR.
2025-09-18[clang] [OpenMP] New OpenMP 6.0 - Parsing and Sema support for groupprivate ↵Ritanya-B-Bharadwaj1-0/+2
(#158134)
2025-09-16[clang][OpenMP] 6.0: Add defaultmap implicit-behavior 'private' (#158712)David Pagan1-1/+2
Per OpenMP 6.0 specification, section 7.9.9 Argument keywords, page 291, L17 Semantics, page 292, L15-16 The behavior of 'private' should be described in the same manner as that of 'firstprivate' 15 ... If implicit-behavior is firstprivate, 16 the attribute is a data-sharing attribute of firstprivate. Relevant OpenMP 6.0 issues defaultmap clause new implicit-behavior 'private' should be documented https://github.com/OpenMP/spec/issues/4571 Issue 4571: Add missing sentence about private to defaultmap https://github.com/OpenMP/spec/pull/4577 Testing: Updated 'defaultmap' error message and codegen LIT tests to verify behavior of 'private' in OpenMP 6.0.
2025-09-15[clang][OpenMP] 6.0: Add defaultmap implicit-behavior 'storage' (#158336)David Pagan1-3/+7
First of two patches split from original defaultmap PR: https://github.com/llvm/llvm-project/pull/157767 Per OpenMP 6.0 specification, section 7.9.9 Argument keywords, page 291, L17 Additional information, page 291, L24-25 24 The value alloc may also be specified as implicit-behavior with identical meaning to the value 25 storage. Testing: Updated 'defaultmap' error message and codegen LIT tests to verify behavior in OpenMP 6.0.
2025-09-15[Clang][OpenMP]Default clause variable category (#157063)SunilKuravinakop1-1/+20
Support for Variable Category in Default Clause. --------- Co-authored-by: Sunil Kuravinakop <kuravina@pe31.hpc.amslabs.hpecorp.net>
2025-09-08[Clang][NFC] Rename OMPLoopTransformationDirective to ↵Roger Ferrer Ibáñez1-1/+7
OMPCanonicalLoopNestTransformationDirective (#155848) This is preparatory work for the implementation of `#pragma omp fuse` in https://github.com/llvm/llvm-project/pull/139293 Not all OpenMP loop transformations makes sense to make them inherit from `OMPLoopBasedDirective`, in particular in OpenMP 6.0 'fuse' (to be implemented later) is a transformation of a canonical loop sequence. This change renames class `OMPLoopTransformationDirective` to `OMPCanonicalLoopNestTransformationDirective` so we can reclaim that name in a later change.
2025-07-15[clang][NFC] Updated incorrect llvm-unreachable message in ↵David Pagan1-1/+1
getOpenMPSimpleClauseType() (#148056)
2025-06-24[OpenMP][clang] 6.0: parsing/sema for num_threads 'strict' modifier (#145490)Robert Imschweiler1-2/+19
Implement parsing and semantic analysis support for the optional 'strict' modifier of the num_threads clause. This modifier has been introduced in OpenMP 6.0, section 12.1.2. Note: this is basically 1:1 https://reviews.llvm.org/D138328.
2025-05-09[clang][OpenMP] Pass OpenMP version to getOpenMPDirectiveName (#139115)Krzysztof Parzyszek1-1/+2
The OpenMP version is stored in language options in ASTContext. If the context is not available, use the fallback version. RFC: https://discourse.llvm.org/t/rfc-alternative-spellings-of-openmp-directives/85507
2025-04-18[clang][OpenMP] Fix/enforce order-concurrent-nestable rules (#135463)Ernesto Su1-3/+14
OpenMP has restrictions on directives allowed to be strictly nested inside a construct with the order(concurrent) clause specified. - OpenMP 5.0, 5.1, and 5.2 allows: 'loop', 'parallel', 'simd', and combined directives starting with 'parallel'. - OpenMP 6.0 allows: the above directives plus 'atomic' and all loop-transformation directives. Furthermore, a region that corresponds to a construct with order(concurrent) specified may not contain calls to the OpenMP runtime API. This PR fixes the following issues in the current implementation: With -fopenmp-version=50: none of the nesting restrictions above were enforced With -fopenmp-version=60: 1. Clang did not reject OpenMP runtime APIs encountered in the region. 2. Clang erroneously rejected combined directives starting with parallel. --------- Co-authored-by: Zahira Ammarguellat <zahira.ammarguellat@intel.com>
2025-03-11[clang] [OpenMP] New OpenMP 6.0 self_maps clause (#129888)Ritanya-B-Bharadwaj1-0/+2
Initial parsing/sema support for self maps in map and requirement clause [Sections 7.9.6 and 10.5.1.6 in OpenMP 6.0 spec]
2025-02-13[Clang] [OpenMP] Add support for '#pragma omp stripe'. (#126927)Zahira Ammarguellat1-1/+2
This patch was reviewed and approved here: https://github.com/llvm/llvm-project/pull/119891 However it has been reverted here: https://github.com/alejandro-alvarez-sonarsource/llvm-project/commit/083df25dc256154cccbc0e127d79fbac4d0583c5 due to a build issue here: https://lab.llvm.org/buildbot/#/builders/51/builds/10694 This patch is reintroducing the support.
2025-02-11Revert "[Clang] [OpenMP] Add support for '#pragma omp stripe'. (#119891)"Kazu Hirata1-2/+1
This reverts commit 070f84ebc89b11df616a83a56df9ac56efbab783. Buildbot failure: https://lab.llvm.org/buildbot/#/builders/51/builds/10694
2025-02-11[Clang] [OpenMP] Add support for '#pragma omp stripe'. (#119891)Zahira Ammarguellat1-1/+2
Implement basic parsing and semantic support for `#pragma omp stripe` constuct introduced in https://www.openmp.org/wp-content/uploads/[OpenMP-API-Specification-6-0.pdf](https://www.openmp.org/wp-content/uploads/OpenMP-API-Specification-6-0.pdf), section 11.7.
2025-02-05[clang][OpenMP] OpenMP 6.0 updates to restrictions with order/concurrent ↵David Pagan1-0/+6
(#125621) From OpenMP 6.0 features list - OpenMP directives in concurrent loop regions - atomics constructs on concurrent loop regions - Lift nesting restriction on concurrent loop Testing - Updated test/OpenMP/for_order_messages.cpp - check-all
2024-11-05[clang][OpenMP] Add 'allocator' modifier for 'allocate' clause. (#114883)David Pagan1-2/+15
The 'allocator' modifier is now accepted in the 'allocate' clause. Added LIT tests covering codegen, PCH, template handling, and serialization for 'allocator' modifier. Added support for allocator-modifier to release notes. Testing - New allocate modifier LIT tests. - OpenMP LIT tests. - check-all - relevant sollve_vv test cases tests/5.2/scope/test_scope_allocate_construct.c
2024-10-09[Clang][OpenMP] Add permutation clause (#92030)Michael Kruse1-0/+2
Add the permutation clause for the interchange directive which will be introduced in the upcoming OpenMP 6.0 specification. A preview has been published in [Technical Report12](https://www.openmp.org/wp-content/uploads/openmp-TR12.pdf).
2024-09-02[clang][OpenMP] `masked` and `master` are not capturing (#106787)Krzysztof Parzyszek1-2/+3
2024-08-05[OpenMP] OpenMP 5.1 "assume" directive parsing support (#92731)Julian Brown1-0/+8
This is a minimal patch to support parsing for "omp assume" directives. These are meant to be hints to a compiler's optimisers: as such, it is legitimate (if not very useful) to ignore them. The patch builds on top of the existing support for "omp assumes" directives (note spelling!). Unlike the "omp [begin/end] assumes" directives, "omp assume" is associated with a compound statement, i.e. it can appear within a function. The "holds" assumption could (theoretically) be mapped onto the existing builtin "__builtin_assume", though the latter applies to a single point in the program, and the former to a range (i.e. the whole of the associated compound statement). This patch fixes sollve's OpenMP 5.1 "omp assume"-based tests.
2024-07-19[Clang][OpenMP] Add interchange directive (#93022)Michael Kruse1-1/+2
Add the interchange directive which will be introduced in the upcoming OpenMP 6.0 specification. A preview has been published in [Technical Report 12](https://www.openmp.org/wp-content/uploads/openmp-TR12.pdf).
2024-07-18[Clang][OpenMP] Add reverse directive (#92916)Michael Kruse1-1/+1
Add the reverse directive which will be introduced in the upcoming OpenMP 6.0 specification. A preview has been published in [Technical Report 12](https://www.openmp.org/wp-content/uploads/openmp-TR12.pdf). --------- Co-authored-by: Alexey Bataev <a.bataev@outlook.com>
2024-07-02[clang][OpenMP] Rewrite `getOpenMPCaptureRegions` in terms of leafs (#97110)Krzysztof Parzyszek1-98/+78
Replace the switch in `getOpenMPCaptureRegions` with a loop collecting capture regions based on the constituent directives. --------- Co-authored-by: Alexey Bataev <a.bataev@outlook.com>
2024-07-01[clang][OpenMP] Implement `isOpenMPCapturingDirective` (#97090)Krzysztof Parzyszek1-31/+35
Check if the given directive can capture variables, and thus needs a captured statement. Simplify some code using this function.
2024-06-29[clang][OpenMP] Implement `isOpenMPExecutableDirective` (#97089)Krzysztof Parzyszek1-0/+7
What is considered "executable" in clang differs slightly from the OpenMP's "executable" category. In addition to the executable category, subsidiary directives, and OMPD_error are considered executable. Implement a function that performs that check.
2024-03-06[Frontend] Add leaf constructs and association to OpenMP/ACC directives (#83625)Krzysztof Parzyszek1-96/+33
Add members "leafConstructs" and "association" to .td describing OpenMP/ACC directives. The naming follows the terminology used in the OpenMP standard: a "leaf" construct is a construct that is itself not a composition or a combination of other constructs, and "association" is the source language construct to which the directive applies (e.g. loop, block, etc.) The tblgen-generated output then contains two additional functions - getLeafConstructs(D), and - getDirectiveAssociation(D) plus "enum class Association", all in namespaces "llvm::omp" and "llvm::acc". Note: getLeafConstructs returns an empty sequence for a construct that is itself a leaf construct. Use the new functions to simplify a few OpenMP-related functions in clang.
2023-11-26[OpenMP] atomic compare fail : Parser & AST supportSunil Kuravinakop1-0/+17
Diff Revision: https://reviews.llvm.org/D123235
2023-11-20Revert "[OpenMP] atomic compare fail : Parser & AST support"Krzysztof Parzyszek1-17/+0
This reverts commit edd675ac283909397880f85ba68d0d5f99dc1be2. This breaks clang build where every component is a shared library. The file clang/lib/Basic/OpenMPKinds.cpp, which is a part of libclangBasic.so, uses `getOpenMPClauseName` which isn't: /usr/bin/ld: CMakeFiles/obj.clangBasic.dir/OpenMPKinds.cpp.o: in functio n `clang ::getOpenMPSimpleClauseTypeName(llvm::omp::Clause, unsigned int )': OpenMPKinds.cpp:(.text._ZN5clang29getOpenMPSimpleClauseTypeNameEN4llvm3o mp6ClauseEj+0x9b): undefined reference to `llvm::omp::getOpenMPClauseNam e(llvm::omp::Clause)'
2023-11-20[OpenMP] atomic compare fail : Parser & AST supportSunil Kuravinakop1-0/+17
Diff Revision: https://reviews.llvm.org/D123235
2023-11-08Revert "[OpenMP] atomic compare fail : Parser & AST support"Mitch Phillips1-17/+0
This reverts commit 086b65340cca2648a2a91a0a47d28c7d9bafd1e5. Reason: Broke under -Werror. More details in https://reviews.llvm.org/D123235
2023-11-07[OpenMP] atomic compare fail : Parser & AST supportSunil Kuravinakop1-0/+17
This is a support for " #pragma omp atomic compare fail ". It has Parser & AST support for now. Reviewed By: tianshilei1992, ABataev Differential Revision: https://reviews.llvm.org/D123235
2023-08-26[OpenMP] Codegen support for thread_limit on target directive for hostSandeep Kosuri1-0/+7
offloading - This patch adds support for thread_limit clause on target directive according to OpenMP 51 [2.14.5] - The idea is to create an outer task for target region, when there is a thread_limit clause, and manipulate the thread_limit of task instead. This way, thread_limit will be applied to all the relevant constructs enclosed by the target region. Differential Revision: https://reviews.llvm.org/D152054
2023-08-24[OpenMP 5.1] Parsing and Sema support for `scope` directiveFazlay Rabbi1-0/+1
structured-block where clause is one of the following: private(list) reduction([reduction-modifier ,] reduction-identifier : list) nowait Differential Revision: https://reviews.llvm.org/D157933
2023-07-05[OpenMP][CodeGen] Add codegen for combined 'loop' directives.Dave Pagan1-7/+9
The loop directive is a descriptive construct which allows the compiler flexibility in how it generates code for the directive's associated loop(s). See OpenMP specification 5.2 [257:8-9]. Codegen added in this patch for the combined 'loop' directives are: 'target teams loop' -> 'target teams distribute parallel for' 'teams loop' -> 'teams distribute parallel for' 'target parallel loop' -> 'target parallel for' 'parallel loop' -> 'parallel for' NOTE: The implementation of the 'loop' directive itself is unchanged. Differential Revision: https://reviews.llvm.org/D145823
2023-06-29[OMP5.2] Initial support for doacross clause.Jennifer Yu1-0/+15
2022-12-12[OpenMP] Basic parse and sema support for modifiers in order clauseChi Chun Chen1-4/+19
This patch gives basic parsing and semantic support for "modifiers" of order clause introduced in OpenMP 5.1 ( section 2.11.3 ) Reviewed By: ABataev Differential Revision: https://reviews.llvm.org/D127855
2022-11-18[OpenMP] Initial parsing/sema for 'strict' modifier with 'num_tasks' clauseFazlay Rabbi1-2/+19
This patch gives basic parsing and semantic analysis support for 'strict' modifier with 'num_tasks' clause of 'taskloop' construct introduced in OpenMP 5.1 (section 2.12.2) Differential Revision: https://reviews.llvm.org/D138328
2022-11-17[OpenMP] Initial parsing/sema for 'strict' modifier with 'grainsize' clauseFazlay Rabbi1-2/+19
This patch gives basic parsing and semantic analysis support for 'strict' modifier with 'grainsize' clause of 'taskloop' construct introduced in OpenMP 5.1 (section 2.12.2) Differential Revision: https://reviews.llvm.org/D138217
2022-11-17[OPENMP5.1] Initial support for severity clauseJennifer Yu1-1/+15
Differential Revision:https://reviews.llvm.org/D138227
2022-11-15[OPENMP]Initial support for at clauseJennifer Yu1-0/+16
Error directive is allowed in both declared and executable contexts. The function ActOnOpenMPAtClause is called in both places during the parsers. Adding a param "bool InExContext" to identify context which is used to emit error massage. Differential Revision: https://reviews.llvm.org/D137851
2022-11-02[OPENMP]Initial support for error directive.Jennifer Yu1-0/+1
Differential Revision: https://reviews.llvm.org/D137209
2022-07-01[OpenMP] Initial parsing and semantic support for 'parallel masked taskloop ↵Fazlay Rabbi1-0/+5
simd' construct This patch gives basic parsing and semantic support for "parallel masked taskloop simd" construct introduced in OpenMP 5.1 (section 2.16.10) Differential Revision: https://reviews.llvm.org/D128946
2022-06-30[OpenMP] Initial parsing and sema support for 'parallel masked taskloop' ↵Fazlay Rabbi1-1/+5
construct This patch gives basic parsing and semantic support for "parallel masked taskloop" construct introduced in OpenMP 5.1 (section 2.16.9) Differential Revision: https://reviews.llvm.org/D128834
2022-06-28[OpenMP] Initial parsing and sema support for 'masked taskloop simd' constructFazlay Rabbi1-2/+4
This patch gives basic parsing and semantic support for "masked taskloop simd" construct introduced in OpenMP 5.1 (section 2.16.8) Differential Revision: https://reviews.llvm.org/D128693
2022-06-24[OpenMP] Initial parsing and sema support for 'masked taskloop' constructFazlay Rabbi1-0/+3
This patch gives basic parsing and semantic support for "masked taskloop" construct introduced in OpenMP 5.1 (section 2.16.7) Differential Revision: https://reviews.llvm.org/D128478
2022-06-16[OpenMP] Initial parsing and sema for 'parallel masked' constructJennifer Yu1-1/+2
Differential Revision: https://reviews.llvm.org/D127454
2022-05-25Revert "[OpenMP] atomic compare fail : Parser & AST support"Aaron Ballman1-14/+0
This reverts commit 232bf8189ef7d574a468bd5bfd1e84e962f7f16e. It broke the sanitize buildbot: https://lab.llvm.org/buildbot/#/builders/5/builds/24074 It also reproduces on Windows debug builds as a crash.
2022-05-24[Clang][OpenMP] Support for omp nothingSunil Kuravinakop1-0/+3
Patch to support "#pragma omp nothing" Reviewed By: tianshilei1992 Differential Revision: https://reviews.llvm.org/D123286
2022-05-24[OpenMP] atomic compare fail : Parser & AST supportSunil Kuravinakop1-0/+14
This is a support for " #pragma omp atomic compare fail ". It has Parser & AST support for now. Reviewed By: tianshilei1992 Differential Revision: https://reviews.llvm.org/D123235
2022-04-08[clang][OpenMP5.1] Initial parsing/sema for has_device_addrJennifer Yu1-0/+2
Added basic parsing/sema/ support for the 'has_device_addr' clause. Differential Revision: https://reviews.llvm.org/D123402