@@ -79,6 +79,7 @@ along with GCC; see the file COPYING3. If not see
#include "stringpool.h"
#include "attribs.h"
#include "gimple-pretty-print.h"
+#include "opt-problem.h"
/* Loop or bb location, with hotness information. */
@@ -705,9 +706,17 @@ try_vectorize_loop_1 (hash_table<simduid_to_vf> *&simduid_to_vf_htab,
LOCATION_FILE (vect_location.get_location_t ()),
LOCATION_LINE (vect_location.get_location_t ()));
- loop_vec_info loop_vinfo = vect_analyze_loop (loop, orig_loop_vinfo, &shared);
+ opt_loop_vec_info loop_vinfo = vect_analyze_loop (loop, orig_loop_vinfo, &shared);
loop->aux = loop_vinfo;
+ if (!loop_vinfo)
+ if (loop_vinfo.get_problem ())
+ {
+ opt_report report;
+ if (report.remark (vect_location, "couldn't vectorize loop"))
+ loop_vinfo.get_problem ()->report_reason (report);
+ }
+
if (!loop_vinfo || !LOOP_VINFO_VECTORIZABLE_P (loop_vinfo))
{
/* Free existing information if loop is analyzed with some
@@ -775,13 +784,26 @@ try_vectorize_loop_1 (hash_table<simduid_to_vf> *&simduid_to_vf_htab,
unsigned HOST_WIDE_INT bytes;
if (current_vector_size.is_constant (&bytes))
- dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
- "loop vectorized vectorized using "
+ {
+ dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
+ "loop vectorized vectorized using "
+ HOST_WIDE_INT_PRINT_UNSIGNED " byte "
+ "vectors\n", bytes);
+ opt_report report;
+ // FIXME: is this the correct format code?
+ report.remark (vect_location,
+ "loop vectorized using "
HOST_WIDE_INT_PRINT_UNSIGNED " byte "
- "vectors\n", bytes);
+ "vectors", bytes);
+ }
else
- dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
- "loop vectorized using variable length vectors\n");
+ {
+ dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
+ "loop vectorized using variable length vectors\n");
+ opt_report report;
+ report.remark (vect_location,
+ "loop vectorized using variable length vectors");
+ }
loop_p new_loop = vect_transform_loop (loop_vinfo);
(*num_vectorized_loops)++;