public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Cui, Lili" <lili.cui@intel.com>
To: Richard Biener <richard.guenther@gmail.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: RE: [PATCH] Fix ICE in rewrite_expr_tree_parallel
Date: Wed, 31 May 2023 07:56:30 +0000	[thread overview]
Message-ID: <PH0PR11MB55936C2CFCA4F7DCDDB1C4899E489@PH0PR11MB5593.namprd11.prod.outlook.com> (raw)
In-Reply-To: <CAFiYyc2q38iEKVM9AWAjzeNS_WD3Z0uYhagcK6vYWAuAMw7Wuw@mail.gmail.com>

Committed, thanks Richard.

Lili.

> -----Original Message-----
> From: Richard Biener <richard.guenther@gmail.com>
> Sent: Wednesday, May 31, 2023 3:22 PM
> To: Cui, Lili <lili.cui@intel.com>
> Cc: gcc-patches@gcc.gnu.org
> Subject: Re: [PATCH] Fix ICE in rewrite_expr_tree_parallel
> 
> On Wed, May 31, 2023 at 3:35 AM Cui, Lili <lili.cui@intel.com> wrote:
> >
> > Hi,
> >
> > This patch is to fix ICE in rewrite_expr_tree_parallel.
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110038
> >
> > Bootstrapped and regtested. Ok for trunk?
> 
> OK.
> 
> > Regards
> > Lili.
> >
> > 1. Limit the value of tree-reassoc-width to IntegerRange(0, 256).
> > 2. Add width limit in rewrite_expr_tree_parallel.
> >
> > gcc/ChangeLog:
> >
> >         PR tree-optimization/110038
> >         * params.opt: Add a limit on tree-reassoc-width.
> >         * tree-ssa-reassoc.cc
> >         (rewrite_expr_tree_parallel): Add width limit.
> >
> > gcc/testsuite/ChangeLog:
> >
> >         PR tree-optimization/110038
> >         * gcc.dg/pr110038.c: New test.
> > ---
> >  gcc/params.opt                  |  2 +-
> >  gcc/testsuite/gcc.dg/pr110038.c | 10 ++++++++++
> >  gcc/tree-ssa-reassoc.cc         |  3 +++
> >  3 files changed, 14 insertions(+), 1 deletion(-)  create mode 100644
> > gcc/testsuite/gcc.dg/pr110038.c
> >
> > diff --git a/gcc/params.opt b/gcc/params.opt index
> > 66f1c99036a..70cfb495e3a 100644
> > --- a/gcc/params.opt
> > +++ b/gcc/params.opt
> > @@ -1091,7 +1091,7 @@ Common Joined UInteger
> > Var(param_tracer_min_branch_ratio) Init(10) IntegerRange(  Stop reverse
> growth if the reverse probability of best edge is less than this threshold (in
> percent).
> >
> >  -param=tree-reassoc-width=
> > -Common Joined UInteger Var(param_tree_reassoc_width) Param
> > Optimization
> > +Common Joined UInteger Var(param_tree_reassoc_width) IntegerRange(0,
> > +256) Param Optimization
> >  Set the maximum number of instructions executed in parallel in
> reassociated tree.  If 0, use the target dependent heuristic.
> >
> >  -param=tsan-distinguish-volatile=
> > diff --git a/gcc/testsuite/gcc.dg/pr110038.c
> > b/gcc/testsuite/gcc.dg/pr110038.c new file mode 100644 index
> > 00000000000..0f578b182ca
> > --- /dev/null
> > +++ b/gcc/testsuite/gcc.dg/pr110038.c
> > @@ -0,0 +1,10 @@
> > +/* { dg-do compile } */
> > +/* { dg-options "-O --param=tree-reassoc-width=256" } */
> > +
> > +unsigned a, b;
> > +
> > +void
> > +foo (unsigned c)
> > +{
> > +  a += b + c + 1;
> > +}
> > diff --git a/gcc/tree-ssa-reassoc.cc b/gcc/tree-ssa-reassoc.cc index
> > ad2f528ff07..f8055d59d57 100644
> > --- a/gcc/tree-ssa-reassoc.cc
> > +++ b/gcc/tree-ssa-reassoc.cc
> > @@ -5510,6 +5510,9 @@ rewrite_expr_tree_parallel (gassign *stmt, int
> width, bool has_fma,
> >    for (i = stmt_num - 2; i >= 0; i--)
> >      stmts[i] = SSA_NAME_DEF_STMT (gimple_assign_rhs1 (stmts[i+1]));
> >
> > +   /* Width should not be larger than op_num/2.  */
> > +   width = width <= op_num / 2 ? width : op_num / 2;
> > +
> >    /* Build parallel dependency chain according to width.  */
> >    for (i = 0; i < width; i++)
> >      {
> > --
> > 2.25.1
> >

      reply	other threads:[~2023-05-31  7:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-31  1:35 Cui, Lili
2023-05-31  7:21 ` Richard Biener
2023-05-31  7:56   ` Cui, Lili [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=PH0PR11MB55936C2CFCA4F7DCDDB1C4899E489@PH0PR11MB5593.namprd11.prod.outlook.com \
    --to=lili.cui@intel.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.guenther@gmail.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).