Re: [PATCH][RTL-ifcvt] Make non-conditional execution if-conversion more aggressive

2015-09-05 Thread H.J. Lu
On Wed, Sep 2, 2015 at 9:01 AM, Kyrill Tkachov wrote: > > On 02/09/15 16:18, Zamyatin, Igor wrote: >>> >>> >>> On 19/08/15 17:57, Jeff Law wrote: On 08/12/2015 08:31 AM, Kyrill Tkachov wrote: > > 2015-08-10 Kyrylo Tkachov >

RE: [PATCH][RTL-ifcvt] Make non-conditional execution if-conversion more aggressive

2015-09-02 Thread Zamyatin, Igor
> > > On 19/08/15 17:57, Jeff Law wrote: > > On 08/12/2015 08:31 AM, Kyrill Tkachov wrote: > >> 2015-08-10 Kyrylo Tkachov > >> > >> * ifcvt.c (struct noce_if_info): Add then_simple, else_simple, > >> then_cost, else_cost fields. Change branch_cost field to

Re: [PATCH][RTL-ifcvt] Make non-conditional execution if-conversion more aggressive

2015-09-02 Thread Kyrill Tkachov
On 02/09/15 16:18, Zamyatin, Igor wrote: On 19/08/15 17:57, Jeff Law wrote: On 08/12/2015 08:31 AM, Kyrill Tkachov wrote: 2015-08-10 Kyrylo Tkachov * ifcvt.c (struct noce_if_info): Add then_simple, else_simple, then_cost, else_cost fields. Change

Re: [PATCH][RTL-ifcvt] Make non-conditional execution if-conversion more aggressive

2015-09-02 Thread Jeff Law
On 09/02/2015 09:18 AM, Zamyatin, Igor wrote: On 19/08/15 17:57, Jeff Law wrote: On 08/12/2015 08:31 AM, Kyrill Tkachov wrote: 2015-08-10 Kyrylo Tkachov * ifcvt.c (struct noce_if_info): Add then_simple, else_simple, then_cost, else_cost fields.

RE: [PATCH][RTL-ifcvt] Make non-conditional execution if-conversion more aggressive

2015-08-19 Thread Kyrill Tkachov
-Fischer; GCC Patches Subject: Re: [PATCH][RTL-ifcvt] Make non-conditional execution if- conversion more aggressive On 11/08/15 18:09, Kyrill Tkachov wrote: On 11/08/15 18:05, Jeff Law wrote: On 08/09/2015 03:20 PM, Steven Bosscher wrote: On Fri, Jul 31, 2015 at 7:26 PM, Jeff Law l

Re: [PATCH][RTL-ifcvt] Make non-conditional execution if-conversion more aggressive

2015-08-19 Thread Kyrill Tkachov
On 19/08/15 17:57, Jeff Law wrote: On 08/12/2015 08:31 AM, Kyrill Tkachov wrote: 2015-08-10 Kyrylo Tkachov kyrylo.tkac...@arm.com * ifcvt.c (struct noce_if_info): Add then_simple, else_simple, then_cost, else_cost fields. Change branch_cost field to unsigned int.

Re: [PATCH][RTL-ifcvt] Make non-conditional execution if-conversion more aggressive

2015-08-19 Thread Jeff Law
On 08/12/2015 08:31 AM, Kyrill Tkachov wrote: 2015-08-10 Kyrylo Tkachov kyrylo.tkac...@arm.com * ifcvt.c (struct noce_if_info): Add then_simple, else_simple, then_cost, else_cost fields. Change branch_cost field to unsigned int. (end_ifcvt_sequence): Call set_used_flags on

Re: [PATCH][RTL-ifcvt] Make non-conditional execution if-conversion more aggressive

2015-08-19 Thread Jeff Law
On 08/19/2015 11:20 AM, Kyrill Tkachov wrote: Hmmm... The function bb_valid_for_noce_process_p that we call early on in noce_process_if_block makes sure that the only live reg out of each basic block is the final common destination ('x' in the noce_if_info struct definition). Since both basic

Re: [PATCH][RTL-ifcvt] Make non-conditional execution if-conversion more aggressive

2015-08-12 Thread Kyrill Tkachov
On 11/08/15 18:09, Kyrill Tkachov wrote: On 11/08/15 18:05, Jeff Law wrote: On 08/09/2015 03:20 PM, Steven Bosscher wrote: On Fri, Jul 31, 2015 at 7:26 PM, Jeff Law l...@redhat.com wrote: So there's a tight relationship between the implementation of bbs_ok_for_cmove_arith and

Re: [PATCH][RTL-ifcvt] Make non-conditional execution if-conversion more aggressive

2015-08-11 Thread Jeff Law
On 08/09/2015 03:20 PM, Steven Bosscher wrote: On Fri, Jul 31, 2015 at 7:26 PM, Jeff Law l...@redhat.com wrote: So there's a tight relationship between the implementation of bbs_ok_for_cmove_arith and insn_valid_noce_process_p. If there wasn't, then we'd probably be looking to use note_stores

Re: [PATCH][RTL-ifcvt] Make non-conditional execution if-conversion more aggressive

2015-08-11 Thread Kyrill Tkachov
On 11/08/15 18:05, Jeff Law wrote: On 08/09/2015 03:20 PM, Steven Bosscher wrote: On Fri, Jul 31, 2015 at 7:26 PM, Jeff Law l...@redhat.com wrote: So there's a tight relationship between the implementation of bbs_ok_for_cmove_arith and insn_valid_noce_process_p. If there wasn't, then we'd

Re: [PATCH][RTL-ifcvt] Make non-conditional execution if-conversion more aggressive

2015-08-09 Thread Steven Bosscher
On Fri, Jul 31, 2015 at 7:26 PM, Jeff Law l...@redhat.com wrote: So there's a tight relationship between the implementation of bbs_ok_for_cmove_arith and insn_valid_noce_process_p. If there wasn't, then we'd probably be looking to use note_stores and note_uses. Perhaps I'm missing something,

Re: [PATCH][RTL-ifcvt] Make non-conditional execution if-conversion more aggressive

2015-07-31 Thread Jeff Law
On 07/27/2015 10:40 AM, Kyrill Tkachov wrote: On 27/07/15 17:09, Jeff Law wrote: On 07/27/2015 04:17 AM, Kyrill Tkachov wrote: I experimented with resource.c and the roadblock I hit is that it seems to have an assumption that it operates on hard regs (in fact the struct it uses to describe

Re: [PATCH][RTL-ifcvt] Make non-conditional execution if-conversion more aggressive

2015-07-31 Thread Jeff Law
On 07/28/2015 04:14 AM, Kyrill Tkachov wrote: [ Snip ] Here's a respin. I've reworked bbs_ok_for_cmove_arith to go over BB_A once and record the set registers then go over BB_B once and look inside the SET_SRC of each insn for those registers. How does this look? Would you like me to

Re: [PATCH][RTL-ifcvt] Make non-conditional execution if-conversion more aggressive

2015-07-28 Thread Kyrill Tkachov
Hi Jeff, On 27/07/15 17:40, Kyrill Tkachov wrote: On 27/07/15 17:09, Jeff Law wrote: On 07/27/2015 04:17 AM, Kyrill Tkachov wrote: I experimented with resource.c and the roadblock I hit is that it seems to have an assumption that it operates on hard regs (in fact the struct it uses to

Re: [PATCH][RTL-ifcvt] Make non-conditional execution if-conversion more aggressive

2015-07-27 Thread Jeff Law
On 07/27/2015 04:17 AM, Kyrill Tkachov wrote: I experimented with resource.c and the roadblock I hit is that it seems to have an assumption that it operates on hard regs (in fact the struct it uses to describe the resources has a HARD_REG_SET for the regs) and so it triggers various

Re: [PATCH][RTL-ifcvt] Make non-conditional execution if-conversion more aggressive

2015-07-27 Thread Kyrill Tkachov
On 27/07/15 17:09, Jeff Law wrote: On 07/27/2015 04:17 AM, Kyrill Tkachov wrote: I experimented with resource.c and the roadblock I hit is that it seems to have an assumption that it operates on hard regs (in fact the struct it uses to describe the resources has a HARD_REG_SET for the regs)

Re: [PATCH][RTL-ifcvt] Make non-conditional execution if-conversion more aggressive

2015-07-27 Thread Kyrill Tkachov
Hi Jeff, On 24/07/15 19:43, Jeff Law wrote: On 07/24/2015 03:31 AM, Kyrill Tkachov wrote: Wouldn't it be better to walk BB_A, gathering the set of all the registers modified, then do a single walk through BB testing for uses of those registers? I think so, yes. I'll try that. You might look

Re: [PATCH][RTL-ifcvt] Make non-conditional execution if-conversion more aggressive

2015-07-24 Thread Kyrill Tkachov
On 23/07/15 21:38, Jeff Law wrote: On 07/13/2015 08:03 AM, Kyrill Tkachov wrote: 2015-07-13 Kyrylo Tkachov kyrylo.tkac...@arm.com * ifcvt.c (struct noce_if_info): Add then_simple, else_simple, then_cost, else_cost fields. Change branch_cost field to unsigned int.

Re: [PATCH][RTL-ifcvt] Make non-conditional execution if-conversion more aggressive

2015-07-24 Thread Jeff Law
On 07/24/2015 03:31 AM, Kyrill Tkachov wrote: Wouldn't it be better to walk BB_A, gathering the set of all the registers modified, then do a single walk through BB testing for uses of those registers? I think so, yes. I'll try that. You might look at resource.c -- I haven't looked at it in a

Re: [PATCH][RTL-ifcvt] Make non-conditional execution if-conversion more aggressive

2015-07-23 Thread Jeff Law
On 07/13/2015 08:03 AM, Kyrill Tkachov wrote: 2015-07-13 Kyrylo Tkachov kyrylo.tkac...@arm.com * ifcvt.c (struct noce_if_info): Add then_simple, else_simple, then_cost, else_cost fields. Change branch_cost field to unsigned int. (end_ifcvt_sequence): Call set_used_flags on

Re: [PATCH][RTL-ifcvt] Make non-conditional execution if-conversion more aggressive

2015-07-20 Thread Kyrill Tkachov
Ping. https://gcc.gnu.org/ml/gcc-patches/2015-07/msg01047.html The go testsuite passes for me on x86_64-unknown-linux-gnu for me. A third data point on testing would be appreciated... Thanks, Kyrill On 13/07/15 15:03, Kyrill Tkachov wrote: Hi Bernhard, On 13/07/15 10:45, Kyrill Tkachov

Re: [PATCH][RTL-ifcvt] Make non-conditional execution if-conversion more aggressive

2015-07-13 Thread Kyrill Tkachov
Hi Bernhard, On 11/07/15 00:00, Bernhard Reutner-Fischer wrote: On 10 July 2015 at 14:31, Kyrill Tkachov kyrylo.tkac...@arm.com wrote: Hi all, This patch makes if-conversion more aggressive when handling code of the form: if (test) x := a //THEN else x := b //ELSE The current code

Re: [PATCH][RTL-ifcvt] Make non-conditional execution if-conversion more aggressive

2015-07-13 Thread Bernhard Reutner-Fischer
On July 13, 2015 11:45:55 AM GMT+02:00, Kyrill Tkachov kyrylo.tkac...@arm.com wrote: Hi Bernhard, Did you include go in your testing? I see: Unexpected results in this build (new failures) FAIL: encoding/json FAIL: go/printer FAIL: go/scanner FAIL: html/template FAIL: log FAIL:

Re: [PATCH][RTL-ifcvt] Make non-conditional execution if-conversion more aggressive

2015-07-13 Thread Kyrill Tkachov
On 13/07/15 10:45, Kyrill Tkachov wrote: +/* Return iff the registers that the insns in BB_A set do not + get used in BB_B. */ Return true iff I tried to be too formal here ;) https://en.wikipedia.org/wiki/If_and_only_if I'll use a normal if here. Err, of course you were talking about

Re: [PATCH][RTL-ifcvt] Make non-conditional execution if-conversion more aggressive

2015-07-13 Thread Kyrill Tkachov
Hi Bernhard, On 13/07/15 10:45, Kyrill Tkachov wrote: PS: no -mbranch-cost and, a tad more seriously, no --param branch-cost either ;) PPS: attached meant to illustrate comments above. Untested. Thanks a lot! This is all very helpful. I'll respin the patch. Here it is. I've expanded the

Re: [PATCH][RTL-ifcvt] Make non-conditional execution if-conversion more aggressive

2015-07-13 Thread Kyrill Tkachov
On 13/07/15 11:48, Bernhard Reutner-Fischer wrote: On July 13, 2015 11:45:55 AM GMT+02:00, Kyrill Tkachov kyrylo.tkac...@arm.com wrote: Hi Bernhard, Did you include go in your testing? I see: Unexpected results in this build (new failures) FAIL: encoding/json FAIL: go/printer FAIL:

[PATCH][RTL-ifcvt] Make non-conditional execution if-conversion more aggressive

2015-07-10 Thread Kyrill Tkachov
Hi all, This patch makes if-conversion more aggressive when handling code of the form: if (test) x := a //THEN else x := b //ELSE Currently, we can handle this case only if x:=a and x:=b are simple single set instructions. With this patch we will be able to handle the cases where x:=a

Re: [PATCH][RTL-ifcvt] Make non-conditional execution if-conversion more aggressive

2015-07-10 Thread Kyrill Tkachov
On 10/07/15 13:31, Kyrill Tkachov wrote: + to compute a value for x. Put the rtx cost of the insns + in TEST_BB into COST. Record whether TEST_BB is a single simple + set instruction in SIMPLE_P. If the bb is not simple place all insns + except the last insn into SEQ. */ + That

Re: [PATCH][RTL-ifcvt] Make non-conditional execution if-conversion more aggressive

2015-07-10 Thread Bernhard Reutner-Fischer
On 10 July 2015 at 14:31, Kyrill Tkachov kyrylo.tkac...@arm.com wrote: Hi all, This patch makes if-conversion more aggressive when handling code of the form: if (test) x := a //THEN else x := b //ELSE The current code adds the costs of both the THEN and ELSE blocks and proceeds

Re: [PATCH][RTL-ifcvt] Make non-conditional execution if-conversion more aggressive

2015-07-10 Thread Bernhard Reutner-Fischer
On 11 July 2015 at 01:00, Bernhard Reutner-Fischer rep.dot@gmail.com wrote: On 10 July 2015 at 14:31, Kyrill Tkachov kyrylo.tkac...@arm.com wrote: PS: no -mbranch-cost and, a tad more seriously, no --param branch-cost either ;) err, arm and aarch64 have no -mbranch-cost, a couple of