... -ftree-vectorizer-verbose=1 test.cc test.cc:8: note: Vectorized loop But no result for -ftree-vectorizer-verbose=2 test.cc 2>&1|grep 'Vectorized loop' Again with n >= 3: -ftree-vectorizer-verbose=3 test.cc 2>&1|grep 'Vectorized loop' test.cc:8: note: Vectorized loop #include <algorithm> typedef int myint; void max(__restrict myint *data, myint val, int n) { //__assume_aligned(data,64); data = (myint*) __builtin_assume_aligned(data, 64); for (int i = 0; i < n; i++) data[i] = std::max(data[i], val); }
The reason is the following: dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location, "Vectorized loop\n"); And in opts-global.c's dump_remap_tree_vectorizer_verbose: switch (value) { case 0: break; case 1: remapped_opt_info = "optimized"; break; case 2: remapped_opt_info = "missed"; break; default: remapped_opt_info = "all"; break; } And dumpfile.h: #define MSG_OPTIMIZED_LOCATIONS (1 << 26) /* -fopt-info optimized sources */ #define MSG_MISSED_OPTIMIZATION (1 << 27) /* missed opportunities */ #define MSG_NOTE (1 << 28) /* general optimization info */ #define MSG_ALL (MSG_OPTIMIZED_LOCATIONS | MSG_MISSED_OPTIMIZATION \ | MSG_NOTE)
Using g++-4.7 -O3 -ftree-vectorizer-verbose=2 it works as one gets: 7: LOOP VECTORIZED. Seemingly caused by r193061
I think this is the intended behavior. While working on the new dump infrastructure, I modified the behavior of -ftree-vectorizer-verbose. Thus right now -ftree-vectorizer-verbose=1 : dump info about optimized loops ...=2 : dump info about missed loops ...>2 : dump info about optimized _and_ missed loops Thus at 3 and greater, you are again seeing info available at 1. But really, only 1 and 2 are meaningful. Anything higher is a combination of these two kinds of information. This was a way to preserve compatibility with old scripts, while deprecating this flag. I didn't see any tests relying on the old behavior. Here is the current documentation about this flag in gcc.info: `-ftree-vectorizer-verbose=N' This option is deprecated and is implemented in terms of `-fopt-info'. Please use `-fopt-info-KIND' form instead, where KIND is one of the valid opt-info options. It prints additional optimization information. For N=0 no diagnostic information is reported. If N=1 the vectorizer reports each loop that got vectorized, and the total number of loops that got vectorized. If N=2 the vectorizer reports locations which could not be vectorized and the reasons for those. For any higher verbosity levels all the analysis and transformation information from the vectorizer is reported.
I think perhaps it would be better if I remove this deprecated option -ftree-vectorizer-verbose= completely. It is confusing in its current form and the equivalent functionality is already available via -fopt-info-xxx option. Any opinions? Thanks, Sharad
GCC 4.8.2 has been released.
Author: singhai Date: Thu Oct 31 01:01:40 2013 New Revision: 204244 URL: http://gcc.gnu.org/viewcvs?rev=204244&root=gcc&view=rev Log: 2013-10-30 Sharad Singhai <singhai@google.com> PR middle-end/58134 * opts.c (common_handle_option): Remove deprecated option -ftree-vectorizer-verbose. * doc/invoke.texi (Debugging Options): Ditto. * opts-global.c (handle_common_deferred_options): Ditto. (dump_remap_tree_vectorizer_verbose): Delete. * common.opt: Set -ftree-vectorizer-verbose as an ignored option. ada/ChangeLog * gnat_ugn.texi: Remove option description for PR middle-end/58134. Modified: trunk/gcc/ChangeLog trunk/gcc/ada/ChangeLog trunk/gcc/ada/gnat_ugn.texi trunk/gcc/common.opt trunk/gcc/doc/invoke.texi trunk/gcc/opts-global.c trunk/gcc/opts.c
I have removed this deprecated option in r204244, hence marking it fixed.