From: Segher Boessenkool <segher@kernel.crashing.org>
To: "Kewen.Lin" <linkw@linux.ibm.com>
Cc: Jeff Law <law@redhat.com>, Richard Biener <rguenther@suse.de>,
gcc-patches@gcc.gnu.org, wschmidt@linux.ibm.com,
bin.cheng@linux.alibaba.com, jakub@redhat.com
Subject: Re: [PATCH v3 2/3] Add predict_doloop_p target hook
Date: Tue, 21 May 2019 10:36:00 -0000 [thread overview]
Message-ID: <20190521103634.GB31586@gate.crashing.org> (raw)
In-Reply-To: <343d46fd-eac3-0531-458e-d1e31e0c88fe@linux.ibm.com>
On Tue, May 21, 2019 at 01:50:31PM +0800, Kewen.Lin wrote:
> on 2019/5/20 ä¸å10:43, Jeff Law wrote:
> > On 5/20/19 4:24 AM, Segher Boessenkool wrote:
> >> Let me try to answer a bit here...
> >>
> >> On Mon, May 20, 2019 at 11:28:26AM +0200, Richard Biener wrote:
> >>> On Thu, 16 May 2019, linkw@linux.ibm.com wrote:
> >>
> >>> So the better way would be to expose that via a target hook somehow.
> >>> Or simply restrict IVOPTs processing to innermost loops for now.
> >>
> >> I think we should have two hooks: one is called with the struct loop as
> >> parameter; and the other is called for every statement in the loop, if
> >> the hook isn't null anyway. Or perhaps we do not need that second one.
> > I'd wait to see a compelling example from real world code where we need
> > to scan the statements. Otherwise we're just dragging in more target
> > specific decisions which in fact we want to minimize target stuff.
>
> The scan is trying to do similar thing like default_invalid_within_doloop.
> It scans for hardware counter register clobbering. I think it's important
> and valuable to scan especially for call since it's common.
Ah, right, without this check we would say many more loops can be doloop
than can in fact be.
> if (CALL_P (insn))
> return "Function call in loop.";
>
> if (tablejump_p (insn, NULL, NULL) || computed_jump_p (insn))
> return "Computed branch in the loop.";
>
> But it's a question whether to make it as part of generic. I double checked
> that most of the doloop targets use this default behavior, only 5 targets are
> using their own TARGET_INVALID_WITHIN_DOLOOP, so it might be a good thing to
> make it common to share.
Yeah, and have the default hook for gimple be similar to the rtl one.
Segher
next prev parent reply other threads:[~2019-05-21 10:36 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-17 3:37 linkw
2019-05-17 5:31 ` Kugan Vivekanandarajah
2019-05-17 6:15 ` Kewen.Lin
2019-05-17 6:57 ` Segher Boessenkool
2019-05-17 6:49 ` Segher Boessenkool
2019-05-17 7:20 ` Kewen.Lin
2019-05-20 9:28 ` Richard Biener
2019-05-20 10:24 ` Segher Boessenkool
2019-05-20 14:44 ` Jeff Law
2019-05-20 16:38 ` Segher Boessenkool
2019-05-21 6:03 ` Kewen.Lin
2019-05-21 10:20 ` Richard Biener
2019-05-21 12:42 ` Segher Boessenkool
2019-05-21 15:22 ` Jeff Law
2019-05-22 2:07 ` Kewen.Lin
2019-06-11 2:39 ` Kewen.Lin
2019-06-11 12:17 ` Richard Biener
2019-06-13 5:50 ` [PATCH v4 " Kewen.Lin
2019-06-14 21:53 ` Segher Boessenkool
2019-06-14 23:46 ` Bill Schmidt
2019-06-17 2:08 ` Kewen.Lin
2019-06-17 8:51 ` Richard Biener
2019-06-17 9:39 ` Kewen.Lin
2019-06-17 9:59 ` Segher Boessenkool
2019-06-17 12:08 ` Richard Biener
2019-06-17 13:39 ` Kewen.Lin
2019-06-17 13:44 ` Richard Biener
2019-06-17 14:24 ` Kewen.Lin
2019-05-21 11:09 ` [PATCH v3 " Segher Boessenkool
2019-05-21 9:58 ` Richard Biener
2019-05-21 5:50 ` Kewen.Lin
2019-05-21 6:32 ` Bin.Cheng
2019-05-21 10:36 ` Segher Boessenkool [this message]
2019-05-21 3:48 ` Kewen.Lin
2019-05-21 5:28 ` 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=20190521103634.GB31586@gate.crashing.org \
--to=segher@kernel.crashing.org \
--cc=bin.cheng@linux.alibaba.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jakub@redhat.com \
--cc=law@redhat.com \
--cc=linkw@linux.ibm.com \
--cc=rguenther@suse.de \
--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).