OSDN Git Service

Improve vectorization diagnostic: loop contains function calls.
authorspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 29 Mar 2010 16:38:34 +0000 (16:38 +0000)
committerspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 29 Mar 2010 16:38:34 +0000 (16:38 +0000)
2010-03-29  Sebastian Pop  <sebastian.pop@amd.com>

PR middle-end/43436
* tree-vect-data-refs.c (vect_analyze_data_refs): When
compute_data_dependences_for_loop returns false, early exit
and output an extra diagnostic for the failed data reference
analysis.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157800 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/tree-vect-data-refs.c

index 73f102d..e5f0323 100644 (file)
@@ -1,3 +1,11 @@
+2010-03-29  Sebastian Pop  <sebastian.pop@amd.com>
+
+       PR middle-end/43436
+       * tree-vect-data-refs.c (vect_analyze_data_refs): When
+       compute_data_dependences_for_loop returns false, early exit
+       and output an extra diagnostic for the failed data reference
+       analysis.
+
 2010-03-29  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/43560
index 37ae9b5..aa7d89c 100644 (file)
@@ -1860,6 +1860,7 @@ vect_analyze_data_refs (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo)
   VEC (data_reference_p, heap) *datarefs;
   struct data_reference *dr;
   tree scalar_type;
+  bool res;
 
   if (vect_print_dump_info (REPORT_DETAILS))
     fprintf (vect_dump, "=== vect_analyze_data_refs ===\n");
@@ -1867,17 +1868,34 @@ vect_analyze_data_refs (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo)
   if (loop_vinfo)
     {
       loop = LOOP_VINFO_LOOP (loop_vinfo);
-      compute_data_dependences_for_loop (loop, true,
-                                         &LOOP_VINFO_DATAREFS (loop_vinfo),
-                                         &LOOP_VINFO_DDRS (loop_vinfo));
+      res = compute_data_dependences_for_loop
+       (loop, true, &LOOP_VINFO_DATAREFS (loop_vinfo),
+        &LOOP_VINFO_DDRS (loop_vinfo));
+
+      if (!res)
+       {
+         if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS))
+           fprintf (vect_dump, "not vectorized: loop contains function calls"
+                    " or data references that cannot be analyzed");
+         return false;
+       }
+
       datarefs = LOOP_VINFO_DATAREFS (loop_vinfo);
     }
   else
     {
       bb = BB_VINFO_BB (bb_vinfo);
-      compute_data_dependences_for_bb (bb, true,
-                                       &BB_VINFO_DATAREFS (bb_vinfo),
-                                       &BB_VINFO_DDRS (bb_vinfo));
+      res = compute_data_dependences_for_bb (bb, true,
+                                            &BB_VINFO_DATAREFS (bb_vinfo),
+                                            &BB_VINFO_DDRS (bb_vinfo));
+      if (!res)
+       {
+         if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS))
+           fprintf (vect_dump, "not vectorized: basic block contains function"
+                    " calls or data references that cannot be analyzed");
+         return false;
+       }
+
       datarefs = BB_VINFO_DATAREFS (bb_vinfo);
     }