Re: [patch] Move lowering of switches to bit tests to GIMPLE

2012-07-25 Thread Hans-Peter Nilsson
On Tue, 24 Jul 2012, Richard Henderson wrote: > On 07/21/2012 06:10 AM, Oleg Endo wrote: > > I think on SH the cost test in lshift_cheap_p with > > gen_rtx_ASHIFT (word_mode, const1_rtx, reg), speed_p); > > > > will always 'fail', because of sh.c (shiftcosts): > > /* There is no pattern for co

Re: [patch] Move lowering of switches to bit tests to GIMPLE

2012-07-24 Thread Oleg Endo
On Tue, 2012-07-24 at 08:34 -0700, Richard Henderson wrote: > On 07/21/2012 06:10 AM, Oleg Endo wrote: > > I think on SH the cost test in lshift_cheap_p with > > gen_rtx_ASHIFT (word_mode, const1_rtx, reg), speed_p); > > > > will always 'fail', because of sh.c (shiftcosts): > > /* There is no pa

Re: [patch] Move lowering of switches to bit tests to GIMPLE

2012-07-24 Thread Richard Henderson
On 07/21/2012 06:10 AM, Oleg Endo wrote: > I think on SH the cost test in lshift_cheap_p with > gen_rtx_ASHIFT (word_mode, const1_rtx, reg), speed_p); > > will always 'fail', because of sh.c (shiftcosts): > /* There is no pattern for constant first operand. */ > if (CONST_INT_P (XEXP (x, 0)))

Re: [patch] Move lowering of switches to bit tests to GIMPLE

2012-07-23 Thread Steven Bosscher
On Sun, Jul 1, 2012 at 11:58 AM, Richard Guenther wrote: > We have to think about the point in the pass pipeline where we want to do > this (and the rest of) lowering. At the moment switch-conversion runs before > profile-data is read and thus cannot do a very good job. I think lowering > somewh

Re: [patch] Move lowering of switches to bit tests to GIMPLE

2012-07-21 Thread Oleg Endo
On Sat, 2012-07-21 at 15:12 +0200, Steven Bosscher wrote: > On Sat, Jul 21, 2012 at 3:10 PM, Oleg Endo wrote: > > to handle the "const << reg" case. Or would it be better to make the > > lshift_cheap_p try out more shifty things? > > The simpler lshift_cheap stays, the better. It's already warty

Re: [patch] Move lowering of switches to bit tests to GIMPLE

2012-07-21 Thread Steven Bosscher
On Sat, Jul 21, 2012 at 3:10 PM, Oleg Endo wrote: > to handle the "const << reg" case. Or would it be better to make the > lshift_cheap_p try out more shifty things? The simpler lshift_cheap stays, the better. It's already warty to have to look at rtx_cost in a GIMPLE pass. Ciao! Steven

Re: [patch] Move lowering of switches to bit tests to GIMPLE

2012-07-21 Thread Oleg Endo
On Sat, 2012-07-21 at 14:41 +0200, Steven Bosscher wrote: > On Fri, Jul 20, 2012 at 12:41 AM, Richard Henderson wrote: > > Notes for future cleanups: > > > >> + /* If the targer has no lshift in word_mode, the operation will most > >> + probably not be cheap. ??? Does GCC even work for such

Re: [patch] Move lowering of switches to bit tests to GIMPLE

2012-07-21 Thread Steven Bosscher
On Fri, Jul 20, 2012 at 12:41 AM, Richard Henderson wrote: > Notes for future cleanups: > >> + /* If the targer has no lshift in word_mode, the operation will most >> + probably not be cheap. ??? Does GCC even work for such targets? */ > > Yes, it does. We're perfectly happy to let this ex

Re: [patch] Move lowering of switches to bit tests to GIMPLE

2012-07-19 Thread Richard Henderson
Notes for future cleanups: > + /* If the targer has no lshift in word_mode, the operation will most > + probably not be cheap. ??? Does GCC even work for such targets? */ Yes, it does. We're perfectly happy to let this expand to a libcall. Indeed, many teeny tiny targets don't have a fu

Re: [patch] Move lowering of switches to bit tests to GIMPLE

2012-07-08 Thread H.J. Lu
On Mon, Jul 2, 2012 at 7:18 AM, Steven Bosscher wrote: > On Sun, Jul 1, 2012 at 11:58 AM, Richard Guenther > wrote: >> On Sat, Jun 30, 2012 at 12:29 PM, Steven Bosscher >> wrote: >>> Hello, >>> >>> This patch moves the emit_case_bit_tests method of switch lowering >>> from 'expand' to a GIMPLE

Re: [patch] Move lowering of switches to bit tests to GIMPLE

2012-07-02 Thread Steven Bosscher
On Sun, Jul 1, 2012 at 11:58 AM, Richard Guenther wrote: > On Sat, Jun 30, 2012 at 12:29 PM, Steven Bosscher > wrote: >> Hello, >> >> This patch moves the emit_case_bit_tests method of switch lowering >> from 'expand' to a GIMPLE pass. >> >> Initially, I planned to move all switch lowering to so

Re: [patch] Move lowering of switches to bit tests to GIMPLE

2012-07-01 Thread Steven Bosscher
On Sun, Jul 1, 2012 at 11:58 AM, Richard Guenther wrote: >> OK for trunk? > > This is ok. Grrr, I now get regressions on both powerpc64 and x86_64 (although both still bootstrap). I'm withdrawing this patch until I've sorted out these new problems. Ciao! Steven

Re: [patch] Move lowering of switches to bit tests to GIMPLE

2012-07-01 Thread Richard Guenther
On Sat, Jun 30, 2012 at 12:29 PM, Steven Bosscher wrote: > Hello, > > This patch moves the emit_case_bit_tests method of switch lowering > from 'expand' to a GIMPLE pass. > > Initially, I planned to move all switch lowering to something other > than a casesi or tablejump to GIMPLE, but this is mor

[patch] Move lowering of switches to bit tests to GIMPLE

2012-06-30 Thread Steven Bosscher
Hello, This patch moves the emit_case_bit_tests method of switch lowering from 'expand' to a GIMPLE pass. Initially, I planned to move all switch lowering to something other than a casesi or tablejump to GIMPLE, but this is more involved than I anticipated. My plan was (and still is, but for late