[RFC][PATCH][mid-end] Optimize immediate choice in comparisons.

2018-08-07 Thread Vlad Lazar
Hi. This patch optimises the choice of immediates in integer comparisons. Integer comparisons allow for different choices (e.g. a > b is equivalent to a >= b+1) and there are cases where an incremented/decremented immediate can be loaded into a register in fewer instructions. The cases are as fo

Re: [RFC][PATCH][mid-end] Optimize immediate choice in comparisons.

2018-08-07 Thread Richard Sandiford
Hi Vlad, Thanks for the patch. Vlad Lazar writes: > Hi. > > This patch optimises the choice of immediates in integer comparisons. Integer > comparisons allow for different choices (e.g. a > b is equivalent to a >= b+1) > and there are cases where an incremented/decremented immediate can be loade

Re: [RFC][PATCH][mid-end] Optimize immediate choice in comparisons.

2018-08-08 Thread Jeff Law
On 08/07/2018 02:11 PM, Richard Sandiford wrote: > Hi Vlad, > > Thanks for the patch. > > Vlad Lazar writes: >> Hi. >> >> This patch optimises the choice of immediates in integer comparisons. Integer >> comparisons allow for different choices (e.g. a > b is equivalent to a >= >> b+1) >> and the

Re: [RFC][PATCH][mid-end] Optimize immediate choice in comparisons.

2018-08-10 Thread Vlad Lazar
On 09/08/18 06:48, Jeff Law wrote: On 08/07/2018 02:11 PM, Richard Sandiford wrote: Hi Vlad, Thanks for the patch. Vlad Lazar writes: Hi. This patch optimises the choice of immediates in integer comparisons. Integer comparisons allow for different choices (e.g. a > b is equivalent to a >= b

Re: [RFC][PATCH][mid-end] Optimize immediate choice in comparisons.

2018-08-13 Thread Richard Sandiford
Vlad Lazar writes: > diff --git a/gcc/expmed.h b/gcc/expmed.h > index > 2890d9c9bbd034f01030dd551d544bf73e73b784..86a32a643fdd0fc9f396bd2c7904244bd484df16 > 100644 > --- a/gcc/expmed.h > +++ b/gcc/expmed.h > @@ -702,6 +702,10 @@ extern rtx emit_store_flag (rtx, enum rtx_code, rtx, > rtx, machin

Re: [RFC][PATCH][mid-end] Optimize immediate choice in comparisons.

2018-08-14 Thread Vlad Lazar
On 13/08/18 15:00, Richard Sandiford wrote: Vlad Lazar writes: diff --git a/gcc/expmed.h b/gcc/expmed.h index 2890d9c9bbd034f01030dd551d544bf73e73b784..86a32a643fdd0fc9f396bd2c7904244bd484df16 100644 --- a/gcc/expmed.h +++ b/gcc/expmed.h @@ -702,6 +702,10 @@ extern rtx emit_store_flag (rtx, e

Re: [RFC][PATCH][mid-end] Optimize immediate choice in comparisons.

2018-08-16 Thread Richard Sandiford
Vlad Lazar writes: > On 13/08/18 15:00, Richard Sandiford wrote: >> Vlad Lazar writes: >>> diff --git a/gcc/expmed.h b/gcc/expmed.h >>> index >>> 2890d9c9bbd034f01030dd551d544bf73e73b784..86a32a643fdd0fc9f396bd2c7904244bd484df16 >>> 100644 >>> --- a/gcc/expmed.h >>> +++ b/gcc/expmed.h >>> @@ -7

Re: [RFC][PATCH][mid-end] Optimize immediate choice in comparisons.

2018-08-16 Thread Jeff Law
On 08/14/2018 11:01 AM, Vlad Lazar wrote: > On 13/08/18 15:00, Richard Sandiford wrote: >> Vlad Lazar writes: >>> diff --git a/gcc/expmed.h b/gcc/expmed.h >>> index >>> 2890d9c9bbd034f01030dd551d544bf73e73b784..86a32a643fdd0fc9f396bd2c7904244bd484df16 >>> 100644 >>> --- a/gcc/expmed.h >>> +++ b/gc

Re: [RFC][PATCH][mid-end] Optimize immediate choice in comparisons.

2018-08-16 Thread Vlad Lazar
On 16/08/18 17:35, Jeff Law wrote: On 08/14/2018 11:01 AM, Vlad Lazar wrote: On 13/08/18 15:00, Richard Sandiford wrote: Vlad Lazar writes: diff --git a/gcc/expmed.h b/gcc/expmed.h index 2890d9c9bbd034f01030dd551d544bf73e73b784..86a32a643fdd0fc9f396bd2c7904244bd484df16 100644 --- a/gcc/expmed

Re: [RFC][PATCH][mid-end] Optimize immediate choice in comparisons.

2018-08-16 Thread Jeff Law
On 08/16/2018 10:46 AM, Vlad Lazar wrote: >> Thanks.  I fixed up the ChangeLog entry and installed this on the trunk. >> >> Richard S -- thanks for working with Vlad to push this forward. >> >> jeff >> > Thanks for committing.  Sorry about the ChangeLog. No worries. Just trivial stuff that we deal

Re: [RFC][PATCH][mid-end] Optimize immediate choice in comparisons.

2018-08-18 Thread Uros Bizjak
Hello! >> gcc/testsuite/ >> Changelog for gcc/testsuite/Changelog >> 2018-08-14 Vlad Lazar >> >> * gcc.target/aarch64/imm_choice_comparison.c: New. >> >> gcc/ >> Changelog for gcc/Changelog >> 2018-08-14 Vlad Lazar >> * expmed.h (canonicalize_comparison): New declaration. >> * ex

Re: [RFC][PATCH][mid-end] Optimize immediate choice in comparisons.

2018-08-18 Thread Richard Sandiford
Uros Bizjak writes: > Hello! >>> gcc/testsuite/ >>> Changelog for gcc/testsuite/Changelog >>> 2018-08-14 Vlad Lazar >>> >>> * gcc.target/aarch64/imm_choice_comparison.c: New. >>> >>> gcc/ >>> Changelog for gcc/Changelog >>> 2018-08-14 Vlad Lazar >>> * expmed.h (canonicalize_compariso