------- Comment #4 from dorit at gcc dot gnu dot org  2007-10-22 22:54 -------
There's some bad interaction here between the data-interleaving support and the
outer-loop support - these are not yet supported together, however it still
slipped through the checks during the analysis phase. This patch fixes that by
not allowing us to detect interleaved accesses in the inner-loop during
outer-loop vectorization:

--- tree-vect-analyze.c 2007-10-22 08:34:45.000000000 +0200
+++ tree-vect-analyze.dn.c      2007-10-22 22:23:01.000000000 +0200
@@ -2321,6 +2321,10 @@

   if (nested_in_vect_loop_p (loop, stmt))
     {
+      /* Interleaved accesses are not yet supported within outer-loop
+        vectorization for references in the inner-loop.  */
+      DR_GROUP_FIRST_DR (vinfo_for_stmt (stmt)) = NULL_TREE;
+
       /* For the rest of the analysis we use the outer-loop step.  */
       step = STMT_VINFO_DR_STEP (stmt_info);
       dr_step = TREE_INT_CST_LOW (step);

(yet to be bootstrapped etc.)

By the way, on powerpc-linux, this testcase gets vectorized with this fix
(after changing the doubles to floats, and forcing alignment of the data array
with attribute aligned), without taking advantage of the fact that the two
loads are interleaved. 

By the way, I suspect that the vectorized code here is quite worse than the
original scalar code;
instead of: (ld,ld,add,store) * 16
we have: (vload,realign,splat,vload,realign,splat,vadd,vstore) * 4
with additional overhead outside the loop.
After the ICE is fixed we should probably add this as a missed-optimization PR
(both in terms of the cost model, and in terms of exploiting the data reuse of
the interleaved accesses).


-- 

dorit at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |dorit at gcc dot gnu dot org
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-10-22 22:54:32
               date|                            |


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

Reply via email to