From: Jakub Jelinek <jakub@redhat.com>
To: Sandra Loosemore <sandra@codesourcery.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH V2 1/5] OpenMP: Add OMP_STRUCTURED_BLOCK and GIMPLE_OMP_STRUCTURED_BLOCK.
Date: Tue, 22 Aug 2023 15:01:54 +0200 [thread overview]
Message-ID: <ZOSxwtaCJDU94val@tucnak> (raw)
In-Reply-To: <20230723221521.3739463-2-sandra@codesourcery.com>
On Sun, Jul 23, 2023 at 04:15:17PM -0600, Sandra Loosemore wrote:
> In order to detect invalid jumps in and out of intervening code in
> imperfectly-nested loops, the front ends need to insert some sort of
> marker to identify the structured block sequences that they push into
> the inner body of the loop. The error checking happens in the
> diagnose_omp_blocks pass, between gimplification and OMP lowering, so
> we need both GENERIC and GIMPLE representations of these markers.
> They are removed in OMP lowering so no subsequent passes need to know
> about them.
>
> This patch doesn't include any front-end changes to generate the new
> data structures.
>
> gcc/cp/ChangeLog
> * constexpr.cc (cxx_eval_constant_expression): Handle
> OMP_STRUCTURED_BLOCK.
> * pt.cc (tsubst_expr): Likewise.
>
> gcc/ChangeLog
> * doc/generic.texi (OpenMP): Document OMP_STRUCTURED_BLOCK.
> * doc/gimple.texi (GIMPLE instruction set): Add
> GIMPLE_OMP_STRUCTURED_BLOCK.
> (GIMPLE_OMP_STRUCTURED_BLOCK): New subsection.
> * gimple-low.cc (lower_stmt): Error on GIMPLE_OMP_STRUCTURED_BLOCK.
> * gimple-pretty-print.cc (dump_gimple_omp_block): Handle
> GIMPLE_OMP_STRUCTURED_BLOCK.
> (pp_gimple_stmt_1): Likewise.
> * gimple-walk.cc (walk_gimple_stmt): Likewise.
> * gimple.cc (gimple_build_omp_structured_block): New.
> * gimple.def (GIMPLE_OMP_STRUCTURED_BLOCK): New.
> * gimple.h (gimple_build_omp_structured_block): Declare.
> (gimple_has_substatements): Handle GIMPLE_OMP_STRUCTURED_BLOCK.
> (CASE_GIMPLE_OMP): Likewise.
> * gimplify.cc (is_gimple_stmt): Handle OMP_STRUCTURED_BLOCK.
> (gimplify_expr): Likewise.
> * omp-expand.cc (GIMPLE_OMP_STRUCTURED_BLOCK): Error on
> GIMPLE_OMP_STRUCTURED_BLOCK.
> * omp-low.cc (scan_omp_1_stmt): Handle GIMPLE_OMP_STRUCTURED_BLOCK.
> (lower_omp_1): Likewise.
> (diagnose_sb_1): Likewise.
> (diagnose_sb_2): Likewise.
> * tree-inline.cc (remap_gimple_stmt): Handle
> GIMPLE_OMP_STRUCTURED_BLOCK.
> (estimate_num_insns): Likewise.
> * tree-nested.cc (convert_nonlocal_reference_stmt): Likewise.
> (convert_local_reference_stmt): Likewise.
> (convert_gimple_call): Likewise.
> * tree-pretty-print.cc (dump_generic_node): Handle
> OMP_STRUCTURED_BLOCK.
> * tree.def (OMP_STRUCTURED_BLOCK): New.
> * tree.h (OMP_STRUCTURED_BLOCK_BODY): New.
> --- a/gcc/gimple-low.cc
> +++ b/gcc/gimple-low.cc
> @@ -717,6 +717,11 @@ lower_stmt (gimple_stmt_iterator *gsi, struct lower_data *data)
> gsi_next (gsi);
> return;
>
> + case GIMPLE_OMP_STRUCTURED_BLOCK:
> + /* These are supposed to be removed already in OMP lowering. */
> + gcc_unreachable ();
> + break;
Please don't add break; after gcc_unreachable ();
> --- a/gcc/omp-expand.cc
> +++ b/gcc/omp-expand.cc
> @@ -10592,6 +10592,11 @@ expand_omp (struct omp_region *region)
> parent GIMPLE_OMP_SECTIONS region. */
> break;
>
> + case GIMPLE_OMP_STRUCTURED_BLOCK:
> + /* We should have gotten rid of these in gimple lowering. */
> + gcc_unreachable ();
> + break;
And here neither.
Otherwise LGTM.
Jakub
next prev parent reply other threads:[~2023-08-22 13:02 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-23 22:15 [PATCH V2 0/5] OpenMP: support for imperfectly-nested loops Sandra Loosemore
2023-07-23 22:15 ` [PATCH V2 1/5] OpenMP: Add OMP_STRUCTURED_BLOCK and GIMPLE_OMP_STRUCTURED_BLOCK Sandra Loosemore
2023-08-22 13:01 ` Jakub Jelinek [this message]
2023-07-23 22:15 ` [PATCH V2 2/5] OpenMP: C front end support for imperfectly-nested loops Sandra Loosemore
2023-08-22 13:23 ` Jakub Jelinek
2023-08-22 18:53 ` Sandra Loosemore
2023-08-24 11:49 ` Jakub Jelinek
2023-07-23 22:15 ` [PATCH V2 3/5] OpenMP: C++ " Sandra Loosemore
2023-08-22 13:31 ` Jakub Jelinek
2023-07-23 22:15 ` [PATCH V2 4/5] OpenMP: New C/C++ testcases for imperfectly nested loops Sandra Loosemore
2023-08-22 13:34 ` Jakub Jelinek
2023-07-23 22:15 ` [PATCH V2 5/5] OpenMP: Fortran support for imperfectly-nested loops Sandra Loosemore
2023-08-22 13:37 ` Jakub Jelinek
2023-08-24 16:36 ` Tobias Burnus
2023-08-22 12:56 ` [PATCH V2 0/5] OpenMP: " Jakub Jelinek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZOSxwtaCJDU94val@tucnak \
--to=jakub@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=sandra@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).