First,
Sergey Ostanevich wrote:
+ if (LOOP_VINFO_LOOP (loop_vinfo)->force_vect)
+ warning_at (vect_location, OPT_Wopenmp_simd, "vectorization "
+ "did not happen for a simd loop");
+
When I understand the patch correctly, the warning is shown in two cases:
a) When the loop could be vectorized but the cost model prevented it
b) When the loop couldn't be vectorized because of other reasons (e.g.
not vectorizable because of conditional loop exits, incomplete
vectorization support by the compiler etc.)
Do I correctly understand the warning? I am asking because the *opt and
*texi wording suggests that only (a) is the case. - I cannot test as the
patch cannot be applied with heavy editing (removal of additional line
breaks, taking care of tabs converted into spaces).
Regarding the warning, I think it sounds a bit colloquial and as if the
location information is not available. What do you think of "loop with
simd directive not vectorized" or concise not fully correct: "simd loop
not vectorized"?
Additionally, shouldn't that be guarded by "if (warn_openmp_simd &&"?
Otherwise the flag status isn't used at all in the whole patch.
+Wopenmp-simd
+C C++ Var(warn_openmp_simd) Warning EnabledBy(Wall)
+Warn about simd directive is overridden by vectorizer cost model
Wording wise, I'd prefer something like:
"Warn if an simd directive is overridden by the vectorizer cost model"
(Or is it "a simd"? Where are the native speakers when one needs them?)
However, in light of my question above, shouldn't it be "Warn if a loop
with simd directive is not vectorized"?
+fsimd-cost-model=
+Common Joined RejectNegative Enum(vect_cost_model)
Var(flag_simd_cost_model) Init(VECT_COST_MODEL_UNLIMITED)
+Specifies the vectorization cost model for code marked with simd directive
I think an article is lacking before "simd".
+@item -Wopenmp-simd
+@opindex Wopenm-simd
+Warn if vectorizer cost model overrides simd directive from user.
I think that can be expanded a bit. One could also mention OpenMP/Cilk
Plus explicitly. Maybe like: "Warn if the vectorizer cost model
overrides the OpenMP and Cilk Plus simd directives of the user."
Or if my reading above is correct, how about something like: "Warn if a
loop with OpenMP or Cilk Plus simd directive is not vectorized. If only
the cost model prevented the vectorization, the
@option{-fsimd-cost-model} option can be used to force the vectorization."
Which brings me to my next point: -fvect-cost-model= is not documented.
I think some words would be helpful, especially about the valid
arguments, the default and how it interacts with -fvect-cost-model=.
--- a/gcc/fortran/lang.opt
+++ b/gcc/fortran/lang.opt
+Wopenmp-simd
+Fortran Warning
+; Documented in C
("Warning" is also not needed as it is taken from c-family/*opt, but it
shouldn't harm either.)
Tobias