Re: Check rrotate optab first when transforming lrotate

2019-07-15 Thread Segher Boessenkool
On Mon, Jul 15, 2019 at 10:59:29AM +0200, Jakub Jelinek wrote: > On Mon, Jul 15, 2019 at 04:50:13PM +0800, Kewen.Lin wrote: > > In match.pd and expmed.c, we have some codes to transform lrotate to > > rrotate if rotation count is const. But they don't consider the target > > whether supports the

Re: Check rrotate optab first when transforming lrotate

2019-07-15 Thread Kewen.Lin
Hi Jakub, on 2019/7/15 下午4:59, Jakub Jelinek wrote: > On Mon, Jul 15, 2019 at 04:50:13PM +0800, Kewen.Lin wrote: >> In match.pd and expmed.c, we have some codes to transform lrotate to >> rrotate if rotation count is const. But they don't consider the target >> whether supports the rrotate. It

Re: Check rrotate optab first when transforming lrotate

2019-07-15 Thread Richard Sandiford
Jakub Jelinek writes: > On Mon, Jul 15, 2019 at 04:50:13PM +0800, Kewen.Lin wrote: >> In match.pd and expmed.c, we have some codes to transform lrotate to >> rrotate if rotation count is const. But they don't consider the target >> whether supports the rrotate. It leads to some suboptimal gener

Re: Check rrotate optab first when transforming lrotate

2019-07-15 Thread Richard Biener
On Mon, Jul 15, 2019 at 10:59 AM Jakub Jelinek wrote: > > On Mon, Jul 15, 2019 at 04:50:13PM +0800, Kewen.Lin wrote: > > In match.pd and expmed.c, we have some codes to transform lrotate to > > rrotate if rotation count is const. But they don't consider the target > > whether supports the rrotate

Re: Check rrotate optab first when transforming lrotate

2019-07-15 Thread Jakub Jelinek
On Mon, Jul 15, 2019 at 04:50:13PM +0800, Kewen.Lin wrote: > In match.pd and expmed.c, we have some codes to transform lrotate to > rrotate if rotation count is const. But they don't consider the target > whether supports the rrotate. It leads to some suboptimal generated > code since some optim

Check rrotate optab first when transforming lrotate

2019-07-15 Thread Kewen.Lin
Hi all, In match.pd and expmed.c, we have some codes to transform lrotate to rrotate if rotation count is const. But they don't consider the target whether supports the rrotate. It leads to some suboptimal generated code since some optimization can't get expected result by querying target optab