aboutsummaryrefslogtreecommitdiff
path: root/gcc/c/c-parser.cc
diff options
context:
space:
mode:
authorSandra Loosemore <sloosemore@baylibre.com>2024-12-26 18:15:56 +0000
committerSandra Loosemore <sloosemore@baylibre.com>2025-01-14 16:29:27 +0000
commit210a090e33ec4b51248077b701d432d36ef43fb3 (patch)
tree1ef25cbf7142679c9afc3cc4a6313cfd1db148da /gcc/c/c-parser.cc
parent22fe3c05d86b52c35850918bfb21e1f597e1b5c7 (diff)
downloadgcc-210a090e33ec4b51248077b701d432d36ef43fb3.zip
gcc-210a090e33ec4b51248077b701d432d36ef43fb3.tar.gz
gcc-210a090e33ec4b51248077b701d432d36ef43fb3.tar.bz2
OpenMP: New tree nodes for metadirective and dynamic selector support.
This patch adds basic support for three new tree node types that will be used in subsequent patches to support OpenMP metadirectives and dynamic selectors. OMP_METADIRECTIVE is the internal representation of parsed OpenMP metadirective constructs. It's produced by the front ends and is expanded during gimplification. OMP_NEXT_VARIANT is used as a "magic cookie" for late resolution of variant constructs that cannot be fully resolved during gimplification, used to set the controlling variable of a switch statement that branches to the next alternative once the candidate list can be filtered and sorted. These nodes are expanded into constants in the ompdevlow pass. In some gimple passes, they need to be treated as constants. OMP_TARGET_DEVICE_MATCHES is a similar "magic cookie" used to resolve the target_device dynamic selector. It is wrapped in an OpenMP target construct, and can be resolved to a constant in the ompdevlow pass. gcc/ChangeLog: * doc/generic.texi (OpenMP): Document OMP_METADIRECTIVE, OMP_NEXT_VARIANT, and OMP_TARGET_DEVICE_MATCHES. * fold-const.cc (operand_compare::hash_operand): Ignore the new nodes. * gimple-expr.cc (is_gimple_val): Allow OMP_NEXT_VARIANT and OMP_TARGET_DEVICE_MATCHES. * gimple.cc (get_gimple_rhs_num_ops): OMP_NEXT_VARIANT and OMP_TARGET_DEVICE_MATCHES are both GIMPLE_SINGLE_RHS. * tree-cfg.cc (tree_node_can_be_shared): Allow sharing of OMP_NEXT_VARIANT. * tree-inline.cc (remap_gimple_op_r): Ignore subtrees of OMP_NEXT_VARIANT. * tree-pretty-print.cc (dump_generic_node): Handle OMP_METADIRECTIVE, OMP_NEXT_VARIANT, and OMP_TARGET_DEVICE_MATCHES. * tree-ssa-operands.cc (operands_scanner::get_expr_operands): Ignore operands of OMP_NEXT_VARIANT and OMP_TARGET_DEVICE_MATCHES. * tree.def (OMP_METADIRECTIVE): New. (OMP_NEXT_VARIANT): New. (OMP_TARGET_DEVICE_MATCHES): New. * tree.h (OMP_METADIRECTIVE_VARIANTS): New. (OMP_METADIRECTIVE_VARIANT_SELECTOR): New. (OMP_METADIRECTIVE_VARIANT_DIRECTIVE): New. (OMP_METADIRECTIVE_VARIANT_BODY): New. (OMP_NEXT_VARIANT_INDEX): New. (OMP_NEXT_VARIANT_STATE): New. (OMP_TARGET_DEVICE_MATCHES_SELECTOR): New. (OMP_TARGET_DEVICE_MATCHES_PROPERTIES): New. Co-Authored-By: Kwok Cheung Yeung <kcy@codesourcery.com> Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com>
Diffstat (limited to 'gcc/c/c-parser.cc')
0 files changed, 0 insertions, 0 deletions