public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Kewen.Lin" <linkw@linux.ibm.com>
To: Segher Boessenkool <segher@kernel.crashing.org>,
	will schmidt <will_schmidt@vnet.ibm.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,
	Peter Bergner <bergner@linux.ibm.com>,
	Bill Schmidt <wschmidt@linux.ibm.com>,
	David Edelsohn <dje.gcc@gmail.com>
Subject: Re: [PATCH] rs6000/test: Adjust p9-vec-length-7 sensitive to unroll [PR103196]
Date: Fri, 8 Apr 2022 15:25:51 +0800	[thread overview]
Message-ID: <d6f09e80-a883-8c2d-9c82-811a03523e52@linux.ibm.com> (raw)
In-Reply-To: <20220407192945.GO614@gate.crashing.org>

Hi!

on 2022/4/8 3:29 AM, Segher Boessenkool wrote:
> Hi!
> 
> On Thu, Apr 07, 2022 at 09:19:51AM -0500, will schmidt wrote:
>> On Mon, 2022-02-28 at 13:37 +0800, Kewen.Lin via Gcc-patches wrote:
>>> As PR103196 shows, p9-vec-length-full-7.c needs to be adjusted as the
>>> complete unrolling can happen on some of its loops.  This patch is to
>>> use pragma "GCC unroll 0" to disable all possible loop unrollings.
>>> Hope it can help the case not that fragile.
>>
>> ok
>>
>> Is the lack of effectiveness of "-fno-unroll-loops" otherwise
>> understood, or is there further issue behind that option? 
> 
> There is -fpeel-loops as well, and cunroll is independent of all of
> these as well?
> 

Yes, kind of.  As below code, unroll-loops and peel-loops only affect
whether it's acceptable to grow size.

  /* Allow cunroll to grow size accordingly.  */
  if (!opts_set->x_flag_cunroll_grow_size)
    opts->x_flag_cunroll_grow_size
      = (opts->x_flag_unroll_loops
         || opts->x_flag_peel_loops
         || opts->x_optimize >= 3);

This flag_cunroll_grow_size doesn't gate the pass, it's only for
"may_increase_size".

  unsigned int val = tree_unroll_loops_completely (flag_cunroll_grow_size, 
						   true);

The cunroll still can take effect if its transformation doesn't grow
size even if we specify -fno-unroll-loops and -fno-peel-loops.

>> I would
>> expect the effect of the option, versus the pragma, two to roughly
>> equivalent.   Obviously it is not.  :-)
> 
> Yes, me too.  And I do not see what makes the difference, if it isn't
> the peel thing :-(
> 
> Ke Wen, can you try with -fno-peel-loops please?
> 

I had a try and it didn't help as the cunroll pass doesn't grow size
for this case.  By the way, -fdisable-tree-cunroll does work.  But I
thought using pragma looks better as it's not an internal thing like
the disabling option and I also expect other future unrolling related
changes would respect it.

Do you also prefer pragma, or want that disabling option?

BR,
Kewen

  reply	other threads:[~2022-04-08  7:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-28  5:37 Kewen.Lin
2022-03-15 11:36 ` PING^1 " Kewen.Lin
2022-04-07 10:29   ` PING^2 " Kewen.Lin
2022-04-07 14:19 ` will schmidt
2022-04-07 19:29   ` Segher Boessenkool
2022-04-08  7:25     ` Kewen.Lin [this message]
2022-04-08 14:34       ` Segher Boessenkool
2022-04-11  3:24         ` [PATCH v2, pushed] rs6000/test: Adjust p9-vec-length-{full, epil}-7.c [PR103196] Kewen.Lin
2022-04-08  7:59   ` [PATCH] rs6000/test: Adjust p9-vec-length-7 sensitive to unroll [PR103196] Kewen.Lin

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=d6f09e80-a883-8c2d-9c82-811a03523e52@linux.ibm.com \
    --to=linkw@linux.ibm.com \
    --cc=bergner@linux.ibm.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=segher@kernel.crashing.org \
    --cc=will_schmidt@vnet.ibm.com \
    --cc=wschmidt@linux.ibm.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).