public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization)
@ 2012-11-15  2:27 hubicka at gcc dot gnu.org
  2012-11-15  7:11 ` [Bug tree-optimization/55334] " vincenzo.innocente at cern dot ch
                   ` (50 more replies)
  0 siblings, 51 replies; 52+ messages in thread
From: hubicka at gcc dot gnu.org @ 2012-11-15  2:27 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334

             Bug #: 55334
           Summary: mgrid regression (ipa-cp disables vectorization)
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: hubicka@gcc.gnu.org


mgrid has regressed noticeably
http://gcc.opensuse.org/SPEC/CFP/sb-frescobaldi.suse.de-head-64/172_mgrid_big.png

This seems to be related to function resid_ that we now clone
  Creating a specialized node of resid/1.
    replacing param u with const &x.u
    replacing param v with const &x.v
    replacing param r with const &x.r
    replacing param a with const &x.a

Both variants stays in the code. When compiling resid vectorizer succeeds.

The difference seems to be:
191: vect_compute_data_ref_alignment:
191: Unknown alignment for access: *v_41(D)
191: vect_compute_data_ref_alignment:
191: Unknown alignment for access: *u_45(D)
191: vect_compute_data_ref_alignment:
191: Unknown alignment for access: *u_45(D)
191: vect_compute_data_ref_alignment:
191: Unknown alignment for access: *u_45(D)
191: vect_compute_data_ref_alignment:
191: Unknown alignment for access: *u_45(D)
191: vect_compute_data_ref_alignment:
191: Unknown alignment for access: *u_45(D)
191: vect_compute_data_ref_alignment:
191: Unknown alignment for access: *u_45(D)
191: vect_compute_data_ref_alignment:
191: Unknown alignment for access: *u_45(D)
191: vect_compute_data_ref_alignment:
191: Unknown alignment for access: *u_45(D)
191: vect_compute_data_ref_alignment:
191: Unknown alignment for access: *u_45(D)

being changed to
191: vect_compute_data_ref_alignment:
191: Unknown alignment for access: x
191: vect_compute_data_ref_alignment:
191: misalign = 0 bytes of ref MEM[(real(kind=8)[4] *)&x + 58071104B][0]
191: vect_compute_data_ref_alignment:
191: Unknown alignment for access: x
191: vect_compute_data_ref_alignment:
191: misalign = 8 bytes of ref MEM[(real(kind=8)[4] *)&x + 58071104B][1]
191: vect_compute_data_ref_alignment:
191: Unknown alignment for access: x
191: vect_compute_data_ref_alignment:
191: Unknown alignment for access: x
191: vect_compute_data_ref_alignment:
191: Unknown alignment for access: x
191: vect_compute_data_ref_alignment:
191: Unknown alignment for access: x
191: vect_compute_data_ref_alignment:
191: Unknown alignment for access: x

that ultimately leads to
191: === vect_prune_runtime_alias_test_list ===
191: disable versioning for alias - max number of generated checks exceeded.
191: too long list of versioning for alias run-time tests.

So it seems that specializing for particular static array = good thing leads to
vectorizer giving up.


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
@ 2012-11-15  7:11 ` vincenzo.innocente at cern dot ch
  2012-11-15 11:07 ` hubicka at gcc dot gnu.org
                   ` (49 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: vincenzo.innocente at cern dot ch @ 2012-11-15  7:11 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334

vincenzo Innocente <vincenzo.innocente at cern dot ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vincenzo.innocente at cern
                   |                            |dot ch

--- Comment #1 from vincenzo Innocente <vincenzo.innocente at cern dot ch> 2012-11-15 07:11:08 UTC ---
try
--param vect-max-version-for-alias-checks=100  o similar
it helps to vectorize most of my C++ code that suffers for gcc not handling
"restrict" properly


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
  2012-11-15  7:11 ` [Bug tree-optimization/55334] " vincenzo.innocente at cern dot ch
@ 2012-11-15 11:07 ` hubicka at gcc dot gnu.org
  2012-11-15 11:42 ` hubicka at gcc dot gnu.org
                   ` (48 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: hubicka at gcc dot gnu.org @ 2012-11-15 11:07 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334

--- Comment #2 from Jan Hubicka <hubicka at gcc dot gnu.org> 2012-11-15 11:07:10 UTC ---
I think the problem is that we somehow make MEM_REF to be base...


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
  2012-11-15  7:11 ` [Bug tree-optimization/55334] " vincenzo.innocente at cern dot ch
  2012-11-15 11:07 ` hubicka at gcc dot gnu.org
@ 2012-11-15 11:42 ` hubicka at gcc dot gnu.org
  2012-11-16 10:39 ` hubicka at gcc dot gnu.org
                   ` (47 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: hubicka at gcc dot gnu.org @ 2012-11-15 11:42 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-11-15
     Ever Confirmed|0                           |1

--- Comment #3 from Jan Hubicka <hubicka at gcc dot gnu.org> 2012-11-15 11:42:21 UTC ---
OK, it is not base_address, but base_object
Creating dr for MEM[(real(kind=8)[4] *)&x + 58071104B][0]
analyze_innermost: success.
        base_address: &x
        offset from base address: 0
        constant offset from base address: 58071104
        step: 0
        aligned to: 128
        base_object: MEM[(real(kind=8)[4] *)&x + 58071104B]
        Access function 0: 0

I do not see why we need to keep the base object to be offsetted. 
While it is first time I see the code, i think it is trying to look for
MEM_REFs and remember the fact that after putting it to 0 the offset may go
across the type boundry, since we changed the type via MEM_REF.  For
non-envolving mem-refs this however is not a problem.
I am testing the following that simply removes the constant from MEM_REF 

Index: tree-data-ref.c
===================================================================
--- tree-data-ref.c    (revision 193503)
+++ tree-data-ref.c    (working copy)
@@ -922,6 +922,16 @@ dr_analyze_indices (struct data_referenc
       DR_UNCONSTRAINED_BASE (dr) = true;
       VEC_safe_push (tree, heap, access_fns, access_fn);
     }
+      else
+    {
+      if (!integer_zerop (TREE_OPERAND (ref, 1)))
+        ref = fold_build2_loc (EXPR_LOCATION (ref),
+                   MEM_REF, TREE_TYPE (ref),
+                   op,
+                   build_int_cst (TREE_TYPE (TREE_OPERAND (ref,
+                                 1)),
+                          0));
+    }
     }
   else if (DECL_P (ref))
     {


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2012-11-15 11:42 ` hubicka at gcc dot gnu.org
@ 2012-11-16 10:39 ` hubicka at gcc dot gnu.org
  2012-11-16 10:56 ` vincenzo.innocente at cern dot ch
                   ` (46 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: hubicka at gcc dot gnu.org @ 2012-11-16 10:39 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |matz at suse dot de

--- Comment #4 from Jan Hubicka <hubicka at gcc dot gnu.org> 2012-11-16 10:39:34 UTC ---
Hmm, this does not help.  The problem is indeed that we are not able to figure
out that the accesses into subarrays of X are mutually independent.

Martin, Michael, I think you are more familiar with MEM_REF, can you take a
look?


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2012-11-16 10:39 ` hubicka at gcc dot gnu.org
@ 2012-11-16 10:56 ` vincenzo.innocente at cern dot ch
  2012-11-16 12:06 ` jakub at gcc dot gnu.org
                   ` (45 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: vincenzo.innocente at cern dot ch @ 2012-11-16 10:56 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334

--- Comment #5 from vincenzo Innocente <vincenzo.innocente at cern dot ch> 2012-11-16 10:56:11 UTC ---
is the problem similar to what described in PR55213?
or here
float mem[3*1024];
void sum() {
  float * a=mem;
  const float * b=mem+1024;
  const float * c=mem+2*1024;
  for (int i=0;i!=1024;++i)
    a[i]=b[i]+c[i];
}

6: create runtime check for data references *_7 and *_6
6: create runtime check for data references *_9 and *_6
6: created 2 versioning for alias checks.


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2012-11-16 10:56 ` vincenzo.innocente at cern dot ch
@ 2012-11-16 12:06 ` jakub at gcc dot gnu.org
  2012-11-16 13:20 ` hubicka at gcc dot gnu.org
                   ` (44 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-11-16 12:06 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-11-16 12:05:44 UTC ---
Restrict is one thing, not figuring out that disjoint accesses to the same
array don't overlap is another (i.e. the #c5 testcase).  Cast restrict is hard
to do reliably, as the referenced PR documents, while figuring out that say
Creating dr for *_7
analyze_innermost: success.
        base_address: &mem
        offset from base address: 0
        constant offset from base address: 4096
        step: 4
        aligned to: 128
        base_object: *(const float *) &mem
        Access function 0: {4096B, +, 4}_1
and
Creating dr for *_6
analyze_innermost: success.
        base_address: &mem
        offset from base address: 0
        constant offset from base address: 0
        step: 4
        aligned to: 128
        base_object: MEM[(float *)&mem]
        Access function 0: {0B, +, 4}_1
for 1024 iterations would be really nice.


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2012-11-16 12:06 ` jakub at gcc dot gnu.org
@ 2012-11-16 13:20 ` hubicka at gcc dot gnu.org
  2012-11-16 13:22 ` hubicka at gcc dot gnu.org
                   ` (43 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: hubicka at gcc dot gnu.org @ 2012-11-16 13:20 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334

--- Comment #7 from Jan Hubicka <hubicka at gcc dot gnu.org> 2012-11-16 13:19:51 UTC ---
The C testcase is simiar - in the mgrid case we are probably able to derrive
useful loop bounds now and the dependency analysis could use them (but
doesn't). I will try to look into that (though I am not really familiar with
dependency code).

In the mgrid case those are however two different subarrays of one aggregate.
They can not overlap regardless the indexes, but we throw athat info away.


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2012-11-16 13:20 ` hubicka at gcc dot gnu.org
@ 2012-11-16 13:22 ` hubicka at gcc dot gnu.org
  2012-11-16 13:29 ` jakub at gcc dot gnu.org
                   ` (42 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: hubicka at gcc dot gnu.org @ 2012-11-16 13:22 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pthaugen at gcc dot gnu.org

--- Comment #8 from Jan Hubicka <hubicka at gcc dot gnu.org> 2012-11-16 13:21:38 UTC ---
*** Bug 54497 has been marked as a duplicate of this bug. ***


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2012-11-16 13:22 ` hubicka at gcc dot gnu.org
@ 2012-11-16 13:29 ` jakub at gcc dot gnu.org
  2012-11-16 13:46 ` vincenzo.innocente at cern dot ch
                   ` (41 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-11-16 13:29 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-11-16 13:29:05 UTC ---
Ah, on the #c5 testcase the problem seems to be const float * vs. float *,

  /* If the references do not access the same object, we do not know
     whether they alias or not.  */
  if (!operand_equal_p (DR_BASE_OBJECT (a), DR_BASE_OBJECT (b), 0))
    {
      DDR_ARE_DEPENDENT (res) = chrec_dont_know;
      return res;
    }

operand_equal_p here fails because, while both base objects are MEM_REFs and
operand_equal_p (TREE_OPERAND (DR_BASE_OBJECT (a), 0), TREE_OPERAND
(DR_BASE_OBJECT (b), 0), 0) is true, the second operand of one MEM_REF is
const float *, while on the other MEM_REF it is float *, and operand_equal_p
for that tests:
...
2570  && (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_OPERAND (arg0, 1)))
2571      == TYPE_MAIN_VARIANT (TREE_TYPE (TREE_OPERAND (arg1, 1))))
2572  && OP_SAME (0) && OP_SAME (1));
and the TYPE_MAIN_VARIANT check fails.  In this case I believe we don't care
whether it points to const float or float.  Not sure if we should change
operand_equal_p to try harder if TYPE_MAIN_VARIANT of the two types isn't
equal,
but TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (TREE_OPERAND (argX, 1))))
is equal, and both pointers have the same deref alias set, or perhaps just
change the above spot to try harder on MEM_REFs if it failed.


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2012-11-16 13:29 ` jakub at gcc dot gnu.org
@ 2012-11-16 13:46 ` vincenzo.innocente at cern dot ch
  2012-11-16 13:56 ` jakub at gcc dot gnu.org
                   ` (40 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: vincenzo.innocente at cern dot ch @ 2012-11-16 13:46 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334

--- Comment #10 from vincenzo Innocente <vincenzo.innocente at cern dot ch> 2012-11-16 13:46:13 UTC ---
actually looking into the generated code I do not see any trace of "runtime
check"
even in presence of "const"

c++ -O3 -ftree-vectorizer-verbose=1 -c alias.cc 

Analyzing loop at alias.cc:6


Vectorizing loop at alias.cc:6

6: create runtime check for data references *_7 and *_6
6: create runtime check for data references *_9 and *_6
6: created 2 versioning for alias checks.

6: LOOP VECTORIZED.
alias.cc:2: note: vectorized 1 loops in function.
pb-d-128-141-131-26:vectorize innocent$ otool -v -V -t alias.o
alias.o:
(__TEXT,__text) section
__Z3sumv:
0000000000000000    leaq    _mem+0x00001000(%rip),%rax
0000000000000007    leaq    _mem+0x00002000(%rip),%rdx
000000000000000e    nop
0000000000000010    movaps    (%rax),%xmm0
0000000000000013    addq    $0x10,%rax
0000000000000017    addps    0x00000ff0(%rax),%xmm0
000000000000001e    movaps    %xmm0,0xffffeff0(%rax)
0000000000000025    cmpq    %rdx,%rax
0000000000000028    jne    0x00000010
000000000000002a    repz/ret


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2012-11-16 13:46 ` vincenzo.innocente at cern dot ch
@ 2012-11-16 13:56 ` jakub at gcc dot gnu.org
  2012-11-16 13:59 ` vincenzo.innocente at cern dot ch
                   ` (39 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-11-16 13:56 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334

--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-11-16 13:55:54 UTC ---
(In reply to comment #10)
> actually looking into the generated code I do not see any trace of "runtime
> check"
> even in presence of "const"

The vectorizer creates the versioning for alias, but then vrp2 manages to
optimize the runtime check into a constant and thus the non-vectorized loop is
optimized away.


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (10 preceding siblings ...)
  2012-11-16 13:56 ` jakub at gcc dot gnu.org
@ 2012-11-16 13:59 ` vincenzo.innocente at cern dot ch
  2012-11-16 14:17 ` jakub at gcc dot gnu.org
                   ` (38 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: vincenzo.innocente at cern dot ch @ 2012-11-16 13:59 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334

--- Comment #12 from vincenzo Innocente <vincenzo.innocente at cern dot ch> 2012-11-16 13:58:33 UTC ---
so a "better" c case is 
float * mem;
void sumN(int n) {
  float * a=mem;
  /*const*/ float * b=mem+n;
  /*const*/ float * c=mem+2*n;
  for (int i=0;i!=n;++i)
    a[i]=b[i]+c[i];
}


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (11 preceding siblings ...)
  2012-11-16 13:59 ` vincenzo.innocente at cern dot ch
@ 2012-11-16 14:17 ` jakub at gcc dot gnu.org
  2012-11-16 14:45 ` [Bug tree-optimization/55334] [4.8 Regression] " jakub at gcc dot gnu.org
                   ` (37 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-11-16 14:17 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334

--- Comment #13 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-11-16 14:17:00 UTC ---
(In reply to comment #12)
> so a "better" c case is 
> float * mem;
> void sumN(int n) {
>   float * a=mem;
>   /*const*/ float * b=mem+n;
>   /*const*/ float * c=mem+2*n;
>   for (int i=0;i!=n;++i)
>     a[i]=b[i]+c[i];
> }

Without const and with constant n GCC already does the right thing.  With
non-constant n it is a different thing, then we have
base_object: *&mem + (long unsigned int) n_3(D) * 4
base_object: *&mem + (long unsigned int) (n_3(D) * 2) * 4
base_object: MEM[(float *)&mem]
and obviously it doesn't operand_equal_p either.  Not sure if in that case
we couldn't move (long unsigned int) n_3(D) * 4 resp. (long unsigned int)
(n_3(D) * 2) * 4 from the base object to the access function, so it would be
instead of
Access function 0: {0B, +, 4}_1
say
Access function 0: {n_3(D) * 4, +, 4}_1
and whether rest of data-ref etc. code would handle that properly.


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] [4.8 Regression] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (12 preceding siblings ...)
  2012-11-16 14:17 ` jakub at gcc dot gnu.org
@ 2012-11-16 14:45 ` jakub at gcc dot gnu.org
  2012-12-07 10:12 ` rguenth at gcc dot gnu.org
                   ` (36 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-11-16 14:45 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.8.0
            Summary|mgrid regression (ipa-cp    |[4.8 Regression] mgrid
                   |disables vectorization)     |regression (ipa-cp disables
                   |                            |vectorization)


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] [4.8 Regression] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (13 preceding siblings ...)
  2012-11-16 14:45 ` [Bug tree-optimization/55334] [4.8 Regression] " jakub at gcc dot gnu.org
@ 2012-12-07 10:12 ` rguenth at gcc dot gnu.org
  2012-12-10 15:34 ` rguenth at gcc dot gnu.org
                   ` (35 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-12-07 10:12 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |rguenth at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #14 from Richard Biener <rguenth at gcc dot gnu.org> 2012-12-07 10:11:26 UTC ---
Let me have a look here.  I think the issue is that IPA-CP removes Fortran
restrict argument handling and exposes DECLs that data-ref analysis is
not handling very well.  Thus, it effectively drops "restrict".  Maybe it
simply shouldn't do that.


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] [4.8 Regression] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (14 preceding siblings ...)
  2012-12-07 10:12 ` rguenth at gcc dot gnu.org
@ 2012-12-10 15:34 ` rguenth at gcc dot gnu.org
  2012-12-21 12:26 ` rguenth at gcc dot gnu.org
                   ` (34 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-12-10 15:34 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334

--- Comment #15 from Richard Biener <rguenth at gcc dot gnu.org> 2012-12-10 15:33:38 UTC ---
(In reply to comment #4)
> Hmm, this does not help.  The problem is indeed that we are not able to figure
> out that the accesses into subarrays of X are mutually independent.
> 
> Martin, Michael, I think you are more familiar with MEM_REF, can you take a
> look?

Well, the accesses are lowered to like

(compute_affine_dependence
  stmt_a: _21 = MEM[(real(kind=8)[0:D.1986] *)&x + 20247552B][_20];
  stmt_b: _23 = MEM[(real(kind=8)[0:D.1983] *)&x][_20];
) -> dependence analysis failed

this lowering of &x.u vs. &x.v (just guessing) does't mix well with
array-based accesses.  That is, we cannot translate this kind of accesses
to independently indexed dimensions as dependence analysis likes to have.
Another issue is that the number of iterations is not constant but

190: === get_loop_niters ===Analyzing # of iterations of loop 2
  exit condition [2, + , 1](no_overflow) != _2 + -1
  bounds on difference of bases: 0 ... 2147483644
  result:
    # of iterations (unsigned int) _2 + 4294967293, bounded by 2147483644

so we cannot see that in the above case _20 would not run over to the
"other" sub-array of x.

The only way to retain this knowledge is not to lower the high-level form
&x.u and &x.v but to keep it (which in the end won't help because we
cannot reconstruct x.u[_20] or x.v[_20] in any valid way).  Or to
retain restrict information - which means _not_ doing IPA-CP.

So, if you can from

(compute_affine_dependence
  stmt_a: _21 = MEM[(real(kind=8)[0:D.1986] *)&x + 20247552B][_20];
  stmt_b: _23 = MEM[(real(kind=8)[0:D.1983] *)&x][_20];
) -> dependence analysis failed

prove that the base addresses (MEM[(real(kind=8)[0:D.1986] *)&x + 20247552B]
and MEM[(real(kind=8)[0:D.1983] *)&x]) are different objects then
initialize_data_dependence_relation can compute the dependence and all
would be fine.  refs_may_alias_p would be the thing to fix to make
them not alias (as you can see the arrays have unknown upper bounds,
so it's not possible to prove they are not the same).


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] [4.8 Regression] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (15 preceding siblings ...)
  2012-12-10 15:34 ` rguenth at gcc dot gnu.org
@ 2012-12-21 12:26 ` rguenth at gcc dot gnu.org
  2012-12-21 13:49 ` hubicka at ucw dot cz
                   ` (33 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-12-21 12:26 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEW
         AssignedTo|rguenth at gcc dot gnu.org  |unassigned at gcc dot
                   |                            |gnu.org

--- Comment #16 from Richard Biener <rguenth at gcc dot gnu.org> 2012-12-21 12:25:35 UTC ---
Nothing to fix for me - it's the IPA-CP decision that pessimizes things.


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] [4.8 Regression] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (16 preceding siblings ...)
  2012-12-21 12:26 ` rguenth at gcc dot gnu.org
@ 2012-12-21 13:49 ` hubicka at ucw dot cz
  2012-12-21 14:02 ` rguenth at gcc dot gnu.org
                   ` (32 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: hubicka at ucw dot cz @ 2012-12-21 13:49 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334

--- Comment #17 from Jan Hubicka <hubicka at ucw dot cz> 2012-12-21 13:49:15 UTC ---
> Nothing to fix for me - it's the IPA-CP decision that pessimizes things.
Well, replacing parameter by known constant should not pessimize in general...

Honza


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] [4.8 Regression] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (17 preceding siblings ...)
  2012-12-21 13:49 ` hubicka at ucw dot cz
@ 2012-12-21 14:02 ` rguenth at gcc dot gnu.org
  2012-12-21 14:09 ` rguenth at gcc dot gnu.org
                   ` (31 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-12-21 14:02 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334

--- Comment #18 from Richard Biener <rguenth at gcc dot gnu.org> 2012-12-21 14:01:33 UTC ---
(In reply to comment #17)
> > Nothing to fix for me - it's the IPA-CP decision that pessimizes things.
> Well, replacing parameter by known constant should not pessimize in general...

True, but replacing restrict parameter with sth non-restrict may be.
The language spec allows me to write

void foo (int * restrict p, int * restrict q, int n)
{
  for (i = 0; i < n; ++i)
    p[i] = q[n-i];
}

and call it with foo (&a[0], &a[100], n) when I know that with this
particular n it will not alias.

But without knowing 'n' (like in the mgrid case) there is no chance
that we can re-discover this non-aliasing when you propagate &a[0]
and &a[100].


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] [4.8 Regression] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (18 preceding siblings ...)
  2012-12-21 14:02 ` rguenth at gcc dot gnu.org
@ 2012-12-21 14:09 ` rguenth at gcc dot gnu.org
  2012-12-21 14:10 ` jakub at gcc dot gnu.org
                   ` (30 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-12-21 14:09 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334

--- Comment #19 from Richard Biener <rguenth at gcc dot gnu.org> 2012-12-21 14:08:24 UTC ---
Btw, one thing to improve would be the excessive number of aliasing runtime
checks the vectorizer currently generates.  That would also help himeno.
What is missing here is conservative merging of tests (thus making them
slightly less precise for the sake of reducing their number).  We
create different tests for, say, R vs. U(I1,  I2,  I3) and R vs.
U(I1-1,I2,  I3).

It's of course not that trivial, otherwise somebody would have done it
already (see vect_prune_runtime_alias_test_list - we only merge equal
range tests and do not try to use a convex hull to cover multiple tests
with one).


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] [4.8 Regression] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (19 preceding siblings ...)
  2012-12-21 14:09 ` rguenth at gcc dot gnu.org
@ 2012-12-21 14:10 ` jakub at gcc dot gnu.org
  2012-12-21 14:12 ` rguenth at gcc dot gnu.org
                   ` (29 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-12-21 14:10 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334

--- Comment #20 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-12-21 14:10:19 UTC ---
There would be if we had ADD_RESTRICT or something similar.  But we don't right
now, so supposedly it would be better to avoid such IPA-CP changes if it
removes restrict for now.


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] [4.8 Regression] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (20 preceding siblings ...)
  2012-12-21 14:10 ` jakub at gcc dot gnu.org
@ 2012-12-21 14:12 ` rguenth at gcc dot gnu.org
  2012-12-21 14:22 ` hubicka at ucw dot cz
                   ` (28 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-12-21 14:12 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334

--- Comment #21 from Richard Biener <rguenth at gcc dot gnu.org> 2012-12-21 14:12:18 UTC ---
(In reply to comment #20)
> There would be if we had ADD_RESTRICT or something similar.

I think that would not help as we'd likely propagate constants through it.
But yes, it would be one step closer to preserving it.


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] [4.8 Regression] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (21 preceding siblings ...)
  2012-12-21 14:12 ` rguenth at gcc dot gnu.org
@ 2012-12-21 14:22 ` hubicka at ucw dot cz
  2012-12-21 14:27 ` rguenth at gcc dot gnu.org
                   ` (27 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: hubicka at ucw dot cz @ 2012-12-21 14:22 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334

--- Comment #22 from Jan Hubicka <hubicka at ucw dot cz> 2012-12-21 14:22:28 UTC ---
> There would be if we had ADD_RESTRICT or something similar.  But we don't right
> now, so supposedly it would be better to avoid such IPA-CP changes if it
> removes restrict for now.
We would also have to disable inlining of functions with restrict parameters
(in mgrid case now both ipa-cp and inliner makes the regressions).  I am not
quite sure it is desirable behaviour.

Honza


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] [4.8 Regression] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (22 preceding siblings ...)
  2012-12-21 14:22 ` hubicka at ucw dot cz
@ 2012-12-21 14:27 ` rguenth at gcc dot gnu.org
  2013-02-12 20:11 ` jamborm at gcc dot gnu.org
                   ` (26 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-12-21 14:27 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu.org

--- Comment #23 from Richard Biener <rguenth at gcc dot gnu.org> 2012-12-21 14:27:18 UTC ---
In fact there are a few dependences we can solve:

191: versioning for alias required: can't determine dependence between
MEM[(real(kind=8)[0:D.1986] *)&x + 20247552B][_20] and
MEM[(real(kind=8)[0:D.1989] *)&x + 37823552B][_20]

from

Creating dr for MEM[(real(kind=8)[0:D.1986] *)&x + 20247552B][_20]
analyze_innermost: success.
        base_address: &x
        offset from base address: (ssizetype) ((sizetype) (((_7 - stride.11_6)
+ pretmp_791) + pretmp_813) * 8)
        constant offset from base address: 20247568
        step: 8
        aligned to: 8 
        base_object: MEM[(real(kind=8)[0:D.1986] *)&x + 20247552B]
        Access function 0: {{(stride.9_4 * 2 + pretmp_792) + 2, +,
stride.9_4}_2, +, 1}_3

and

Creating dr for MEM[(real(kind=8)[0:D.1983] *)&x][_20]
analyze_innermost: success.
        base_address: &x
        offset from base address: (ssizetype) ((sizetype) (((_7 - stride.11_6)
+ pretmp_791) + pretmp_813) * 8)
        constant offset from base address: 16
        step: 8
        aligned to: 8
        base_object: MEM[(real(kind=8)[0:D.1983] *)&x]
        Access function 0: {{(stride.9_4 * 2 + pretmp_792) + 2, +,
stride.9_4}_2, +, 1}_3

we hit:

  /* If the references do not access the same object, we do not know
     whether they alias or not.  */
  if (!operand_equal_p (DR_BASE_OBJECT (a), DR_BASE_OBJECT (b), 0))
    {
      DDR_ARE_DEPENDENT (res) = chrec_dont_know;
      return res;
    }

but for the case the access functions are the same we can conclude the
accesses cannot alias if the base_objects cannot alias (danger!  data-ref
does not record an "access size", so with the same access function
but only 1-byte offset in base_object this can lead to false disambiguations,
so it might in the end not be that easy ...)  This size issue is also
why we cannot translate the base_object internal offset into an access
function (see testcases I added for bugs we had there)


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] [4.8 Regression] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (23 preceding siblings ...)
  2012-12-21 14:27 ` rguenth at gcc dot gnu.org
@ 2013-02-12 20:11 ` jamborm at gcc dot gnu.org
  2013-02-13  9:09 ` rguenth at gcc dot gnu.org
                   ` (25 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: jamborm at gcc dot gnu.org @ 2013-02-12 20:11 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334

--- Comment #24 from Martin Jambor <jamborm at gcc dot gnu.org> 2013-02-12 20:10:42 UTC ---
Created attachment 29429
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29429
Experimental patch resolving more dependencies

This is my (untested, highly experimental) patch to resolve such
dependencies.  Basically, it 1) treats MEM_REFs as sort-of
COMPONENT_REFs on top INDIRECT_REFs and always pushes the offset index
to access_fns of a data reference structure, and 2) relaxes the rule
that DR_BASE_OBJECTs need to be the same thing for MEM_REFs of DECLs,
where we are happy if the DECLs are the same now.

It is successful to the extent that vectorization takes place, however
the resulting code is even slower.  The problem seems to be that
IPA-CP does not only inhibit vectorization, it also apparently
inhibits moving loop invariant loads out of the loop.  E.g. the second
load in BB 7 of the clone

_22 = MEM[(real(kind=8)[4] *)&x + 58071104B][0];

is moved up to BB 4 in the original function.  The vectorizer then
also complains about

mgrid.f:191: note: Detected interleaving MEM[(real(kind=8)[4] *)&x +
58071104B][0] and MEM[(real(kind=8)[4] *)&x + 58071104B][1]
mgrid.f:191: note: Detected interleaving MEM[(real(kind=8)[4] *)&x +
58071104B][0] and MEM[(real(kind=8)[4] *)&x + 58071104B][2]
mgrid.f:191: note: Detected interleaving MEM[(real(kind=8)[4] *)&x +
58071104B][0] and MEM[(real(kind=8)[4] *)&x + 58071104B][3]
mgrid.f:191: note: Detected interleaving MEM[(real(kind=8)[4] *)&x +
58071104B][1] and MEM[(real(kind=8)[4] *)&x + 58071104B][2]
mgrid.f:191: note: Detected interleaving MEM[(real(kind=8)[4] *)&x +
58071104B][1] and MEM[(real(kind=8)[4] *)&x + 58071104B][3]
mgrid.f:191: note: Detected interleaving MEM[(real(kind=8)[4] *)&x +
58071104B][2] and MEM[(real(kind=8)[4] *)&x + 58071104B][3]

I am convinced there is no reasonably easy fix for this to juggle with
in stage 4 and so I am going to submit a patch disabling propagation
to and through restrict pointers to arrays.  However, I would very
much prefer to revert it on trunk immediately after 4.8 is branched
off (and thus keep this bug opened).  As we try to do more and more
IPA stuff on Fortran, we will be bumping into this more often.


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] [4.8 Regression] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (24 preceding siblings ...)
  2013-02-12 20:11 ` jamborm at gcc dot gnu.org
@ 2013-02-13  9:09 ` rguenth at gcc dot gnu.org
  2013-02-19 12:55 ` jamborm at gcc dot gnu.org
                   ` (24 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-02-13  9:09 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334

--- Comment #25 from Richard Biener <rguenth at gcc dot gnu.org> 2013-02-13 09:09:09 UTC ---
(In reply to comment #24)
> Created attachment 29429 [details]
> Experimental patch resolving more dependencies
> 
> This is my (untested, highly experimental) patch to resolve such
> dependencies.  Basically, it 1) treats MEM_REFs as sort-of
> COMPONENT_REFs on top INDIRECT_REFs and always pushes the offset index
> to access_fns of a data reference structure, and 2) relaxes the rule
> that DR_BASE_OBJECTs need to be the same thing for MEM_REFs of DECLs,
> where we are happy if the DECLs are the same now.

That won't work (read: it will cause miscompiles).  I believe with the
most recent data-dependence reorg I added a bunch of testcases that show
how to create breaking testcases ;)


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] [4.8 Regression] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (25 preceding siblings ...)
  2013-02-13  9:09 ` rguenth at gcc dot gnu.org
@ 2013-02-19 12:55 ` jamborm at gcc dot gnu.org
  2013-02-19 13:50 ` rguenther at suse dot de
                   ` (23 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: jamborm at gcc dot gnu.org @ 2013-02-19 12:55 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334

--- Comment #26 from Martin Jambor <jamborm at gcc dot gnu.org> 2013-02-19 12:54:27 UTC ---
(In reply to comment #25)
> 
> That won't work (read: it will cause miscompiles).  I believe with the
> most recent data-dependence reorg I added a bunch of testcases that show
> how to create breaking testcases ;)

Yes, it even already miscompiles a few testcases in the testsuite.  I
mainly wanted to say that the vectorizer is not the only problem.
Which means that we probably want to preserve restrict across IPA
optimizations.

Another idea, which Honza mentioned last time I spoke to him, was that
perhaps not lowering &x.u and other COMPONENT_REFs into MEM_REFs would
be enough to figure out the accesses do not alias, but I am not sure
that is true in gimple (or why tree-inline does this in the first
place).


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] [4.8 Regression] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (26 preceding siblings ...)
  2013-02-19 12:55 ` jamborm at gcc dot gnu.org
@ 2013-02-19 13:50 ` rguenther at suse dot de
  2013-02-20 11:13 ` jamborm at gcc dot gnu.org
                   ` (22 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: rguenther at suse dot de @ 2013-02-19 13:50 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334

--- Comment #27 from rguenther at suse dot de <rguenther at suse dot de> 2013-02-19 13:49:30 UTC ---
On Tue, 19 Feb 2013, jamborm at gcc dot gnu.org wrote:

> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334
> 
> --- Comment #26 from Martin Jambor <jamborm at gcc dot gnu.org> 2013-02-19 12:54:27 UTC ---
> (In reply to comment #25)
> > 
> > That won't work (read: it will cause miscompiles).  I believe with the
> > most recent data-dependence reorg I added a bunch of testcases that show
> > how to create breaking testcases ;)
> 
> Yes, it even already miscompiles a few testcases in the testsuite.  I
> mainly wanted to say that the vectorizer is not the only problem.
> Which means that we probably want to preserve restrict across IPA
> optimizations.
> 
> Another idea, which Honza mentioned last time I spoke to him, was that
> perhaps not lowering &x.u and other COMPONENT_REFs into MEM_REFs would
> be enough to figure out the accesses do not alias, but I am not sure
> that is true in gimple (or why tree-inline does this in the first
> place).

Yes, preserving COMPONENT_REFs would help here, but it is not
correct (even for this testcase the types do not match).

Richard.


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] [4.8 Regression] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (27 preceding siblings ...)
  2013-02-19 13:50 ` rguenther at suse dot de
@ 2013-02-20 11:13 ` jamborm at gcc dot gnu.org
  2013-02-20 12:57 ` jamborm at gcc dot gnu.org
                   ` (21 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: jamborm at gcc dot gnu.org @ 2013-02-20 11:13 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334

--- Comment #28 from Martin Jambor <jamborm at gcc dot gnu.org> 2013-02-20 11:13:04 UTC ---
(In reply to comment #27)
> Yes, preserving COMPONENT_REFs would help here, but it is not
> correct (even for this testcase the types do not match).
> 

So you know where the mismatch is?  I looked whether I could refuse to
IPA-CP just type-mismatched values to restrict pointers but at least
when still in IPA-CP, which checks it, the value and the type of the
parameter conform to useless_type_conversion_p.  So I'll go ahead and
commit http://gcc.gnu.org/ml/gcc-patches/2013-02/msg00870.html with
the requested tweak.


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] [4.8 Regression] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (28 preceding siblings ...)
  2013-02-20 11:13 ` jamborm at gcc dot gnu.org
@ 2013-02-20 12:57 ` jamborm at gcc dot gnu.org
  2013-02-20 14:08 ` [Bug tree-optimization/55334] [4.8/4.9 " rguenth at gcc dot gnu.org
                   ` (20 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: jamborm at gcc dot gnu.org @ 2013-02-20 12:57 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334

--- Comment #29 from Martin Jambor <jamborm at gcc dot gnu.org> 2013-02-20 12:56:36 UTC ---
Author: jamborm
Date: Wed Feb 20 12:56:30 2013
New Revision: 196171

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=196171
Log:
2013-02-20  Martin Jambor  <mjambor@suse.cz>

    PR tree-optimization/55334
    * ipa-cp.c (initialize_node_lattices): Disable IPA-CP through and to
    restricted pointers to arrays.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ipa-cp.c


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] [4.8/4.9 Regression] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (29 preceding siblings ...)
  2013-02-20 12:57 ` jamborm at gcc dot gnu.org
@ 2013-02-20 14:08 ` rguenth at gcc dot gnu.org
  2013-03-28 12:36 ` jamborm at gcc dot gnu.org
                   ` (19 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-02-20 14:08 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2
   Target Milestone|4.8.0                       |4.9.0
            Summary|[4.8 Regression] mgrid      |[4.8/4.9 Regression] mgrid
                   |regression (ipa-cp disables |regression (ipa-cp disables
                   |vectorization)              |vectorization)

--- Comment #30 from Richard Biener <rguenth at gcc dot gnu.org> 2013-02-20 14:07:58 UTC ---
Fixed, but keeping open to track that restrict issue.


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] [4.8/4.9 Regression] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (30 preceding siblings ...)
  2013-02-20 14:08 ` [Bug tree-optimization/55334] [4.8/4.9 " rguenth at gcc dot gnu.org
@ 2013-03-28 12:36 ` jamborm at gcc dot gnu.org
  2013-07-10 23:54 ` chris_s_jones at yahoo dot com
                   ` (18 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: jamborm at gcc dot gnu.org @ 2013-03-28 12:36 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334

--- Comment #31 from Martin Jambor <jamborm at gcc dot gnu.org> 2013-03-28 12:36:36 UTC ---
The 4.8 workaround has been reverted yesterday with the commit below
so the bug should be alive and kicking again.

Author: jamborm
Date: Wed Mar 27 14:06:58 2013
New Revision: 197163

URL: http://gcc.gnu.org/viewcvs?rev=197163&root=gcc&view=rev
Log:
2013-03-27  Martin Jambor  <mjambor@suse.cz>

    PR tree-optimization/55334
    * ipa-cp.c (initialize_node_lattices): Allow IPA-CP through and to
    restricted pointers to arrays.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ipa-cp.c


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] [4.8/4.9 Regression] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (31 preceding siblings ...)
  2013-03-28 12:36 ` jamborm at gcc dot gnu.org
@ 2013-07-10 23:54 ` chris_s_jones at yahoo dot com
  2013-07-24 15:47 ` jamborm at gcc dot gnu.org
                   ` (17 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: chris_s_jones at yahoo dot com @ 2013-07-10 23:54 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334

Chris Jones <chris_s_jones at yahoo dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |chris_s_jones at yahoo dot com

--- Comment #32 from Chris Jones <chris_s_jones at yahoo dot com> ---
I'm curious if the original 172.mgrid regression is believed to still exist in
GCC 4.8.1.  I notice that ipa-cp.c has Martin's special case for RESTRICT
pointers, yet building 172.mgrid for AArch64 seems to result in an inlined
version of resid_() which does not get vectorized.  Using -fno-inline-functions
(or alternatively --param inline-min-speedup=17) produces code which runs
significantly faster.  It's remotely possible that I have some local edits
which are causing the regression, but I suspect that the issue is still present
for the mgrid case and wanted to verify that before attempting another
work-around.


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] [4.8/4.9 Regression] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (32 preceding siblings ...)
  2013-07-10 23:54 ` chris_s_jones at yahoo dot com
@ 2013-07-24 15:47 ` jamborm at gcc dot gnu.org
  2013-07-25 16:33 ` hubicka at ucw dot cz
                   ` (16 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: jamborm at gcc dot gnu.org @ 2013-07-24 15:47 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334

--- Comment #33 from Martin Jambor <jamborm at gcc dot gnu.org> ---
I can confirm that one call of resid now gets inlined on the branch
even on x86_64 (I'm confused why, the dump seems to suggest all call
sites would violate param max-inline-insns-auto limit but then one
gets inlined anyway) and we are 5.6% slower than if we also specify
--param inline-min-speedup=17 (in addition to -Ofast).

This is not a regression from 4.8.0.  When I checked out the revision
with that tag, I got exactly the same inlining and pretty much the
same run time.

As far as the cause of the slowdown is concerned, my simple greps
suggest that vectorization happens anyway but as I wrote in comment
24, if we loose restrict we also lose opportunity to do hoisting of a
loop invariant load so it is still likely that a lost restrict is the
issue anyway.


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] [4.8/4.9 Regression] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (33 preceding siblings ...)
  2013-07-24 15:47 ` jamborm at gcc dot gnu.org
@ 2013-07-25 16:33 ` hubicka at ucw dot cz
  2014-04-22 11:38 ` [Bug tree-optimization/55334] [4.8/4.9/4.10 " jakub at gcc dot gnu.org
                   ` (15 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: hubicka at ucw dot cz @ 2013-07-25 16:33 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334

--- Comment #34 from Jan Hubicka <hubicka at ucw dot cz> ---
> I can confirm that one call of resid now gets inlined on the branch
> even on x86_64 (I'm confused why, the dump seems to suggest all call
> sites would violate param max-inline-insns-auto limit but then one
> gets inlined anyway) and we are 5.6% slower than if we also specify
> --param inline-min-speedup=17 (in addition to -Ofast).

It probably gets an inline hint that makes it to bypass
max-inline-insns-auto...


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] [4.8/4.9/4.10 Regression] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (34 preceding siblings ...)
  2013-07-25 16:33 ` hubicka at ucw dot cz
@ 2014-04-22 11:38 ` jakub at gcc dot gnu.org
  2014-07-16 13:30 ` jakub at gcc dot gnu.org
                   ` (14 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-04-22 11:38 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.9.0                       |4.9.1

--- Comment #35 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.9.0 has been released


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] [4.8/4.9/4.10 Regression] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (35 preceding siblings ...)
  2014-04-22 11:38 ` [Bug tree-optimization/55334] [4.8/4.9/4.10 " jakub at gcc dot gnu.org
@ 2014-07-16 13:30 ` jakub at gcc dot gnu.org
  2014-09-02 15:45 ` [Bug tree-optimization/55334] [4.8/4.9/5 " vp at gcc dot gnu.org
                   ` (13 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-07-16 13:30 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.9.1                       |4.9.2

--- Comment #36 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.9.1 has been released.


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] [4.8/4.9/5 Regression] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (36 preceding siblings ...)
  2014-07-16 13:30 ` jakub at gcc dot gnu.org
@ 2014-09-02 15:45 ` vp at gcc dot gnu.org
  2014-09-03 10:04 ` jamborm at gcc dot gnu.org
                   ` (12 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: vp at gcc dot gnu.org @ 2014-09-02 15:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #38 from Vidya Praveen <vp at gcc dot gnu.org> ---
Until we fix this issue, could we have workaround posted by Martin Jambor
(comment #29) applied again on 4.9 and trunk? This issue is not seen on 4.8
releases because of the workaround. Having the workaround will avoid the
performance regression that is seen now.


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] [4.8/4.9/5 Regression] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (37 preceding siblings ...)
  2014-09-02 15:45 ` [Bug tree-optimization/55334] [4.8/4.9/5 " vp at gcc dot gnu.org
@ 2014-09-03 10:04 ` jamborm at gcc dot gnu.org
  2014-09-03 10:25 ` rguenther at suse dot de
                   ` (11 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: jamborm at gcc dot gnu.org @ 2014-09-03 10:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #39 from Martin Jambor <jamborm at gcc dot gnu.org> ---
(In reply to Vidya Praveen from comment #38)
> Until we fix this issue, could we have workaround posted by Martin Jambor
> (comment #29) applied again on 4.9 and trunk? 

No, not on trunk please.

As I said on IRC yesterday.  Before we even consider this for the 4.9
branch, please verify that inlining does not cause the same problems
with the benchmark (on the particular architecture you care for).  It
is certainly capable of doing that and we certainly do not want to
switch inlining off :-)


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] [4.8/4.9/5 Regression] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (38 preceding siblings ...)
  2014-09-03 10:04 ` jamborm at gcc dot gnu.org
@ 2014-09-03 10:25 ` rguenther at suse dot de
  2014-09-03 14:11 ` rguenth at gcc dot gnu.org
                   ` (10 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: rguenther at suse dot de @ 2014-09-03 10:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #40 from rguenther at suse dot de <rguenther at suse dot de> ---
nOn Wed, 3 Sep 2014, jamborm at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334
> 
> --- Comment #39 from Martin Jambor <jamborm at gcc dot gnu.org> ---
> (In reply to Vidya Praveen from comment #38)
> > Until we fix this issue, could we have workaround posted by Martin Jambor
> > (comment #29) applied again on 4.9 and trunk? 
> 
> No, not on trunk please.
> 
> As I said on IRC yesterday.  Before we even consider this for the 4.9
> branch, please verify that inlining does not cause the same problems
> with the benchmark (on the particular architecture you care for).  It
> is certainly capable of doing that and we certainly do not want to
> switch inlining off :-)

Inlining will certainly cause the same problem.


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] [4.8/4.9/5 Regression] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (39 preceding siblings ...)
  2014-09-03 10:25 ` rguenther at suse dot de
@ 2014-09-03 14:11 ` rguenth at gcc dot gnu.org
  2014-09-05 12:41 ` rguenth at gcc dot gnu.org
                   ` (9 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-09-03 14:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #41 from Richard Biener <rguenth at gcc dot gnu.org> ---
New attempt: https://gcc.gnu.org/ml/gcc-patches/2014-09/msg00232.html


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] [4.8/4.9/5 Regression] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (40 preceding siblings ...)
  2014-09-03 14:11 ` rguenth at gcc dot gnu.org
@ 2014-09-05 12:41 ` rguenth at gcc dot gnu.org
  2014-10-30 10:43 ` jakub at gcc dot gnu.org
                   ` (8 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-09-05 12:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #42 from Richard Biener <rguenth at gcc dot gnu.org> ---
With the proposed patch (with a tiny fix) I get:

(compute_affine_dependence
  stmt_a: _23 = MEM[(real(kind=8)[0:D.2444] *)&x clique 1 base 4][_20];
  stmt_b: _112 = MEM[(real(kind=8)[0:D.2444] *)&x clique 1 base 4][_111];
(analyze_overlapping_iterations
  (chrec_a = {pretmp_822 + 2, +, 1}_6)
  (chrec_b = {pretmp_850 + 1, +, 1}_6)
(analyze_siv_subscript
  siv test failed: unimplemented)
  (overlap_iterations_a = not known)
  (overlap_iterations_b = not known))
) -> dependence analysis failed

but the cases like the following work

(compute_affine_dependence
  stmt_a: _23 = MEM[(real(kind=8)[0:D.2444] *)&x clique 1 base 4][_20];
  stmt_b: _110 = MEM[(real(kind=8)[4] *)&x + 58071104B clique 1 base 3][3];
) -> no dependence

and finally

mgrid.f:191:0: note: LOOP VECTORIZED

mgrid.f:184:0: note: vectorized 1 loops in function.

and speed is back!

unpatched:

> /usr/bin/time ./a.out < mgrid.in > /dev/null
66.72user 0.05system 1:06.76elapsed 100%CPU (0avgtext+0avgdata
57804maxresident)k
0inputs+8360outputs (0major+14505minor)pagefaults 0swaps

patched:

> /usr/bin/time ./a.out < mgrid.in > /dev/null
61.90user 0.13system 1:02.16elapsed 99%CPU (0avgtext+0avgdata
57804maxresident)k
1472inputs+0outputs (9major+14496minor)pagefaults 0swaps

not sure if that is full recovery (but it's 10% and thus noticable).

I'll post the updated patch which still lacks the correctness part in the
inliner.


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] [4.8/4.9/5 Regression] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (41 preceding siblings ...)
  2014-09-05 12:41 ` rguenth at gcc dot gnu.org
@ 2014-10-30 10:43 ` jakub at gcc dot gnu.org
  2014-11-24  9:25 ` rguenth at gcc dot gnu.org
                   ` (7 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-10-30 10:43 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.9.2                       |4.9.3

--- Comment #43 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.9.2 has been released.


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] [4.8/4.9 Regression] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (43 preceding siblings ...)
  2014-11-24  9:25 ` rguenth at gcc dot gnu.org
@ 2014-11-24  9:25 ` rguenth at gcc dot gnu.org
  2014-11-24  9:25 ` [Bug tree-optimization/55334] [4.8/4.9/5 " rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-11-24  9:25 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |5.0
            Summary|[4.8/4.9/5 Regression]      |[4.8/4.9 Regression] mgrid
                   |mgrid regression (ipa-cp    |regression (ipa-cp disables
                   |disables vectorization)     |vectorization)

--- Comment #46 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed on trunk.


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] [4.8/4.9/5 Regression] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (44 preceding siblings ...)
  2014-11-24  9:25 ` [Bug tree-optimization/55334] [4.8/4.9 " rguenth at gcc dot gnu.org
@ 2014-11-24  9:25 ` rguenth at gcc dot gnu.org
  2015-02-16 11:26 ` [Bug tree-optimization/55334] [4.8/4.9 " andrew.n.senkevich at gmail dot com
                   ` (4 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-11-24  9:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #45 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Mon Nov 24 09:24:50 2014
New Revision: 218005

URL: https://gcc.gnu.org/viewcvs?rev=218005&root=gcc&view=rev
Log:
2014-11-24  Richard Biener  <rguenther@suse.de>

    PR tree-optimization/55334
    * function.h (struct function): Add last_clique member.
    * tree-inline.c (remap_dependence_clique): New function.
    (remap_gimple_op_r): Remap dependence cliques in MEM_REFs.
    (copy_tree_body_r): Likewise.
    (copy_cfg_body): Free dependence map.
    (copy_gimple_seq_and_replace_locals): Likewise.
    * tree-pretty-print.c (dump_generic_node): Dump
    dependence info.
    * tree-ssa-alias.c (refs_may_alias_p_1): Use dependence info
    to answer alias query.
    * tree-ssa-structalias.c: Include tree-phinodes.h, ssa-iterators.h,
    tree-pretty-print.h and gimple-walk.h.
    (struct variable_info): Add is_restrict_var flag and ruid
    member.
    (new_var_info): Initialize is_restrict_var.
    (make_constraint_from_restrict): Likewise.
    (create_variable_info_for): Exclude restricts from global vars
    from new handling.
    (intra_create_variable_infos): But not those from parameters.
    (visit_loadstore): New function.
    (maybe_set_dependence_info): Likewise.
    (compute_dependence_clique): Likewise.
    (compute_may_aliases): Call compute_dependence_clique.
    * tree-data-ref.c (dr_analyze_indices): Copy dependence info
    to fake MEM_REF.
    (dr_may_alias_p): Use recorded dependence info to answer
    alias query.
    * tree-core.h (struct tree_base): Add clique, base struct in
    union.
    * tree.h (MR_DEPENDENCE_CLIQUE): New macro.
    (MR_DEPENDENCE_BASE): Likewise.
    * tree-inline.h (dependence_hasher): New hash-map kind.
    (struct copy_body_data): Add dependence_map pointer.
    * gimple-fold.c (maybe_canonicalize_mem_ref_addr): Avoid
    throwing away dependence info.
    * tree-streamer-in.c (unpack_value_fields): Stream dependence info.
    * tree-streamer-out.c (streamer_pack_tree_bitfields): Likewise.

    * gcc.dg/tree-ssa/restrict-5.c: New testcase.

Modified:
    trunk/gcc/tree-ssa-structalias.c


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] [4.8/4.9/5 Regression] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (42 preceding siblings ...)
  2014-10-30 10:43 ` jakub at gcc dot gnu.org
@ 2014-11-24  9:25 ` rguenth at gcc dot gnu.org
  2014-11-24  9:25 ` [Bug tree-optimization/55334] [4.8/4.9 " rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-11-24  9:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #44 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Mon Nov 24 09:24:26 2014
New Revision: 218004

URL: https://gcc.gnu.org/viewcvs?rev=218004&root=gcc&view=rev
Log:
2014-11-24  Richard Biener  <rguenther@suse.de>

    PR tree-optimization/55334
    * function.h (struct function): Add last_clique member.
    * tree-inline.c (remap_dependence_clique): New function.
    (remap_gimple_op_r): Remap dependence cliques in MEM_REFs.
    (copy_tree_body_r): Likewise.
    (copy_cfg_body): Free dependence map.
    (copy_gimple_seq_and_replace_locals): Likewise.
    * tree-pretty-print.c (dump_generic_node): Dump
    dependence info.
    * tree-ssa-alias.c (refs_may_alias_p_1): Use dependence info
    to answer alias query.
    * tree-ssa-structalias.c: Include tree-phinodes.h, ssa-iterators.h,
    tree-pretty-print.h and gimple-walk.h.
    (struct variable_info): Add is_restrict_var flag and ruid
    member.
    (new_var_info): Initialize is_restrict_var.
    (make_constraint_from_restrict): Likewise.
    (create_variable_info_for): Exclude restricts from global vars
    from new handling.
    (intra_create_variable_infos): But not those from parameters.
    (visit_loadstore): New function.
    (maybe_set_dependence_info): Likewise.
    (compute_dependence_clique): Likewise.
    (compute_may_aliases): Call compute_dependence_clique.
    * tree-data-ref.c (dr_analyze_indices): Copy dependence info
    to fake MEM_REF.
    (dr_may_alias_p): Use recorded dependence info to answer
    alias query.
    * tree-core.h (struct tree_base): Add clique, base struct in
    union.
    * tree.h (MR_DEPENDENCE_CLIQUE): New macro.
    (MR_DEPENDENCE_BASE): Likewise.
    * tree-inline.h (dependence_hasher): New hash-map kind.
    (struct copy_body_data): Add dependence_map pointer.
    * gimple-fold.c (maybe_canonicalize_mem_ref_addr): Avoid
    throwing away dependence info.
    * tree-streamer-in.c (unpack_value_fields): Stream dependence info.
    * tree-streamer-out.c (streamer_pack_tree_bitfields): Likewise.

    * gcc.dg/tree-ssa/restrict-5.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.dg/tree-ssa/restrict-5.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/function.h
    trunk/gcc/gimple-fold.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-core.h
    trunk/gcc/tree-data-ref.c
    trunk/gcc/tree-inline.c
    trunk/gcc/tree-inline.h
    trunk/gcc/tree-pretty-print.c
    trunk/gcc/tree-ssa-alias.c
    trunk/gcc/tree-streamer-in.c
    trunk/gcc/tree-streamer-out.c
    trunk/gcc/tree.h


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] [4.8/4.9 Regression] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (45 preceding siblings ...)
  2014-11-24  9:25 ` [Bug tree-optimization/55334] [4.8/4.9/5 " rguenth at gcc dot gnu.org
@ 2015-02-16 11:26 ` andrew.n.senkevich at gmail dot com
  2015-02-16 11:29 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: andrew.n.senkevich at gmail dot com @ 2015-02-16 11:26 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Senkevich <andrew.n.senkevich at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrew.n.senkevich at gmail dot co
                   |                            |m

--- Comment #47 from Andrew Senkevich <andrew.n.senkevich at gmail dot com> ---
Hi, Richard,

what about to fix this issue also for 4.9 branch?


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] [4.8/4.9 Regression] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (46 preceding siblings ...)
  2015-02-16 11:26 ` [Bug tree-optimization/55334] [4.8/4.9 " andrew.n.senkevich at gmail dot com
@ 2015-02-16 11:29 ` jakub at gcc dot gnu.org
  2015-02-16 12:17 ` rguenther at suse dot de
                   ` (2 subsequent siblings)
  50 siblings, 0 replies; 52+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-02-16 11:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #48 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
That sounds way too risky for the older release branches.


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] [4.8/4.9 Regression] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (47 preceding siblings ...)
  2015-02-16 11:29 ` jakub at gcc dot gnu.org
@ 2015-02-16 12:17 ` rguenther at suse dot de
  2015-06-26 20:01 ` [Bug tree-optimization/55334] [4.9 " jakub at gcc dot gnu.org
  2015-06-26 20:31 ` jakub at gcc dot gnu.org
  50 siblings, 0 replies; 52+ messages in thread
From: rguenther at suse dot de @ 2015-02-16 12:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #49 from rguenther at suse dot de <rguenther at suse dot de> ---
On Mon, 16 Feb 2015, andrew.n.senkevich at gmail dot com wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55334
> 
> Andrew Senkevich <andrew.n.senkevich at gmail dot com> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                  CC|                            |andrew.n.senkevich at gmail dot co
>                    |                            |m
> 
> --- Comment #47 from Andrew Senkevich <andrew.n.senkevich at gmail dot com> ---
> Hi, Richard,
> 
> what about to fix this issue also for 4.9 branch?

The patch isn't suitable for backporting.


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] [4.9 Regression] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (48 preceding siblings ...)
  2015-02-16 12:17 ` rguenther at suse dot de
@ 2015-06-26 20:01 ` jakub at gcc dot gnu.org
  2015-06-26 20:31 ` jakub at gcc dot gnu.org
  50 siblings, 0 replies; 52+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-06-26 20:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #50 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.9.3 has been released.


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [Bug tree-optimization/55334] [4.9 Regression] mgrid regression (ipa-cp disables vectorization)
  2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
                   ` (49 preceding siblings ...)
  2015-06-26 20:01 ` [Bug tree-optimization/55334] [4.9 " jakub at gcc dot gnu.org
@ 2015-06-26 20:31 ` jakub at gcc dot gnu.org
  50 siblings, 0 replies; 52+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-06-26 20:31 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.9.3                       |4.9.4


^ permalink raw reply	[flat|nested] 52+ messages in thread

end of thread, other threads:[~2015-06-26 20:31 UTC | newest]

Thread overview: 52+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-15  2:27 [Bug tree-optimization/55334] New: mgrid regression (ipa-cp disables vectorization) hubicka at gcc dot gnu.org
2012-11-15  7:11 ` [Bug tree-optimization/55334] " vincenzo.innocente at cern dot ch
2012-11-15 11:07 ` hubicka at gcc dot gnu.org
2012-11-15 11:42 ` hubicka at gcc dot gnu.org
2012-11-16 10:39 ` hubicka at gcc dot gnu.org
2012-11-16 10:56 ` vincenzo.innocente at cern dot ch
2012-11-16 12:06 ` jakub at gcc dot gnu.org
2012-11-16 13:20 ` hubicka at gcc dot gnu.org
2012-11-16 13:22 ` hubicka at gcc dot gnu.org
2012-11-16 13:29 ` jakub at gcc dot gnu.org
2012-11-16 13:46 ` vincenzo.innocente at cern dot ch
2012-11-16 13:56 ` jakub at gcc dot gnu.org
2012-11-16 13:59 ` vincenzo.innocente at cern dot ch
2012-11-16 14:17 ` jakub at gcc dot gnu.org
2012-11-16 14:45 ` [Bug tree-optimization/55334] [4.8 Regression] " jakub at gcc dot gnu.org
2012-12-07 10:12 ` rguenth at gcc dot gnu.org
2012-12-10 15:34 ` rguenth at gcc dot gnu.org
2012-12-21 12:26 ` rguenth at gcc dot gnu.org
2012-12-21 13:49 ` hubicka at ucw dot cz
2012-12-21 14:02 ` rguenth at gcc dot gnu.org
2012-12-21 14:09 ` rguenth at gcc dot gnu.org
2012-12-21 14:10 ` jakub at gcc dot gnu.org
2012-12-21 14:12 ` rguenth at gcc dot gnu.org
2012-12-21 14:22 ` hubicka at ucw dot cz
2012-12-21 14:27 ` rguenth at gcc dot gnu.org
2013-02-12 20:11 ` jamborm at gcc dot gnu.org
2013-02-13  9:09 ` rguenth at gcc dot gnu.org
2013-02-19 12:55 ` jamborm at gcc dot gnu.org
2013-02-19 13:50 ` rguenther at suse dot de
2013-02-20 11:13 ` jamborm at gcc dot gnu.org
2013-02-20 12:57 ` jamborm at gcc dot gnu.org
2013-02-20 14:08 ` [Bug tree-optimization/55334] [4.8/4.9 " rguenth at gcc dot gnu.org
2013-03-28 12:36 ` jamborm at gcc dot gnu.org
2013-07-10 23:54 ` chris_s_jones at yahoo dot com
2013-07-24 15:47 ` jamborm at gcc dot gnu.org
2013-07-25 16:33 ` hubicka at ucw dot cz
2014-04-22 11:38 ` [Bug tree-optimization/55334] [4.8/4.9/4.10 " jakub at gcc dot gnu.org
2014-07-16 13:30 ` jakub at gcc dot gnu.org
2014-09-02 15:45 ` [Bug tree-optimization/55334] [4.8/4.9/5 " vp at gcc dot gnu.org
2014-09-03 10:04 ` jamborm at gcc dot gnu.org
2014-09-03 10:25 ` rguenther at suse dot de
2014-09-03 14:11 ` rguenth at gcc dot gnu.org
2014-09-05 12:41 ` rguenth at gcc dot gnu.org
2014-10-30 10:43 ` jakub at gcc dot gnu.org
2014-11-24  9:25 ` rguenth at gcc dot gnu.org
2014-11-24  9:25 ` [Bug tree-optimization/55334] [4.8/4.9 " rguenth at gcc dot gnu.org
2014-11-24  9:25 ` [Bug tree-optimization/55334] [4.8/4.9/5 " rguenth at gcc dot gnu.org
2015-02-16 11:26 ` [Bug tree-optimization/55334] [4.8/4.9 " andrew.n.senkevich at gmail dot com
2015-02-16 11:29 ` jakub at gcc dot gnu.org
2015-02-16 12:17 ` rguenther at suse dot de
2015-06-26 20:01 ` [Bug tree-optimization/55334] [4.9 " jakub at gcc dot gnu.org
2015-06-26 20:31 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).