Re: [PATCH v3 2/3] Add predict_doloop_p target hook

2019-06-11 Thread Richard Biener
On Tue, 11 Jun 2019, Kewen.Lin wrote: > >> If my understanding on this question is correct, IMHO we should try to make > >> IVOPTs conservative than optimistic, since once the predict is wrong from > >> too optimistic decision, the costing on the doloop use is wrong, it's very > >> possible to

Re: [PATCH v3 2/3] Add predict_doloop_p target hook

2019-06-10 Thread Kewen.Lin
>> If my understanding on this question is correct, IMHO we should try to make >> IVOPTs conservative than optimistic, since once the predict is wrong from >> too optimistic decision, the costing on the doloop use is wrong, it's very >> possible to affect the global optimal set. It looks we don't

Re: [PATCH v3 2/3] Add predict_doloop_p target hook

2019-05-21 Thread Kewen.Lin
on 2019/5/21 下午6:20, Richard Biener wrote: > On Tue, 21 May 2019, Kewen.Lin wrote: > >> on 2019/5/21 上午12:37, Segher Boessenkool wrote: >>> On Mon, May 20, 2019 at 08:43:59AM -0600, Jeff Law wrote: > I think we should have two hooks: one is called with the struct loop as > parameter; and

Re: [PATCH v3 2/3] Add predict_doloop_p target hook

2019-05-21 Thread Jeff Law
On 5/21/19 4:20 AM, Richard Biener wrote: > On Tue, 21 May 2019, Kewen.Lin wrote: > >> on 2019/5/21 上午12:37, Segher Boessenkool wrote: >>> On Mon, May 20, 2019 at 08:43:59AM -0600, Jeff Law wrote: > I think we should have two hooks: one is called with the struct loop as > parameter; and

Re: [PATCH v3 2/3] Add predict_doloop_p target hook

2019-05-21 Thread Segher Boessenkool
On Tue, May 21, 2019 at 12:20:50PM +0200, Richard Biener wrote: > On Tue, 21 May 2019, Kewen.Lin wrote: > > > on 2019/5/21 上午12:37, Segher Boessenkool wrote: > > > On Mon, May 20, 2019 at 08:43:59AM -0600, Jeff Law wrote: > > >>> I think we should have two hooks: one is called with the struct

Re: [PATCH v3 2/3] Add predict_doloop_p target hook

2019-05-21 Thread Segher Boessenkool
On Tue, May 21, 2019 at 02:03:04PM +0800, Kewen.Lin wrote: > on 2019/5/21 上午12:37, Segher Boessenkool wrote: > > On Mon, May 20, 2019 at 08:43:59AM -0600, Jeff Law wrote: > >>> I think we should have two hooks: one is called with the struct loop as > >>> parameter; and the other is called for

Re: [PATCH v3 2/3] Add predict_doloop_p target hook

2019-05-21 Thread Segher Boessenkool
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,

Re: [PATCH v3 2/3] Add predict_doloop_p target hook

2019-05-21 Thread Richard Biener
On Tue, 21 May 2019, Kewen.Lin wrote: > on 2019/5/21 上午12:37, Segher Boessenkool wrote: > > On Mon, May 20, 2019 at 08:43:59AM -0600, Jeff Law wrote: > >>> 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

Re: [PATCH v3 2/3] Add predict_doloop_p target hook

2019-05-21 Thread Richard Biener
On Mon, 20 May 2019, Segher Boessenkool wrote: > On Mon, May 20, 2019 at 08:43:59AM -0600, Jeff Law wrote: > > > 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.

Re: [PATCH v3 2/3] Add predict_doloop_p target hook

2019-05-21 Thread Bin.Cheng
On Tue, May 21, 2019 at 1:50 PM 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,

Re: [PATCH v3 2/3] Add predict_doloop_p target hook

2019-05-21 Thread Kewen.Lin
on 2019/5/21 上午12:37, Segher Boessenkool wrote: > On Mon, May 20, 2019 at 08:43:59AM -0600, Jeff Law wrote: >>> 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

Re: [PATCH v3 2/3] Add predict_doloop_p target hook

2019-05-20 Thread Kewen.Lin
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, li...@linux.ibm.com wrote: >> >>> So the better way would be to expose that

Re: [PATCH v3 2/3] Add predict_doloop_p target hook

2019-05-20 Thread Kewen.Lin
on 2019/5/20 下午5:28, Richard Biener wrote: > On Thu, 16 May 2019, li...@linux.ibm.com wrote: > >> From: Kewen Lin >> >> Hi, >> >> Previous version link: >> https://gcc.gnu.org/ml/gcc-patches/2019-05/msg00654.html >> >> Comparing with the previous version, I moved the generic >> parts of rs6000

Re: [PATCH v3 2/3] Add predict_doloop_p target hook

2019-05-20 Thread Kewen.Lin
on 2019/5/20 下午5:28, Richard Biener wrote: > On Thu, 16 May 2019, li...@linux.ibm.com wrote: > >> From: Kewen Lin >> >> Hi, >> >> Previous version link: >> https://gcc.gnu.org/ml/gcc-patches/2019-05/msg00654.html >> >> Comparing with the previous version, I moved the generic >> parts of rs6000

Re: [PATCH v3 2/3] Add predict_doloop_p target hook

2019-05-20 Thread Segher Boessenkool
On Mon, May 20, 2019 at 08:43:59AM -0600, Jeff Law wrote: > > 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

Re: [PATCH v3 2/3] Add predict_doloop_p target hook

2019-05-20 Thread Jeff Law
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, li...@linux.ibm.com wrote: >>> +/* Predict whether the given loop in gimple will be transformed in the RTL >>> +

Re: [PATCH v3 2/3] Add predict_doloop_p target hook

2019-05-20 Thread Segher Boessenkool
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, li...@linux.ibm.com wrote: > > +/* Predict whether the given loop in gimple will be transformed in the RTL > > + doloop_optimize pass. This is for rs6000 target specific.

Re: [PATCH v3 2/3] Add predict_doloop_p target hook

2019-05-20 Thread Richard Biener
On Thu, 16 May 2019, li...@linux.ibm.com wrote: > From: Kewen Lin > > Hi, > > Previous version link: > https://gcc.gnu.org/ml/gcc-patches/2019-05/msg00654.html > > Comparing with the previous version, I moved the generic > parts of rs6000 target hook to IVOPTs. But I still kept > the target

Re: [PATCH v3 2/3] Add predict_doloop_p target hook

2019-05-17 Thread Kewen.Lin
Hi Segher, on 2019/5/17 下午2:49, Segher Boessenkool wrote: > Hi Kewen, > > On Thu, May 16, 2019 at 10:35:30PM -0500, li...@linux.ibm.com wrote: >> 2) For the other part of target invalid stmt check, as the >> hook invalid_within_doloop grep data shows, no all targets >> need to check whether

Re: [PATCH v3 2/3] Add predict_doloop_p target hook

2019-05-17 Thread Segher Boessenkool
On Fri, May 17, 2019 at 03:30:41PM +1000, Kugan Vivekanandarajah wrote: > On Fri, 17 May 2019 at 13:37, wrote: > > + if (GET_CODE (body) == SET) > > + { > > + rtx set_val = XEXP (body, 1); > > + enum rtx_code code = GET_CODE (set_val); > > + enum rtx_class cls =

Re: [PATCH v3 2/3] Add predict_doloop_p target hook

2019-05-17 Thread Segher Boessenkool
Hi Kewen, On Thu, May 16, 2019 at 10:35:30PM -0500, li...@linux.ibm.com wrote: > 2) For the other part of target invalid stmt check, as the > hook invalid_within_doloop grep data shows, no all targets > need to check whether invalid instructions exist in doloop. > If we scan all stmts as generic,

Re: [PATCH v3 2/3] Add predict_doloop_p target hook

2019-05-17 Thread Kewen.Lin
on 2019/5/17 下午1:30, Kugan Vivekanandarajah wrote: > Hi, > > On Fri, 17 May 2019 at 13:37, wrote: >> >> From: Kewen Lin >> >> +/* Check whether number of iteration computation is too costly for doloop >> + transformation. It expands the gimple sequence to equivalent RTL insn >> + sequence,

Re: [PATCH v3 2/3] Add predict_doloop_p target hook

2019-05-16 Thread Kugan Vivekanandarajah
Hi, On Fri, 17 May 2019 at 13:37, wrote: > > From: Kewen Lin > > Hi, > > Previous version link: > https://gcc.gnu.org/ml/gcc-patches/2019-05/msg00654.html > > Comparing with the previous version, I moved the generic > parts of rs6000 target hook to IVOPTs. But I still kept > the target hook as