On Thu, May 28, 2015 at 1:00 PM, Yuri Rumyantsev <[email protected]> wrote:
> Hi All,
>
> Here is a simple patch which removes restriction on outer-loop
> vectorization - allow references in inner-loop with zero step. This
> case was found in one important benchmark.
>
> Bootstrap and regression testing did not show any new failures.
> Is it OK for trunk.
>
> ChangeLog:
> 2015-05-28 Yuri Rumyantsev <[email protected]>
>
> * tree-vect-data-refs.c (vect_analyze_data_ref_access): Allow
> consecutive accesses within outer-loop vectorization for references
> with zero step in inner-loop.
>
> gcc/testsuite/ChangeLog:
> * gcc.dg/vect/fast-math-vect-outer-1.c: New test.
Can you please add a non-omp-simd testcase that triggers this as well and that
is a runtime testcase verifying the transform is correct?
Also please don't add to the strange testcase-name machinery but just
use { dg-additional-options "-ffast-math" }
Index: tree-vect-data-refs.c
===================================================================
--- tree-vect-data-refs.c (revision 223653)
+++ tree-vect-data-refs.c (working copy)
@@ -2261,7 +2261,6 @@
return true;
}
-
/* Analyze the access pattern of the data-reference DR.
In case of non-consecutive accesses call vect_analyze_group_access() to
analyze groups of accesses. */
spurious white-space change
@@ -2291,14 +2290,8 @@
if (loop_vinfo && integer_zerop (step))
Surely the comment before this needs updating now.
{
GROUP_FIRST_ELEMENT (vinfo_for_stmt (stmt)) = NULL;
- if (nested_in_vect_loop_p (loop, stmt))
- {
- if (dump_enabled_p ())
- dump_printf_loc (MSG_NOTE, vect_location,
- "zero step in inner loop of nest\n");
- return false;
- }
- return DR_IS_READ (dr);
+ if (!nested_in_vect_loop_p (loop, stmt))
+ return DR_IS_READ (dr);
}
if (loop && nested_in_vect_loop_p (loop, stmt))
so what happens after the patch? It would be nice to have a comment
explaining what happens in the nested_in_vect_loop_p case for
the case when the outer-loop step is zero and when it is not zero.
In particular as you don't need any code generation changes - this hints
at that you may miss something ;)
Otherwise of course the patch is ok - lifting restrictions is good.
Thanks,
Richard.