Re: [PATCH] sched-ebb.c: avoid moving table jumps (PR rtl-optimization/88423)

2019-03-25 Thread Jeff Law
On 1/24/19 8:43 AM, Alexander Monakov wrote: > On Wed, 23 Jan 2019, Alexander Monakov wrote: > >> It appears that sched-deps tries to take notice of a barrier after a jump, >> but >> similarly to sched-ebb doesn't anticipate that for a tablejump the barrier >> will >> appear after two more insns

Re: [PATCH] sched-ebb.c: avoid moving table jumps (PR rtl-optimization/88423)

2019-03-25 Thread Jeff Law
On 1/24/19 2:10 PM, Segher Boessenkool wrote: > On Thu, Jan 24, 2019 at 06:43:38PM +0300, Alexander Monakov wrote: >> On Wed, 23 Jan 2019, Alexander Monakov wrote: >> >>> It appears that sched-deps tries to take notice of a barrier after a jump, >>> but >>> similarly to sched-ebb doesn't anticipat

Re: [PATCH] sched-ebb.c: avoid moving table jumps (PR rtl-optimization/88423)

2019-02-21 Thread Jeff Law
On 1/24/19 3:10 PM, Eric Botcazou wrote: >> md.texi says >> >> The @samp{tablejump} insn is always the last insn before the jump >> table it uses. Its assembler code normally has no need to use the >> second operand, but you should incorporate it in the RTL pattern so >> that the jump optimizer wi

Re: [PATCH] sched-ebb.c: avoid moving table jumps (PR rtl-optimization/88423)

2019-02-21 Thread Jeff Law
On 1/23/19 6:52 AM, Alexander Monakov wrote: > On Wed, 23 Jan 2019, Andrey Belevantsev wrote: > >> For that, I'm not sure. Your patch will leave the tablejump unscheduled at >> all, i.e. any fields like INSN_TICK would be unfilled and thus the later >> passes like bundling on ia64 will not work.

Re: [PATCH] sched-ebb.c: avoid moving table jumps (PR rtl-optimization/88423)

2019-02-21 Thread Jeff Law
On 1/23/19 12:29 PM, Segher Boessenkool wrote: > On Wed, Jan 23, 2019 at 04:52:24PM +0300, Alexander Monakov wrote: >> On Wed, 23 Jan 2019, Andrey Belevantsev wrote: >>> For that, I'm not sure. Your patch will leave the tablejump unscheduled at >>> all, i.e. any fields like INSN_TICK would be unfi

Re: [PATCH] sched-ebb.c: avoid moving table jumps (PR rtl-optimization/88423)

2019-02-18 Thread Aaron Sawdey
On 2/18/19 10:41 AM, Alexander Monakov wrote: > On Mon, 18 Feb 2019, Aaron Sawdey wrote: > >> The code in emit_case_dispatch_table() will very clearly always emit >> branch/label/jumptable_data/barrier >> so this does need to be handled. So, yes tablejump always looks like this, >> and also ye

Re: [PATCH] sched-ebb.c: avoid moving table jumps (PR rtl-optimization/88423)

2019-02-18 Thread Alexander Monakov
On Mon, 18 Feb 2019, Aaron Sawdey wrote: > The code in emit_case_dispatch_table() will very clearly always emit > branch/label/jumptable_data/barrier > so this does need to be handled. So, yes tablejump always looks like this, > and also yes it seems to be > ripe ground for logic bugs, we have 8

Re: [PATCH] sched-ebb.c: avoid moving table jumps (PR rtl-optimization/88423)

2019-02-18 Thread Aaron Sawdey
The code in emit_case_dispatch_table() will very clearly always emit branch/label/jumptable_data/barrier so this does need to be handled. So, yes tablejump always looks like this, and also yes it seems to be ripe ground for logic bugs, we have 88308, 88347, 88423 all related to it. In the long t

Re: [PATCH] sched-ebb.c: avoid moving table jumps (PR rtl-optimization/88423)

2019-01-24 Thread Eric Botcazou
> md.texi says > > The @samp{tablejump} insn is always the last insn before the jump > table it uses. Its assembler code normally has no need to use the > second operand, but you should incorporate it in the RTL pattern so > that the jump optimizer will not delete the table as unreachable code. >

Re: [PATCH] sched-ebb.c: avoid moving table jumps (PR rtl-optimization/88423)

2019-01-24 Thread Segher Boessenkool
On Thu, Jan 24, 2019 at 06:43:38PM +0300, Alexander Monakov wrote: > On Wed, 23 Jan 2019, Alexander Monakov wrote: > > > It appears that sched-deps tries to take notice of a barrier after a jump, > > but > > similarly to sched-ebb doesn't anticipate that for a tablejump the barrier > > will > >

Re: [PATCH] sched-ebb.c: avoid moving table jumps (PR rtl-optimization/88423)

2019-01-24 Thread Alexander Monakov
On Wed, 23 Jan 2019, Alexander Monakov wrote: > It appears that sched-deps tries to take notice of a barrier after a jump, but > similarly to sched-ebb doesn't anticipate that for a tablejump the barrier > will > appear after two more insns (a code_label and a jump_table_data). > > If so, it nee

Re: [PATCH] sched-ebb.c: avoid moving table jumps (PR rtl-optimization/88423)

2019-01-23 Thread Segher Boessenkool
On Wed, Jan 23, 2019 at 04:52:24PM +0300, Alexander Monakov wrote: > On Wed, 23 Jan 2019, Andrey Belevantsev wrote: > > For that, I'm not sure. Your patch will leave the tablejump unscheduled at > > all, i.e. any fields like INSN_TICK would be unfilled and thus the later > > passes like bundling o

Re: [PATCH] sched-ebb.c: avoid moving table jumps (PR rtl-optimization/88423)

2019-01-23 Thread Alexander Monakov
On Wed, 23 Jan 2019, Alexander Monakov wrote: > That said, I'm really concerned that on this testcase we should not be moving > the tablejump *at all*: we are moving it up past a 'use ax' insn (the use is > for the function's return value). So after the move the use is in an > unreachable > block

Re: [PATCH] sched-ebb.c: avoid moving table jumps (PR rtl-optimization/88423)

2019-01-23 Thread Alexander Monakov
On Wed, 23 Jan 2019, Andrey Belevantsev wrote: > For that, I'm not sure. Your patch will leave the tablejump unscheduled at > all, i.e. any fields like INSN_TICK would be unfilled and thus the later > passes like bundling on ia64 will not work. Maybe we can just stop > tablejumps from moving wit

Re: [PATCH] sched-ebb.c: avoid moving table jumps (PR rtl-optimization/88423)

2019-01-23 Thread Andrey Belevantsev
Hi David, On 18.01.2019 19:58, David Malcolm wrote: > On Fri, 2019-01-18 at 12:32 -0500, David Malcolm wrote: > > [CCing Abel] > >> PR rtl-optimization/88423 reports an ICE within sched-ebb.c's >> begin_move_insn, failing the assertion at line 175, where there's >> no fall-through edge: >> >> 17

Re: [PATCH] sched-ebb.c: avoid moving table jumps (PR rtl-optimization/88423)

2019-01-22 Thread Steven Bosscher
On Fri, Jan 18, 2019 at 5:43 PM David Malcolm wrote: > (1) What does GCC mean by "ebb" in this context? In this context, the EBB is what Muchnick would call a trace. Ciao! Steven

Re: [PATCH] sched-ebb.c: avoid moving table jumps (PR rtl-optimization/88423)

2019-01-21 Thread Jeff Law
On 1/18/19 10:32 AM, David Malcolm wrote: > PR rtl-optimization/88423 reports an ICE within sched-ebb.c's > begin_move_insn, failing the assertion at line 175, where there's > no fall-through edge: > > 171 rtx_insn *x = NEXT_INSN (insn); > 172 if (e) > 173 gcc_checking_as

Re: [PATCH] sched-ebb.c: avoid moving table jumps (PR rtl-optimization/88423)

2019-01-18 Thread David Malcolm
On Fri, 2019-01-18 at 12:32 -0500, David Malcolm wrote: [CCing Abel] > PR rtl-optimization/88423 reports an ICE within sched-ebb.c's > begin_move_insn, failing the assertion at line 175, where there's > no fall-through edge: > > 171 rtx_insn *x = NEXT_INSN (insn); > 172 if (e) >

[PATCH] sched-ebb.c: avoid moving table jumps (PR rtl-optimization/88423)

2019-01-18 Thread David Malcolm
PR rtl-optimization/88423 reports an ICE within sched-ebb.c's begin_move_insn, failing the assertion at line 175, where there's no fall-through edge: 171 rtx_insn *x = NEXT_INSN (insn); 172 if (e) 173 gcc_checking_assert (NOTE_P (x) || LABEL_P (x)); 174 else 175