r278354 - in /trunk/gcc: ChangeLog testsuite/Ch...

rsandifo@gcc.gnu.org rsandifo@gcc.gnu.org
Sat Nov 16 11:43:00 GMT 2019


Author: rsandifo
Date: Sat Nov 16 11:43:31 2019
New Revision: 278354

URL: https://gcc.gnu.org/viewcvs?rev=278354&root=gcc&view=rev
Log:
Use a single comparison for index-based alias checks

This patch rewrites the index-based alias checks to use conditions
of the form:

  (unsigned T) (a - b + bias) <= limit

E.g. before the patch:

  struct s { int x[100]; };

  void
  f1 (struct s *s1, int a, int b)
  {
    for (int i = 0; i < 32; ++i)
      s1->x[i + a] += s1->x[i + b];
  }

used:

        add     w3, w1, 3
        cmp     w3, w2
        add     w3, w2, 3
        ccmp    w1, w3, 0, ge
        ble     .L2

whereas after the patch it uses:

        sub     w3, w1, w2
        add     w3, w3, 3
        cmp     w3, 6
        bls     .L2

The patch also fixes the seg_len1 and seg_len2 negation for cases in
which seg_len is a "negative unsigned" value narrower than 64 bits,
like it is for 32-bit targets.  Previously we'd end up with values
like 0xffffffff000000001 instead of 1.

2019-11-16  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* tree-data-ref.c (create_intersect_range_checks_index): Rewrite
	the index tests to have the form (unsigned T) (B - A + bias) <= limit.

gcc/testsuite/
	* gcc.dg/vect/vect-alias-check-18.c: New test.
	* gcc.dg/vect/vect-alias-check-19.c: Likewise.
	* gcc.dg/vect/vect-alias-check-20.c: Likewise.

Added:
    trunk/gcc/testsuite/gcc.dg/vect/vect-alias-check-18.c
    trunk/gcc/testsuite/gcc.dg/vect/vect-alias-check-19.c
    trunk/gcc/testsuite/gcc.dg/vect/vect-alias-check-20.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-data-ref.c



More information about the Gcc-cvs mailing list