[Bug middle-end/31738] Fortran dot product vectorization is restricted

2008-04-28 Thread rguenth at gcc dot gnu dot org


--- Comment #6 from rguenth at gcc dot gnu dot org  2008-04-28 09:39 ---
For testvectdp2 we now miss to apply store-motion so the reduction is no longer
recognized.  This is the bad interaction between PRE and lim for which we have
PR36009.  If you add -fno-tree-pre vectorization fails because of

t.f90:7: note: reduction: not commutative/associative: D.1011_34

even with -ffast-math.


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

  BugsThisDependsOn||36009


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



[Bug middle-end/31738] Fortran dot product vectorization is restricted

2008-02-16 Thread jb at gcc dot gnu dot org


--- Comment #5 from jb at gcc dot gnu dot org  2008-02-16 22:40 ---
Still occurs with 

 4.3.0 20080216 (experimental) [trunk revision 132367]

i.e. only the first procedure (testvectdp) vectorizes, and that only with
-ffast-math. 


-- 

jb at gcc dot gnu dot org changed:

   What|Removed |Added

   Last reconfirmed|2007-04-28 22:04:58 |2008-02-16 22:40:16
   date||


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



[Bug middle-end/31738] Fortran dot product vectorization is restricted

2007-05-28 Thread pinskia at gcc dot gnu dot org


--- Comment #4 from pinskia at gcc dot gnu dot org  2007-05-29 04:43 ---
(In reply to comment #3)
 (2) add a dce pass after copyprop3?

This is already done now after:
2007-05-24  Zdenek Dvorak  [EMAIL PROTECTED]

* passes.c (init_optimization_passes):  Add dceloop after
copy propagation in loop optimizer.  Add predictive commoning
to loop optimizer passes.
But still none of the functions are vectorized (at least for me).


-- 


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



[Bug middle-end/31738] Fortran dot product vectorization is restricted

2007-05-16 Thread dorit at il dot ibm dot com


--- Comment #3 from dorit at il dot ibm dot com  2007-05-16 20:45 ---
(In reply to comment #2)
 Here is what happens in the three loops that don't get vectorized:
 (1) the loop in testvectdp2: 
...
 so the vectorizer is ok, except that in this case D.1437_32 doesn't seem to  
 be used anywhere in the function, so this stmt looks dead to me, but for 
 some reason it is not cleaned away before the vectorizer...  Still need to
 investigate why. 

So looks like the stmt 
   D.1437_32 = prephitmp.192_37
became dead by pass pr31738a.f90.089t.copyprop3.

So the question is what's the most appropriate fix:
(1) fix copyprop3 to also clean away any dead code it creates?
(2) add a dce pass after copyprop3?
(3) work around it in the vectorizer. I think it should be easy - just move the
check of the uses of the reduction in the loop until after the vectorizer
analysis pass that marks relevant stmts.

If (3) sounds like the way to go - I can prepare a patch for that.


-- 


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



[Bug middle-end/31738] Fortran dot product vectorization is restricted

2007-05-08 Thread dorit at il dot ibm dot com


--- Comment #2 from dorit at il dot ibm dot com  2007-05-08 21:00 ---
Here is what happens in the three loops that don't get vectorized:

(1) the loop in testvectdp2: 
This is the loop we analyze:

  # prephitmp.192_37 = PHI storetmp.191_30(3), D.1443_42(5)
  # i_1 = PHI 1(3), i_44(5)
L15:;
  D.1437_32 = prephitmp.192_37;
  D.1438_33 = (int8) i_1;
  D.1439_34 = D.1438_33 + -1;
  D.1440_36 = (*a_35(D))[D.1439_34];
  D.1441_40 = (*b_39(D))[D.1439_34];
  D.1442_41 = D.1441_40 * D.1440_36;
  D.1443_42 = prephitmp.192_37 + D.1442_41;
  storetmp.191_38 = D.1443_42;
  c__lsm.199_17 = D.1443_42;
  i_44 = i_1 + 1;
  if (i_1 == D.1429_5)
goto bb 6 (L21);
  else
goto bb 5 (L20);

We recognize the reduction, but we think that it is used in the loop:
  pr31738.f90:14: note: reduction used in loop.

and indeed, prephitmp.192_37 is used in:
  D.1443_42 = prephitmp.192_37 + D.1442_41;
which is ok, because this is the reduction stmt,
but also used here:
  D.1437_32 = prephitmp.192_37;
which is indeed something that we normally don't allow.
so the vectorizer is ok, except that in this case D.1437_32 doesn't seem to be
used anywhere in the function, so this stmt looks dead to me, but for some
reason it is not cleaned away before the vectorizer...  Still need to
investigate why. 


(2) the loop in testvecm:
This looks like the problem reported in PR31756:

failed to compute offset or step for (*a.0_11)[D.1559_52]
create_data_ref: failed to create a dr for (*a.0_11)[D.1559_52]
pr31738.f90:24: note: not vectorized: unhandled data-ref

(3) the loop in testvecm2
Same story (the PR31756 problem):

failed to compute offset or step for (*a.0_10)[D.1509_52]
create_data_ref: failed to create a dr for (*a.0_10)[D.1509_52]
pr31738.f90:32: note: not vectorized: unhandled data-ref


-- 


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



[Bug middle-end/31738] Fortran dot product vectorization is restricted

2007-04-28 Thread rguenth at gcc dot gnu dot org


--- Comment #1 from rguenth at gcc dot gnu dot org  2007-04-28 22:04 ---
None is vectorized for me.  I guess this is why gas_dyn regressed.


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||rguenth at gcc dot gnu dot
   ||org
 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2007-04-28 22:04:58
   date||


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