Re: Early jump threading

2016-10-18 Thread James Greenhalgh
On Mon, Sep 19, 2016 at 11:22:27AM +0200, Jan Hubicka wrote: > > On Mon, Sep 19, 2016 at 2:48 AM, Jan Hubicka wrote: > > > Hi, > > > this is the patch compensating testsuite I commited after re-testing > > > on x86_64-linux. > > > > > > Other placements of early_thread_jumps does

Re: Early jump threading

2016-09-20 Thread Thomas Preudhomme
On 19/09/16 08:02, Christophe Lyon wrote: Index: testsuite/gcc.dg/tree-ssa/pr68198.c === --- testsuite/gcc.dg/tree-ssa/pr68198.c (revision 240109) +++ testsuite/gcc.dg/tree-ssa/pr68198.c (working copy) @@ -1,5 +1,5 @@ /* { dg-do

Re: Early jump threading

2016-09-19 Thread Jan Hubicka
fitable_jump_thread_path, > > fsm_find_control_statement_thread_paths, > > find_jump_threads_backwards): Add speed_p parameter. > > (pass_data_early_thread_jumps): New pass. > > (make_pass_early_thread_jumps): New function. > > > > * g++.dg/predict-loo

Re: Early jump threading

2016-09-19 Thread Christophe Lyon
fsm_find_thread_path, profitable_jump_thread_path, > fsm_find_control_statement_thread_paths, > find_jump_threads_backwards): Add speed_p parameter. > (pass_data_early_thread_jumps): New pass. > (make_pass_early_thread_jumps): New function. > > * g++.dg/predict-loop-exit-1.C: Disa

Re: Early jump threading

2016-09-18 Thread Andrew Pinski
read_jumps): New function. > > * g++.dg/predict-loop-exit-1.C: Disable early jump threading. > * g++.dg/predict-loop-exit-2.C: Disable early jump threading. > * g++.dg/predict-loop-exit-3.C: Disable early jump threading. > * gcc.dg/tree-ssa/pr69196-1.c: D

Re: Early jump threading

2016-09-18 Thread Jan Hubicka
): New pass. (make_pass_early_thread_jumps): New function. * g++.dg/predict-loop-exit-1.C: Disable early jump threading. * g++.dg/predict-loop-exit-2.C: Disable early jump threading. * g++.dg/predict-loop-exit-3.C: Disable early jump threading. * gcc.dg/tree-ssa

Re: Early jump threading

2016-08-18 Thread Jeff Law
On 08/11/2016 08:02 AM, Jan Hubicka wrote: Hi, this patch adds early jump threading pass. Jump threading is one of most common cases where estimated profile becomes corrupted, because the branches are predicted independently beforehand. This patch simply adds early mode to jump threader

Re: Early jump threading

2016-08-16 Thread Jeff Law
On 08/12/2016 02:02 AM, Richard Biener wrote: On Thu, 11 Aug 2016, Jan Hubicka wrote: Hi, this patch adds early jump threading pass. Jump threading is one of most common cases where estimated profile becomes corrupted, because the branches are predicted independently beforehand. This patch

Re: Early jump threading

2016-08-16 Thread Jeff Law
On 08/16/2016 05:02 AM, Jan Hubicka wrote: I don't think the backwards/FSM threader tries to update the profile data at all right now. This seems to be cause of the regression andrew is speaking about. I wrote updating of profile after threading few times and there was also Theresa's patch.

Re: Early jump threading

2016-08-16 Thread Jan Hubicka
> I don't think the backwards/FSM threader tries to update the profile > data at all right now. This seems to be cause of the regression andrew is speaking about. I wrote updating of profile after threading few times and there was also Theresa's patch. I tought all the threaders use common

Re: Early jump threading

2016-08-15 Thread Jeff Law
On 08/12/2016 05:27 AM, Jan Hubicka wrote: * passes.def (pass_early_thread_jumps): Schedule after forwprop. * tree-pass.h (make_pass_early_thread_jumps): Declare. * tree-ssa-threadbackward.c (fsm_find_thread_path, fsm_find_thread_path, profitable_jump_thread_path,

Re: Early jump threading

2016-08-15 Thread Jeff Law
On 08/12/2016 12:02 AM, Richard Biener wrote: Hmm, isn't walking backwards from uses doing a lot of redundant stmt walking compared to walking stmts once in forward direction? To me it sounds like a 'local' patterns matching like optimization rather than a global one with proper data flow or a

Re: Early jump threading

2016-08-12 Thread Jan Hubicka
> > * passes.def (pass_early_thread_jumps): Schedule after forwprop. > > * tree-pass.h (make_pass_early_thread_jumps): Declare. > > * tree-ssa-threadbackward.c (fsm_find_thread_path, > > fsm_find_thread_path, profitable_jump_thread_path, > >

Re: Early jump threading

2016-08-12 Thread Richard Biener
On Thu, 11 Aug 2016, Jan Hubicka wrote: > Hi, > this patch adds early jump threading pass. Jump threading is one of most > common cases where estimated profile becomes corrupted, because the branches > are predicted independently beforehand. This patch simply adds early mode to >

Re: Early jump threading

2016-08-12 Thread Richard Biener
On August 11, 2016 8:41:53 PM GMT+02:00, Jeff Law wrote: >On 08/11/2016 08:27 AM, Jan Hubicka wrote: >> >> On tramp3d all VRP passes threads together 730 branches, all DOM >passes 393, so >> FSM threading (with 1957 branches) is the most effective one. Perhaps >eventually >>

Re: Early jump threading

2016-08-11 Thread Jeff Law
On 08/11/2016 09:50 AM, Richard Biener wrote: Ah, I thought it was exclusively dealing with threading through back edges which is sth I'd avoid doing early? No, that's one of the fundamental changes we made for gcc-6, namely using the FSM threader for general purpose threading rather than

Re: Early jump threading

2016-08-11 Thread Jeff Law
On 08/11/2016 08:27 AM, Jan Hubicka wrote: On tramp3d all VRP passes threads together 730 branches, all DOM passes 393, so FSM threading (with 1957 branches) is the most effective one. Perhaps eventually early VRP can also do bit of work. That's roughly consistent with what I've seen. I have

Re: Early jump threading

2016-08-11 Thread Jeff Law
On 08/11/2016 08:06 AM, Richard Biener wrote: On Thu, 11 Aug 2016, Jan Hubicka wrote: Hi, this patch adds early jump threading pass. Jump threading is one of most common cases where estimated profile becomes corrupted, because the branches are predicted independently beforehand. This patch

Re: Early jump threading

2016-08-11 Thread Jeff Law
On 08/11/2016 08:02 AM, Jan Hubicka wrote: Hi, this patch adds early jump threading pass. Jump threading is one of most common cases where estimated profile becomes corrupted, because the branches are predicted independently beforehand. This patch simply adds early mode to jump threader

Re: Early jump threading

2016-08-11 Thread Richard Biener
On August 11, 2016 4:27:00 PM GMT+02:00, Jan Hubicka <hubi...@ucw.cz> wrote: >> On Thu, 11 Aug 2016, Jan Hubicka wrote: >> >> > Hi, >> > this patch adds early jump threading pass. Jump threading is one >of most >> > common cases where estimated

Re: Early jump threading

2016-08-11 Thread Jan Hubicka
> On Thu, 11 Aug 2016, Jan Hubicka wrote: > > > Hi, > > this patch adds early jump threading pass. Jump threading is one of most > > common cases where estimated profile becomes corrupted, because the branches > > are predicted independently beforehand. Thi

Re: Early jump threading

2016-08-11 Thread Richard Biener
On Thu, 11 Aug 2016, Jan Hubicka wrote: > Hi, > this patch adds early jump threading pass. Jump threading is one of most > common cases where estimated profile becomes corrupted, because the branches > are predicted independently beforehand. This patch simply adds early mode to >

Early jump threading

2016-08-11 Thread Jan Hubicka
Hi, this patch adds early jump threading pass. Jump threading is one of most common cases where estimated profile becomes corrupted, because the branches are predicted independently beforehand. This patch simply adds early mode to jump threader that does not permit code growth and thus only win