public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
To: Jan Hubicka <hubicka@ucw.cz>
Cc: rguenther@suse.cz, gcc-patches@gcc.gnu.org
Subject: Re: Fix profile update in scale_profile_for_vect_loop
Date: Tue, 18 Jul 2023 16:29:42 -0300	[thread overview]
Message-ID: <875y6h2f2x.fsf@linaro.org> (raw)
In-Reply-To: <ZLUZijWxHsRaiHC5@kam.mff.cuni.cz>


Hello,

Jan Hubicka via Gcc-patches <gcc-patches@gcc.gnu.org> writes:

> Hi,
> when vectorizing 4 times, we sometimes do
>   for
>     <4x vectorized body>
>   for
>     <2x vectorized body>
>   for
>     <1x vectorized body>
>
> Here the second two fors handling epilogue never iterates.
> Currently vecotrizer thinks that the middle for itrates twice.
> This turns out to be scale_profile_for_vect_loop that uses 
> niter_for_unrolled_loop.
>
> At that time we know epilogue will iterate at most 2 times
> but niter_for_unrolled_loop does not know that the last iteration
> will be taken by the epilogue-of-epilogue and thus it think
> that the loop may iterate once and exit in middle of second
> iteration.
>
> We already do correct job updating niter bounds and this is
> just ordering issue.  This patch makes us to first update
> the bounds and then do updating of the loop.  I re-implemented
> the function more correctly and precisely.
>
> The loop reducing iteration factor for overly flat profiles is bit funny, but
> only other method I can think of is to compute sreal scale that would have
> similar overhead I think.
>
> Bootstrapped/regtested x86_64-linux, comitted.
>
> gcc/ChangeLog:
>
> 	PR middle-end/110649
> 	* tree-vect-loop.cc (scale_profile_for_vect_loop):
> 	(vect_transform_loop):
> 	(optimize_mask_stores):

Our CI detected regressions on aarch64-linux-gnu with this commit in
gcc.target/aarch64/sve/aarch64-sve.exp. I checked today's trunk and it
still fails. I filed the following bug report with the details:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110727

Could you please check?

-- 
Thiago

      reply	other threads:[~2023-07-18 19:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-17 10:35 Jan Hubicka
2023-07-18 19:29 ` Thiago Jung Bauermann [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=875y6h2f2x.fsf@linaro.org \
    --to=thiago.bauermann@linaro.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    --cc=rguenther@suse.cz \
    /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).