+2017-05-11 Bin Cheng <bin.cheng@arm.com>
+
+ * tree-ssa-loop-ivopts.c (relate_compare_use_with_all_cands): New.
+ (find_iv_candidates): Call relate_compare_use_with_all_cands.
+
2017-05-11 Bin Cheng <bin.cheng@arm.com>
* tree-ssa-loop-ivopts.c (struct iv_cand): New field inv_exprs.
}
}
+/* Relate compare use with all candidates. */
+
+static void
+relate_compare_use_with_all_cands (struct ivopts_data *data)
+{
+ unsigned i, max_id = data->vcands.length () - 1;
+ for (i = 0; i < data->vgroups.length (); i++)
+ {
+ struct iv_group *group = data->vgroups[i];
+
+ if (group->type == USE_COMPARE)
+ bitmap_set_range (group->related_cands, 0, max_id);
+ }
+}
+
/* Finds the candidates for the induction variables. */
static void
/* Record the important candidates. */
record_important_candidates (data);
+ /* Relate compare iv_use with all candidates. */
+ if (!data->consider_all_candidates)
+ relate_compare_use_with_all_cands (data);
+
if (dump_file && (dump_flags & TDF_DETAILS))
{
unsigned i;