diff options
author | Sergio Afonso <safonsof@amd.com> | 2025-01-14 13:55:17 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-14 13:55:17 +0000 |
commit | 8fe11a26ae8f12622ddec83a7b80637080843a8b (patch) | |
tree | 7268407d06fea1acd676394fca0a585408b29781 /flang/lib/Frontend/CompilerInvocation.cpp | |
parent | d8d30a96031bfdad3e2c424e14a4247c14980cb5 (diff) | |
download | llvm-8fe11a26ae8f12622ddec83a7b80637080843a8b.zip llvm-8fe11a26ae8f12622ddec83a7b80637080843a8b.tar.gz llvm-8fe11a26ae8f12622ddec83a7b80637080843a8b.tar.bz2 |
[Flang][OpenMP] Lowering of host-evaluated clauses (#116219)
This patch adds support for lowering OpenMP clauses and expressions
attached to constructs nested inside of a target region that need to be
evaluated in the host device. This is done through the use of the
`OpenMP_HostEvalClause` `omp.target` set of operands and entry block
arguments.
When lowering clauses for a target construct, a more involved
`processHostEvalClauses()` function is called, which looks at the
current and potentially other nested constructs in order to find and
lower clauses that need to be processed outside of the `omp.target`
operation under construction. This populates an instance of a global
structure with the resulting MLIR values.
The resulting list of host-evaluated values is used to initialize the
`host_eval` operands when constructing the `omp.target` operation, and
then replaced with the corresponding block arguments after creating that
operation's region.
Afterwards, while lowering nested operations, those that might
potentially be evaluated on the host (i.e. `num_teams`, `thread_limit`,
`num_threads` and `collapse`) check first whether there is an active
global host-evaluated information structure and whether it holds values
referring to these clauses. If that is the case, the stored values
(`omp.target` entry block arguments at that stage) are used instead of
lowering these clauses again.
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions