public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Sandra Loosemore <sandra@codesourcery.com>
Cc: "fortran@gcc.gnu.org" <fortran@gcc.gnu.org>,
	"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH, stage 1] Fortran: Add support for OMP non-rectangular loops
Date: Wed, 4 May 2022 14:33:13 +0200	[thread overview]
Message-ID: <YnJyiQaJEAvcLGMb@tucnak> (raw)
In-Reply-To: <09c4c519-3121-015c-0f22-894135506e21@codesourcery.com>

On Fri, Mar 25, 2022 at 08:03:38PM -0600, Sandra Loosemore wrote:
>     This patch adds support for OMP 5.1 "canonical loop nest form" to the
>     Fortran front end, marks non-rectangular loops for processing
>     by the middle end, and implements missing checks in the gimplifier
>     for additional prohibitions on non-rectangular loops.
>     
>     Note that the OMP spec also prohibits non-rectangular loops with the TILE
>     construct; that construct hasn't been implemented yet, so that error will
>     need to be filled in later.
>     
>     	gcc/fortran/
>     	* gfortran.h (struct gfc_omp_clauses): Add non_rectangular bit.
>     	* openmp.cc (is_outer_iteration_variable): New function.
>     	(expr_is_invariant): New function.
>     	(bound_expr_is_canonical): New function.
>     	(resolve_omp_do): Replace existing non-rectangularity error with
>     	check for canonical form and setting non_rectangular bit.
>     	* trans-openmp.cc (gfc_trans_omp_do): Transfer non_rectangular
>     	flag to generated tree structure.
>     
>     	gcc/
>     	* gimplify.cc (gimplify_omp_for): Update messages for SCHEDULED
>     	and ORDERED clause conflict errors.  Add check for GRAINSIZE and
>     	NUM_TASKS on TASKLOOP.
>     
>     	gcc/testsuite/
>     	* c-c++-common/gomp/loop-6.c (f3): New function to test TASKLOOP
>     	diagnostics.
>     	* gfortran.dg/gomp/collapse1.f90: Update expected messages.
>     	* gfortran.dg/gomp/pr85313.f90: Remove dg-error on non-rectangular
>     	loops that are now accepted.
>     	* gfortran.dg/gomp/non-rectangular-loop.f90: New file.
>     	* gfortran.dg/gomp/canonical-loop-1.f90: New file.
>     	* gfortran.dg/gomp/canonical-loop-2.f90: New file.
> 
> --- a/gcc/gimplify.cc
> +++ b/gcc/gimplify.cc
> @@ -12468,11 +12468,11 @@ gimplify_omp_for (tree *expr_p, gimple_seq *pre_p)
>  			       OMP_CLAUSE_SCHEDULE))
>  	    error_at (EXPR_LOCATION (for_stmt),
>  		      "%qs clause may not appear on non-rectangular %qs",
> -		      "schedule", "for");
> +		      "schedule", (lang_GNU_Fortran () ? "do" : "for"));
>  	  if (omp_find_clause (OMP_FOR_CLAUSES (for_stmt), OMP_CLAUSE_ORDERED))
>  	    error_at (EXPR_LOCATION (for_stmt),
>  		      "%qs clause may not appear on non-rectangular %qs",
> -		      "ordered", "for");
> +		      "ordered", (lang_GNU_Fortran () ? "do" : "for"));

Please drop the superfluous ()s around the argument, just use
		      "...", lang_GNU_Fortran () ? "do" : "for");

Ok for trunk with that nit fixed.  And thanks for discovering the missing
grainsize/num_tasks checks.

	Jakub


      reply	other threads:[~2022-05-04 12:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-26  2:03 Sandra Loosemore
2022-05-04 12:33 ` Jakub Jelinek [this message]

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=YnJyiQaJEAvcLGMb@tucnak \
    --to=jakub@redhat.com \
    --cc=fortran@gcc.gnu.org \
    --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).