On 16/09/16 11:45, Bernd Schmidt wrote:
On 09/16/2016 10:40 AM, Kyrill Tkachov wrote:

2016-09-16  Kyrylo Tkachov  <kyrylo.tkac...@arm.com>

    * simplify-rtx.c (simplify_relational_operation_1): Add transformation
    (GTU (PLUS a C) (C - 1)) --> (LTU a -C).

2016-09-16  Kyrylo Tkachov  <kyrylo.tkac...@arm.com>

    * gcc.target/aarch64/gtu_to_ltu_cmp_1.c: New test.

Ok. Don't know if you want to add more variants of the input code to the 
testcase to make sure they're all covered.

I'm having trouble writing testcases for variations of the original testcase as 
GCC really really wants to convert
everything to a comparison against 1 at RTL level, so only the x == -2 || x == 
-1 condition seems to trigger this.
However, testcases of the form:
unsigned int
foo (unsigned int a, unsigned int b)
  return (a + 10) > 9;

seem to trigger it, so I can add some of this form. However, these will be 
optimised by a match.pd version
of this transformation that I'm working on.



Reply via email to