Re: [PATCH][RTL-ifcvt] Improve conditional select ops on immediates

2015-08-12 Thread Jeff Law
On 08/04/2015 02:44 AM, Kyrill Tkachov wrote: On 03/08/15 18:37, Uros Bizjak wrote: On Mon, Aug 3, 2015 at 7:20 PM, Kyrill Tkachov wrote: Looking at the x86 movcc expansion code (ix86_expand_int_movcc) I don't think this is a good idea. In the expander, there is already quite some target-dep

Re: [PATCH][RTL-ifcvt] Improve conditional select ops on immediates

2015-08-10 Thread Kyrill Tkachov
On 10/08/15 10:43, Uros Bizjak wrote: On Mon, Aug 10, 2015 at 11:36 AM, Kyrill Tkachov wrote: I'm testing a patch that fix the testcases on x86_64 and does not harm codegen on aarch64. Feel free to file a PR and assign it to me. PR67103 [1] [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=6

Re: [PATCH][RTL-ifcvt] Improve conditional select ops on immediates

2015-08-10 Thread Uros Bizjak
On Mon, Aug 10, 2015 at 11:36 AM, Kyrill Tkachov wrote: I'm testing a patch that fix the testcases on x86_64 and does not harm codegen on aarch64. Feel free to file a PR and assign it to me. >>> >>> PR67103 [1] >>> >>> [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67103 >> >> Thanks,

Re: [PATCH][RTL-ifcvt] Improve conditional select ops on immediates

2015-08-10 Thread Kyrill Tkachov
On 04/08/15 09:44, Kyrill Tkachov wrote: On 03/08/15 18:37, Uros Bizjak wrote: On Mon, Aug 3, 2015 at 7:20 PM, Kyrill Tkachov wrote: Looking at the x86 movcc expansion code (ix86_expand_int_movcc) I don't think this is a good idea. In the expander, there is already quite some target-dependen

Re: [PATCH][RTL-ifcvt] Improve conditional select ops on immediates

2015-08-04 Thread Kyrill Tkachov
On 03/08/15 18:37, Uros Bizjak wrote: On Mon, Aug 3, 2015 at 7:20 PM, Kyrill Tkachov wrote: Looking at the x86 movcc expansion code (ix86_expand_int_movcc) I don't think this is a good idea. In the expander, there is already quite some target-dependent code that goes great length to utilize s

Re: [PATCH][RTL-ifcvt] Improve conditional select ops on immediates

2015-08-03 Thread Uros Bizjak
On Mon, Aug 3, 2015 at 7:20 PM, Kyrill Tkachov wrote: > Looking at the x86 movcc expansion code (ix86_expand_int_movcc) I > don't think this is a good idea. In the expander, there is already > quite some target-dependent code that goes great length to utilize sbb > insn as much as

Re: [PATCH][RTL-ifcvt] Improve conditional select ops on immediates

2015-08-03 Thread Kyrill Tkachov
On 03/08/15 16:53, Kyrill Tkachov wrote: On 03/08/15 16:45, Uros Bizjak wrote: On Mon, Aug 3, 2015 at 5:37 PM, Kyrill Tkachov wrote: Looking at the x86 movcc expansion code (ix86_expand_int_movcc) I don't think this is a good idea. In the expander, there is already quite some target-dependen

Re: [PATCH][RTL-ifcvt] Improve conditional select ops on immediates

2015-08-03 Thread Jeff Law
On 08/03/2015 09:50 AM, Ilya Enkovich wrote: The original code looks better, tree height is just 2 and therefore it can be executed in 2 cycles. New code has more dependencies and tree height becomes 5. It is always hard to say for all x86 targets but as a generic code the original version is b

Re: [PATCH][RTL-ifcvt] Improve conditional select ops on immediates

2015-08-03 Thread Kyrill Tkachov
On 03/08/15 16:45, Uros Bizjak wrote: On Mon, Aug 3, 2015 at 5:37 PM, Kyrill Tkachov wrote: Looking at the x86 movcc expansion code (ix86_expand_int_movcc) I don't think this is a good idea. In the expander, there is already quite some target-dependent code that goes great length to utilize s

Re: [PATCH][RTL-ifcvt] Improve conditional select ops on immediates

2015-08-03 Thread Ilya Enkovich
2015-08-03 17:04 GMT+03:00 Uros Bizjak : > On Mon, Aug 3, 2015 at 3:02 PM, Kyrill Tkachov wrote: >> >> On 03/08/15 13:33, Uros Bizjak wrote: >>> >>> Hello! >>> 2015-07-30 Kyrylo Tkachov * ifcvt.c (noce_try_store_flag_constants): Make logic of the case when diff ==

Re: [PATCH][RTL-ifcvt] Improve conditional select ops on immediates

2015-08-03 Thread Uros Bizjak
On Mon, Aug 3, 2015 at 5:37 PM, Kyrill Tkachov wrote: >> Looking at the x86 movcc expansion code (ix86_expand_int_movcc) I >> don't think this is a good idea. In the expander, there is already >> quite some target-dependent code that goes great length to utilize sbb >> insn as much as possible, b

Re: [PATCH][RTL-ifcvt] Improve conditional select ops on immediates

2015-08-03 Thread Kyrill Tkachov
On 03/08/15 15:15, Uros Bizjak wrote: On Mon, Aug 3, 2015 at 3:43 PM, Kyrill Tkachov wrote: On 03/08/15 14:37, Uros Bizjak wrote: On Mon, Aug 3, 2015 at 3:02 PM, Kyrill Tkachov wrote: On 03/08/15 13:33, Uros Bizjak wrote: Hello! 2015-07-30 Kyrylo Tkachov * ifcvt.c (noce_try_st

Re: [PATCH][RTL-ifcvt] Improve conditional select ops on immediates

2015-08-03 Thread H.J. Lu
On Mon, Aug 3, 2015 at 7:04 AM, Uros Bizjak wrote: > On Mon, Aug 3, 2015 at 3:02 PM, Kyrill Tkachov wrote: >> >> On 03/08/15 13:33, Uros Bizjak wrote: >>> >>> Hello! >>> 2015-07-30 Kyrylo Tkachov * ifcvt.c (noce_try_store_flag_constants): Make logic of the case wh

Re: [PATCH][RTL-ifcvt] Improve conditional select ops on immediates

2015-08-03 Thread Uros Bizjak
On Mon, Aug 3, 2015 at 3:43 PM, Kyrill Tkachov wrote: > > On 03/08/15 14:37, Uros Bizjak wrote: >> >> On Mon, Aug 3, 2015 at 3:02 PM, Kyrill Tkachov >> wrote: >>> >>> On 03/08/15 13:33, Uros Bizjak wrote: Hello! > 2015-07-30 Kyrylo Tkachov > > * ifcvt.c (noce_t

Re: [PATCH][RTL-ifcvt] Improve conditional select ops on immediates

2015-08-03 Thread Kyrill Tkachov
On 03/08/15 14:43, Kyrill Tkachov wrote: On 03/08/15 14:37, Uros Bizjak wrote: On Mon, Aug 3, 2015 at 3:02 PM, Kyrill Tkachov wrote: On 03/08/15 13:33, Uros Bizjak wrote: Hello! 2015-07-30 Kyrylo Tkachov * ifcvt.c (noce_try_store_flag_constants): Make logic of the case wh

Re: [PATCH][RTL-ifcvt] Improve conditional select ops on immediates

2015-08-03 Thread Uros Bizjak
On Mon, Aug 3, 2015 at 3:02 PM, Kyrill Tkachov wrote: > > On 03/08/15 13:33, Uros Bizjak wrote: >> >> Hello! >> >>> 2015-07-30 Kyrylo Tkachov >>> >>> * ifcvt.c (noce_try_store_flag_constants): Make logic of the case >>> when diff == STORE_FLAG_VALUE or diff == -STORE_FLAG_VALUE more >

Re: [PATCH][RTL-ifcvt] Improve conditional select ops on immediates

2015-08-03 Thread Kyrill Tkachov
On 03/08/15 14:37, Uros Bizjak wrote: On Mon, Aug 3, 2015 at 3:02 PM, Kyrill Tkachov wrote: On 03/08/15 13:33, Uros Bizjak wrote: Hello! 2015-07-30 Kyrylo Tkachov * ifcvt.c (noce_try_store_flag_constants): Make logic of the case when diff == STORE_FLAG_VALUE or diff == -STOR

Re: [PATCH][RTL-ifcvt] Improve conditional select ops on immediates

2015-08-03 Thread Uros Bizjak
On Mon, Aug 3, 2015 at 3:02 PM, Kyrill Tkachov wrote: > > On 03/08/15 13:33, Uros Bizjak wrote: >> >> Hello! >> >>> 2015-07-30 Kyrylo Tkachov >>> >>> * ifcvt.c (noce_try_store_flag_constants): Make logic of the case >>> when diff == STORE_FLAG_VALUE or diff == -STORE_FLAG_VALUE more >

Re: [PATCH][RTL-ifcvt] Improve conditional select ops on immediates

2015-08-03 Thread Kyrill Tkachov
On 03/08/15 13:33, Uros Bizjak wrote: Hello! 2015-07-30 Kyrylo Tkachov * ifcvt.c (noce_try_store_flag_constants): Make logic of the case when diff == STORE_FLAG_VALUE or diff == -STORE_FLAG_VALUE more explicit. Prefer to add the flag whenever possible. (noce_process_if

Re: [PATCH][RTL-ifcvt] Improve conditional select ops on immediates

2015-08-03 Thread Uros Bizjak
Hello! > 2015-07-30 Kyrylo Tkachov > > * ifcvt.c (noce_try_store_flag_constants): Make logic of the case > when diff == STORE_FLAG_VALUE or diff == -STORE_FLAG_VALUE more > explicit. Prefer to add the flag whenever possible. > (noce_process_if_block): Try noce_try_store_flag_co

Re: [PATCH][RTL-ifcvt] Improve conditional select ops on immediates

2015-07-31 Thread Jeff Law
On 07/30/2015 07:42 AM, Kyrill Tkachov wrote: Hi Jeff, On 29/07/15 23:38, Jeff Law wrote: On 07/29/2015 07:49 AM, Kyrill Tkachov wrote: Hi all, This patch improves RTL if-conversion on sequences that perform a conditional select on integer constants. Most of the smart logic to do that already

Re: [PATCH][RTL-ifcvt] Improve conditional select ops on immediates

2015-07-30 Thread Kyrill Tkachov
Hi Jeff, On 29/07/15 23:38, Jeff Law wrote: On 07/29/2015 07:49 AM, Kyrill Tkachov wrote: Hi all, This patch improves RTL if-conversion on sequences that perform a conditional select on integer constants. Most of the smart logic to do that already exists in the noce_try_store_flag_constants fu

Re: [PATCH][RTL-ifcvt] Improve conditional select ops on immediates

2015-07-29 Thread Jeff Law
On 07/29/2015 07:49 AM, Kyrill Tkachov wrote: Hi all, This patch improves RTL if-conversion on sequences that perform a conditional select on integer constants. Most of the smart logic to do that already exists in the noce_try_store_flag_constants function. However, currently that function is tr

[PATCH][RTL-ifcvt] Improve conditional select ops on immediates

2015-07-29 Thread Kyrill Tkachov
Hi all, This patch improves RTL if-conversion on sequences that perform a conditional select on integer constants. Most of the smart logic to do that already exists in the noce_try_store_flag_constants function. However, currently that function is tried after noce_try_cmove. noce_try_cmove is a