Re: [PATCH] Add one more pass_convert_switch late.

2020-03-27 Thread Martin Liška
On 11/19/19 3:48 PM, Richard Biener wrote: Sure. As said in the if-to-switch pass "review" all these (now three) passes should share an intermediate representation and costing they then generate code from (either switch-converted lookups, switches or optimized if-chains). There's no reason to a

Re: [PATCH] Add one more pass_convert_switch late.

2019-11-19 Thread Richard Biener
On Tue, Nov 19, 2019 at 2:54 PM Martin Liška wrote: > > On 11/19/19 10:25 AM, Richard Biener wrote: > > On Mon, Nov 18, 2019 at 10:17 AM Martin Liška wrote: > >> > >> On 11/14/19 1:15 PM, Richard Biener wrote: > >>> Hmm. I was thinking of moving the pass instead of adding another one. > >>> What

Re: [PATCH] Add one more pass_convert_switch late.

2019-11-19 Thread Martin Liška
On 11/19/19 11:25 AM, Jakub Jelinek wrote: The point I'm trying to make is that with if-to-switch, if cswitch doesn't handle it, we have a regression. If user writes it as a switch, it is a missed optimization if we generate worse code than we could, but not a regression. Sure, but the questio

Re: [PATCH] Add one more pass_convert_switch late.

2019-11-19 Thread Martin Liška
On 11/19/19 10:25 AM, Richard Biener wrote: On Mon, Nov 18, 2019 at 10:17 AM Martin Liška wrote: On 11/14/19 1:15 PM, Richard Biener wrote: Hmm. I was thinking of moving the pass instead of adding another one. What's the reason to run switch-conversion during early optimization again? I'm

Re: [PATCH] Add one more pass_convert_switch late.

2019-11-19 Thread Jakub Jelinek
On Tue, Nov 19, 2019 at 11:20:16AM +0100, Martin Liška wrote: > On 11/19/19 10:12 AM, Jakub Jelinek wrote: > > On Mon, Nov 18, 2019 at 03:34:35PM +0100, Martin Liška wrote: > > > > Now, I believe with the if to gswitch optimization these will only > > > > rarely > > > > kick in, because the IL wil

Re: [PATCH] Add one more pass_convert_switch late.

2019-11-19 Thread Martin Liška
On 11/19/19 10:12 AM, Jakub Jelinek wrote: On Mon, Nov 18, 2019 at 03:34:35PM +0100, Martin Liška wrote: Now, I believe with the if to gswitch optimization these will only rarely kick in, because the IL will have switches that reassoc doesn't handle, instead of series of ifs. Yes, so my questi

Re: [PATCH] Add one more pass_convert_switch late.

2019-11-19 Thread Richard Biener
On Mon, Nov 18, 2019 at 10:17 AM Martin Liška wrote: > > On 11/14/19 1:15 PM, Richard Biener wrote: > > Hmm. I was thinking of moving the pass instead of adding another one. > > What's the reason to run switch-conversion during early optimization again? > > I'm adding CC, as he's the author of cs

Re: [PATCH] Add one more pass_convert_switch late.

2019-11-19 Thread Jakub Jelinek
On Mon, Nov 18, 2019 at 03:34:35PM +0100, Martin Liška wrote: > > Now, I believe with the if to gswitch optimization these will only rarely > > kick in, because the IL will have switches that reassoc doesn't handle, > > instead of series of ifs. > > Yes, so my question is whether reassoc can handl

Re: [PATCH] Add one more pass_convert_switch late.

2019-11-18 Thread Martin Liška
On 11/18/19 3:07 PM, Jakub Jelinek wrote: On Mon, Nov 18, 2019 at 02:39:12PM +0100, Martin Liška wrote: On 11/18/19 11:06 AM, Jakub Jelinek wrote: On Mon, Nov 18, 2019 at 10:17:56AM +0100, Martin Liška wrote: On 11/14/19 1:15 PM, Richard Biener wrote: Hmm. I was thinking of moving the pass i

Re: [PATCH] Add one more pass_convert_switch late.

2019-11-18 Thread Jakub Jelinek
On Mon, Nov 18, 2019 at 02:39:12PM +0100, Martin Liška wrote: > On 11/18/19 11:06 AM, Jakub Jelinek wrote: > > On Mon, Nov 18, 2019 at 10:17:56AM +0100, Martin Liška wrote: > > > On 11/14/19 1:15 PM, Richard Biener wrote: > > > > Hmm. I was thinking of moving the pass instead of adding another one

Re: [PATCH] Add one more pass_convert_switch late.

2019-11-18 Thread Martin Liška
On 11/18/19 11:06 AM, Jakub Jelinek wrote: On Mon, Nov 18, 2019 at 10:17:56AM +0100, Martin Liška wrote: On 11/14/19 1:15 PM, Richard Biener wrote: Hmm. I was thinking of moving the pass instead of adding another one. What's the reason to run switch-conversion during early optimization again?

Re: [PATCH] Add one more pass_convert_switch late.

2019-11-18 Thread Jakub Jelinek
On Mon, Nov 18, 2019 at 10:17:56AM +0100, Martin Liška wrote: > On 11/14/19 1:15 PM, Richard Biener wrote: > > Hmm. I was thinking of moving the pass instead of adding another one. > > What's the reason to run switch-conversion during early optimization again? > > I'm adding CC, as he's the autho

Re: [PATCH] Add one more pass_convert_switch late.

2019-11-18 Thread Martin Liška
On 11/14/19 1:15 PM, Richard Biener wrote: Hmm. I was thinking of moving the pass instead of adding another one. What's the reason to run switch-conversion during early optimization again? I'm adding CC, as he's the author of cswitch pass and he probably knows more about the pass placement. Bu

Re: [PATCH] Add one more pass_convert_switch late.

2019-11-14 Thread Richard Biener
On Thu, Nov 14, 2019 at 1:06 PM Martin Liška wrote: > > Hi. > > As mentioned in the PR, the patch adds one more late pass_convert_switch > just before switch lowering. > > Patch can bootstrap on x86_64-linux-gnu and survives regression tests. > > Ready to be installed? Hmm. I was thinking of mov

[PATCH] Add one more pass_convert_switch late.

2019-11-14 Thread Martin Liška
Hi. As mentioned in the PR, the patch adds one more late pass_convert_switch just before switch lowering. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin gcc/ChangeLog: 2019-11-13 Martin Liska PR tree-optimization/92005