@@ -592,6 +592,10 @@ Wold-style-definition
C ObjC Var(warn_old_style_definition) Warning
Warn if an old-style parameter definition is used
+Wopenmp-simd
+C C++ Var(openmp_simd) Warning
+Warn about omp simd construct is overridden by cost model
+
Woverlength-strings
C ObjC C++ ObjC++ Var(warn_overlength_strings) Warning
LangEnabledBy(C ObjC C++ ObjC++,Wpedantic)
Warn if a string is longer than the maximum portable length specified
by the standard
@@ -2296,6 +2296,10 @@ fvect-cost-model=
Common Joined RejectNegative Enum(vect_cost_model)
Var(flag_vect_cost_model) Init(VECT_COST_MODEL_DEFAULT)
Specifies the cost model for vectorization
+fsimd-cost-model=
+Common Joined RejectNegative Enum(vect_cost_model)
Var(flag_simd_cost_model) Init(VECT_COST_MODEL_DEFAULT)
+Specifies the cost model for vectorization in loops marked with omp simd
+
Enum
Name(vect_cost_model) Type(enum vect_cost_model) UnknownError(unknown
vectorizer cost model %qs)
@@ -257,6 +257,10 @@ Wintrinsics-std
Fortran Warning
Warn on intrinsics not part of the selected standard
+Wopenmp-simd
+Fortran Warning
+Warn about omp simd construct is overridden by cost model
+
Wreal-q-constant
Fortran Warning
Warn about real-literal-constants with 'q' exponent-letter
@@ -1090,7 +1090,8 @@ vect_peeling_hash_insert (loop_vec_info
loop_vinfo, struct data_reference *dr,
*new_slot = slot;
}
- if (!supportable_dr_alignment && unlimited_cost_model ())
+ if (!supportable_dr_alignment
+ && unlimited_cost_model (LOOP_VINFO_LOOP (loop_vinfo)))
slot->count += VECT_MAX_COST;
}
@@ -1200,7 +1201,7 @@ vect_peeling_hash_choose_best_peeling
(loop_vec_info loop_vinfo,
res.peel_info.dr = NULL;
res.body_cost_vec = stmt_vector_for_cost ();
- if (!unlimited_cost_model ())
+ if (!unlimited_cost_model (LOOP_VINFO_LOOP (loop_vinfo)))
{
res.inside_cost = INT_MAX;
res.outside_cost = INT_MAX;
@@ -1429,7 +1430,7 @@ vect_enhance_data_refs_alignment (loop_vec_info
loop_vinfo)
vectorization factor.
We do this automtically for cost model, since we
calculate cost
for every peeling option. */
- if (unlimited_cost_model ())
+ if (unlimited_cost_model (LOOP_VINFO_LOOP (loop_vinfo)))
possible_npeel_number = vf /nelements;
/* Handle the aligned case. We may decide to align some other
@@ -1437,7 +1438,7 @@ vect_enhance_data_refs_alignment (loop_vec_info
loop_vinfo)
if (DR_MISALIGNMENT (dr) == 0)
{
npeel_tmp = 0;
- if (unlimited_cost_model ())
+ if (unlimited_cost_model (LOOP_VINFO_LOOP (loop_vinfo)))
possible_npeel_number++;
}
@@ -2696,7 +2696,7 @@ vect_estimate_min_profitable_iters
(loop_vec_info loop_vinfo,
void *target_cost_data = LOOP_VINFO_TARGET_COST_DATA (loop_vinfo);
/* Cost model disabled. */
- if (unlimited_cost_model ())
+ if (unlimited_cost_model (LOOP_VINFO_LOOP (loop_vinfo)))
{
dump_printf_loc (MSG_NOTE, vect_location, "cost model disabled.\n");
*ret_min_profitable_niters = 0;
@@ -2929,6 +2929,12 @@ vect_estimate_min_profitable_iters
(loop_vec_info loop_vinfo,
/* vector version will never be profitable. */
else
{
+ if (LOOP_VINFO_LOOP (loop_vinfo)->force_vect)
+ {
+ warning (OPT_Wopenmp_simd, "Vectorization did not happen
for the loop ",
+ "labeled as simd");
+ }
+
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"cost model: the vector iteration cost = %d "
@@ -2171,7 +2171,7 @@ vect_slp_analyze_bb_1 (basic_block bb)
}
/* Cost model: check if the vectorization is worthwhile. */
- if (!unlimited_cost_model ()
+ if (!unlimited_cost_model (NULL)
&& !vect_bb_vectorization_profitable_p (bb_vinfo))
{
if (dump_enabled_p ())
@@ -919,9 +919,12 @@ known_alignment_for_access_p (struct
data_reference *data_ref_info)
/* Return true if the vect cost model is unlimited. */
static inline bool
-unlimited_cost_model ()
+unlimited_cost_model (loop_p loop)
{
- return flag_vect_cost_model == VECT_COST_MODEL_UNLIMITED;
+ return (flag_vect_cost_model == VECT_COST_MODEL_UNLIMITED
+ || (loop != NULL
+ && loop->force_vect
+ && flag_simd_cost_model == VECT_COST_MODEL_UNLIMITED));
}