public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "linkw at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/102383] Missing optimization for PRE after enable O2 vectorization
Date: Fri, 17 Sep 2021 08:12:00 +0000	[thread overview]
Message-ID: <bug-102383-4-w6tY68dASf@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-102383-4@http.gcc.gnu.org/bugzilla/>

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

Kewen Lin <linkw at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |linkw at gcc dot gnu.org

--- Comment #4 from Kewen Lin <linkw at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #2)
> The issue is that we tame PRE because it tends to inhibit vectorization.
> 
>       /* Inhibit the use of an inserted PHI on a loop header when
>          the address of the memory reference is a simple induction
>          variable.  In other cases the vectorizer won't do anything
>          anyway (either it's loop invariant or a complicated
>          expression).  */
>       if (sprime
>           && TREE_CODE (sprime) == SSA_NAME
>           && do_pre
>           && (flag_tree_loop_vectorize || flag_tree_parallelize_loops > 1)
>           && loop_outer (b->loop_father)
>           && has_zero_uses (sprime)
>           && bitmap_bit_p (inserted_exprs, SSA_NAME_VERSION (sprime))
>           && gimple_assign_load_p (stmt))
> 
> the heuristic would either need to become much more elaborate (do more
> checks whether vectorization is likely) or we could make the behavior
> depend on the cost model as well, for example exclude very-cheap here.
> That might have an influence on the performance benefit seen from
> -O2 default vectorization though.
> 
> IIRC we suggested to enable predictive commoning at -O2 but avoid
> unroll factors > 1 when it was not explicitely enabled.
> 

Yeah, it's PR100794.  I also collected some data for different approaches at
that time.  Recently I opened another issue PR102054 which is also related to
that we restrict PRE due to loop-vect.

  parent reply	other threads:[~2021-09-17  8:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-17  2:35 [Bug tree-optimization/102383] New: " crazylht at gmail dot com
2021-09-17  3:15 ` [Bug tree-optimization/102383] " crazylht at gmail dot com
2021-09-17  7:06 ` rguenth at gcc dot gnu.org
2021-09-17  7:56 ` crazylht at gmail dot com
2021-09-17  8:12 ` linkw at gcc dot gnu.org [this message]
2023-11-01  4:10 ` crazylht at gmail dot com
2023-11-02 13:20 ` rguenth at gcc dot gnu.org

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=bug-102383-4-w6tY68dASf@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).