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

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Feb 7 11:15:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84232

Richard Biener <rguenth at gcc dot gnu.org> 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 <rguenth at gcc dot gnu.org> ---
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

  <bb 2> [local count: 119292718]:
  MEM[(int *)&a] = 4294967296;
  MEM[(int *)&a + 8B] = 12884901890;
  MEM[(int *)&a + 16B] = 21474836484;
  MEM[(int *)&a + 24B] = 30064771078;
  vect__1.4_18 = MEM[(int *)&a];
  vect__1.4_22 = MEM[(int *)&a + 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 *)&a] = vect_cst__31;
  _2 = &a[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.


More information about the Gcc-bugs mailing list