From: Alan Lawrence <alan.lawrence@arm.com>
To: Richard Biener <richard.guenther@gmail.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH/RFC] Make loop-header-copying more aggressive, rerun before tree-if-conversion
Date: Fri, 19 Jun 2015 17:38:00 -0000 [thread overview]
Message-ID: <5584534C.9040406@arm.com> (raw)
In-Reply-To: <CAFiYyc1hSupv4RPCMOeiCNABnBLE1RzgU6ym02SDZxAHKusCFQ@mail.gmail.com>
Richard Biener wrote:
> Apart from Jeffs comment - the usual fix for the undesired
> vectorization is to put
> a __asm__ volatile (""); in the loop.
In vect-strided-a-u16-i4.c, narrowing the scope of the declaration seemed to
preserve the original intent. I've been able to drop the other testsuite changes.
> + /* If any block in the loop has an exit edge, and code after it, it is
> + not a do-while loop. */
> + basic_block *body = get_loop_body (loop);
> + for (unsigned i = 0; i < loop->num_nodes; i++)
>
> wouldn't it be easier to verify that the predecessor of the loop latch
> contains the (only) loop exit?
It's not guaranteed that the loop latch has only one predecessor. The testsuite
contains quite a few examples, e.g. gcc.c-torture/compile/20011114.c (at -O3).
However, I've found a simpler (and equivalent) test, as we have the unique exit
edge and it's source already.
> Note that single_exit () only works when the loop state has
> LOOPS_HAVE_RECORDED_EXITS
Hah, thanks - didn't realize that. So using single_exit_p did make pass_ch
behave differently from pass_ch_vect. I've restored the original code for the
original pass_ch...
> I think pass_ch_vect
> should be only executed if flag_tree_loop_vectorize is enabled.
...agreed; and handling loop->force_vectorize and loop->dont_vectorize properly
required splitting the two phases up more anyway, so I've used clearly-different
predicates in each.
> Coding-style wise, can you please move the "common" pass_ch_vect::execute out
> of the pass_ch_vect class?
Yes, I've done some reorg, introducing a third base class with the common
execute bits calling a virtual method returning bool.
> loop_optimizer_init (LOOPS_NORMAL
> - | LOOPS_HAVE_RECORDED_EXITS);
> + | LOOPS_HAVE_RECORDED_EXITS
> + | LOOPS_HAVE_PREHEADERS
> + | LOOPS_HAVE_SIMPLE_LATCHES);
>
> already included in LOOPS_NORMAL.
So it is. Thanks!
TYVM for the review - I've posted a v2 at
https://gcc.gnu.org/ml/gcc-patches/2015-06/msg01355.html .
Cheers, Alan
prev parent reply other threads:[~2015-06-19 17:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-22 15:46 Alan Lawrence
2015-05-27 16:01 ` Jeff Law
2015-06-19 17:54 ` Alan Lawrence
2015-06-23 20:34 ` Jeff Law
2015-06-30 16:10 ` Alan Lawrence
2015-07-01 17:06 ` Jeff Law
2015-05-28 12:11 ` Richard Biener
2015-06-19 17:38 ` Alan Lawrence [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=5584534C.9040406@arm.com \
--to=alan.lawrence@arm.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).