if (dra == drb)
return 0;
- /* DRs in different basic-blocks never belong to the same group. */
- int bb_index1 = gimple_bb (DR_STMT (dra))->index;
- int bb_index2 = gimple_bb (DR_STMT (drb))->index;
- if (bb_index1 != bb_index2)
- return bb_index1 < bb_index2 ? -1 : 1;
-
/* Different group IDs lead never belong to the same group. */
if (dra_pair.second != drb_pair.second)
return dra_pair.second < drb_pair.second ? -1 : 1;
datarefs_copy.create (datarefs.length ());
for (unsigned i = 0; i < datarefs.length (); i++)
{
- int group_id = dataref_groups ? (*dataref_groups)[i] : 0;
+ int group_id;
+ /* If the caller computed DR grouping use that, otherwise group by
+ basic blocks. */
+ if (dataref_groups)
+ group_id = (*dataref_groups)[i];
+ else
+ group_id = gimple_bb (DR_STMT (datarefs[i]))->index;
datarefs_copy.quick_push (data_ref_pair (datarefs[i], group_id));
}
datarefs_copy.qsort (dr_group_sort_cmp);
matters we can push those to a worklist and re-iterate
over them. The we can just skip ahead to the next DR here. */
- /* DRs in a different BBs should not be put into the same
+ /* DRs in a different DR group should not be put into the same
interleaving group. */
- int bb_index1 = gimple_bb (DR_STMT (dra))->index;
- int bb_index2 = gimple_bb (DR_STMT (drb))->index;
- if (bb_index1 != bb_index2)
- break;
-
if (dra_group_id != drb_group_id)
break;
&dataref_groups, current_group))
++current_group;
}
+ /* New BBs always start a new DR group. */
+ ++current_group;
}
return vect_slp_region (bbs, datarefs, &dataref_groups, insns);