* [autovect] [patch] outer-loop vectorization bug fix
@ 2007-08-12 14:18 Dorit Nuzman
0 siblings, 0 replies; only message in thread
From: Dorit Nuzman @ 2007-08-12 14:18 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 280 bytes --]
This patch brings the following over to autovect branch:
http://gcc.gnu.org/ml/gcc-patches/2007-08/msg00568.html
Bootstrapped with vectorization enabled on i386-linux. tested on the
vectorizer testcases.
Committed to autovect branch.
dorit
(See attached file: autovectfix.txt)
[-- Attachment #2: autovectfix.txt --]
[-- Type: text/plain, Size: 2694 bytes --]
Index: testsuite/ChangeLog.autovect
===================================================================
*** testsuite/ChangeLog.autovect (revision 127372)
--- testsuite/ChangeLog.autovect (working copy)
***************
*** 1,3 ****
--- 1,7 ----
+ 2007-08-12 Dorit Nuzman <dorit@il.ibm.com>
+
+ * gcc.dg/vect/vect-outer-2d.c: New test.
+
2007-08-12 Ira Rosen <irar@il.ibm.com>
* gcc.dg/vect/slp-37.c: New.
Index: testsuite/gcc.dg/vect/vect-outer-2d.c
===================================================================
*** testsuite/gcc.dg/vect/vect-outer-2d.c (revision 0)
--- testsuite/gcc.dg/vect/vect-outer-2d.c (revision 0)
***************
*** 0 ****
--- 1,41 ----
+ /* { dg-require-effective-target vect_float } */
+ #include <stdarg.h>
+ #include "tree-vect.h"
+
+ #define N 40
+ float image[N][N][N+1] __attribute__ ((__aligned__(16)));
+
+ void
+ foo (){
+ int i,j,k;
+
+ for (k=0; k<N; k++) {
+ for (i = 0; i < N; i++) {
+ for (j = 0; j < i+1; j++) {
+ image[k][j][i] = j+i+k;
+ }
+ }
+ }
+ }
+
+ int main (void)
+ {
+ check_vect ();
+ int i, j, k;
+
+ foo ();
+
+ for (k=0; k<N; k++) {
+ for (i = 0; i < N; i++) {
+ for (j = 0; j < i+1; j++) {
+ if (image[k][j][i] != j+i+k)
+ abort ();
+ }
+ }
+ }
+
+ return 0;
+ }
+
+ /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 0 "vect" } } */
+ /* { dg-final { cleanup-tree-dump "vect" } } */
Index: ChangeLog.autovect
===================================================================
*** ChangeLog.autovect (revision 127372)
--- ChangeLog.autovect (working copy)
***************
*** 1,3 ****
--- 1,9 ----
+ 2007-08-12 Dorit Nuzman <dorit@il.ibm.com>
+
+ * tree-vect-analyze.c (vect_analyze_loop_form): Check that the
+ inner-loop bound is invariant in the outer-loop (for outer-loop
+ vectorization).
+
2007-08-12 Ira Rosen <irar@il.ibm.com>
* tree-vect-analyze.c (vect_get_and_check_slp_defs): Add new argument.
Index: tree-vect-analyze.c
===================================================================
*** tree-vect-analyze.c (revision 127372)
--- tree-vect-analyze.c (working copy)
*************** vect_analyze_loop_form (struct loop *loo
*** 3785,3790 ****
--- 3785,3800 ----
return NULL;
}
+ if (!expr_invariant_in_loop_p (loop,
+ LOOP_VINFO_NITERS (inner_loop_vinfo)))
+ {
+ if (vect_print_dump_info (REPORT_BAD_FORM_LOOPS))
+ fprintf (vect_dump,
+ "not vectorized: inner-loop count not invariant.");
+ destroy_loop_vec_info (inner_loop_vinfo, true);
+ return NULL;
+ }
+
if (loop->num_nodes != 5)
{
if (vect_print_dump_info (REPORT_BAD_FORM_LOOPS))
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-08-12 14:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-12 14:18 [autovect] [patch] outer-loop vectorization bug fix Dorit Nuzman
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).