]> git.ipfire.org Git - thirdparty/gcc.git/commit
openmp: Add support for resolving metadirectives during parsing and Gimplification
authorKwok Cheung Yeung <kcy@codesourcery.com>
Tue, 25 Jan 2022 18:42:50 +0000 (10:42 -0800)
committerKwok Cheung Yeung <kcy@codesourcery.com>
Tue, 25 Jan 2022 20:05:02 +0000 (12:05 -0800)
commit7e672d2ba146ca55dfffc36b198fbb3f3200f8f2
treecc5f6216b89d464697c807c5f22d538608594bf9
parenta238b6934b62ce3e8342047e41840c804d83b59d
openmp: Add support for resolving metadirectives during parsing and Gimplification

This adds support for resolving metadirectives according to the OpenMP 5.1
specification.  The variants are sorted by score, then gathered into a list
of dynamic replacement candidates.  The metadirective is then expanded into
a sequence of 'if..else' statements to test the dynamic selector and execute
the variant if the selector is satisfied.

If any of the selectors in the list are unresolvable, GCC will give up on
resolving the metadirective and try again later.

2022-01-25  Kwok Cheung Yeung  <kcy@codesourcery.com>

gcc/
* gimplify.c (expand_omp_metadirective): New.
* omp-general.c: Include tree-pretty-print.h.
(DELAY_METADIRECTIVES_AFTER_LTO): New macro.
(omp_context_selector_matches): Delay resolution of selectors.  Allow
non-constant expressions.
(omp_dynamic_cond): New.
(omp_dynamic_selector_p): New.
(sort_variant): New.
(omp_get_dynamic_candidates): New.
(omp_resolve_metadirective): New.
(omp_resolve_metadirective): New.
* omp-general.h (struct omp_metadirective_variant): New.
(omp_resolve_metadirective): New prototype.

gcc/c-family/
* c-omp.c (c_omp_expand_metadirective_r): New.
(c_omp_expand_metadirective): New.
gcc/ChangeLog.omp
gcc/c-family/ChangeLog.omp
gcc/c-family/c-omp.c
gcc/gimplify.c
gcc/omp-general.c
gcc/omp-general.h