On Thu, Oct 05, 2023 at 04:42:42PM +0200, Jan Hubicka wrote:
> It does look like a nice cleanup to me.
> I wonder if you did some compare of the bit information propagated with
> new code and old code?  Theoretically they should be equivalent?

Beyond testsuite, I've tried
__attribute__((noinline, noclone)) static int
foo (int x, int y, int *p)
{
  return p[x + y];
}

__attribute__((noinline, noclone)) static int
bar (int x, int y, int *p)
{
  return foo (x, y & 0xff, p);
}

int
baz (int x, int y, int *p)
{
  return bar ((x & 0x55555555) | 0x12345678, (x & 0xaaaaaaaa) | 0x87654321, 
__builtin_assume_aligned (p, 32, 16));
}
and -fdump-tree-ccp2-alias was identical before/after the patch,
so the expected
  # RANGE [irange] int [305419896, +INF] MASK 0x45410105 VALUE 0x12345678
  int x_5(D) = x;
  # RANGE [irange] int [0, 255] MASK 0x8a VALUE 0x21
  int y_6(D) = y;
  # PT = nonlocal null
  # ALIGN = 32, MISALIGN = 16
  int * p_7(D) = p;
in foo (-O2).  With -O2 -fno-ipa-vrp
  # RANGE [irange] int [-INF, +INF] MASK 0x45410105 VALUE 0x12345678
  int x_5(D) = x;
  # RANGE [irange] int [-INF, +INF] MASK 0x8a VALUE 0x21
  int y_6(D) = y;
  # PT = nonlocal null
  # ALIGN = 32, MISALIGN = 16
  int * p_7(D) = p;
and -O2 -fno-ipa-bit-cp
  # RANGE [irange] int [305419896, +INF] MASK 0x45410105 VALUE 0x12345678
  int x_5(D) = x;
  # RANGE [irange] int [0, 255] MASK 0x8a VALUE 0x21
  int y_6(D) = y;
  # PT = nonlocal null
  int * p_7(D) = p;
All that is the same as before.

        Jakub

Reply via email to