[Bug tree-optimization/84232] [8 regression] gcc.dg/tree-ssa/ssa-dom-cse-2.c fail with -march=silvermont

2018-02-08 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84232

Jakub Jelinek  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from Jakub Jelinek  ---
Fixed.

[Bug tree-optimization/84232] [8 regression] gcc.dg/tree-ssa/ssa-dom-cse-2.c fail with -march=silvermont

2018-02-08 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84232

--- Comment #3 from Jakub Jelinek  ---
Author: jakub
Date: Fri Feb  9 06:44:43 2018
New Revision: 257516

URL: https://gcc.gnu.org/viewcvs?rev=257516=gcc=rev
Log:
PR tree-optimization/84232
* gcc.dg/tree-ssa/ssa-dom-cse-2.c: Add -mtune-generic on x86.

Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-cse-2.c

[Bug tree-optimization/84232] [8 regression] gcc.dg/tree-ssa/ssa-dom-cse-2.c fail with -march=silvermont

2018-02-08 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84232

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  ---
Created attachment 43372
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43372=edit
gcc8-pr84232.patch

So shall we then just force -mtune=generic, at least until DOM/SLP is extended
to handle this?

[Bug tree-optimization/84232] [8 regression] gcc.dg/tree-ssa/ssa-dom-cse-2.c fail with -march=silvermont

2018-02-07 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84232

Richard Biener  changed:

   What|Removed |Added

   Keywords||missed-optimization
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-02-07
   Target Milestone|--- |8.0
Summary|[8 regression]  |[8 regression]
   |gcc.dg/tree-ssa/ssa-dom-cse |gcc.dg/tree-ssa/ssa-dom-cse
   |-2.c fail   |-2.c fail with
   ||-march=silvermont
 Ever confirmed|0   |1

--- Comment #1 from Richard Biener  ---
It works for me with stock settings.  With -march=silvermont I see constant
init not vectorized and thus a similar situation as in

/* On alpha, the vectorizer generates writes of two vector elements at once,
   but the loop reads only one element at a time, and DOM cannot resolve these.
   The same happens on powerpc depending on the SIMD support available.  */

/* { dg-final { scan-tree-dump "return 28;" "optimized" { xfail { { alpha*-*-*
hppa*64*-*-* nvptx*-*-* } || { { { lp64 && { powerpc*-*-* sparc*-*-* riscv*-*-*
} } || aarch64_sve } || { arm*-*-* && { ! arm_neon } } } } } } } */

IL is

   [local count: 119292718]:
  MEM[(int *)] = 4294967296;
  MEM[(int *) + 8B] = 12884901890;
  MEM[(int *) + 16B] = 21474836484;
  MEM[(int *) + 24B] = 30064771078;
  vect__1.4_18 = MEM[(int *)];
  vect__1.4_22 = MEM[(int *) + 16B];

and DOM cannot resolve this.  Without silvermont I see

  vect_cst__31 = { 0, 1, 2, 3 };
  vect_cst__24 = { 4, 5, 6, 7 };
  MEM[(int *)] = vect_cst__31;
  _2 = [0] + 16;
  MEM[(int *)_2] = vect_cst__24;

for the stores which matches the vector reads.  The cost model changes
now properly cost two constant vectors while it costed one before.
constant vectors are costed as aligned vector loads (from the constant pool).

This is a kown limitation of DOM/SLP.