- bitset_clear(uses, def->id);
- bitset_set(to_visit, bli->id);
- do {
- int id = bitset_next_set(to_visit, 0);
- bl_info_t *bi = lv->map[id];
+ /* get the dominance range which really matters. all uses outside
+ * the definition's dominance range are not to consider. note,
+ * that the definition itself is also not considered. The case
+ * where bl == def_bl is considered above. */
+ min_dom = get_Block_dom_tree_pre_num(def_bl) + 1;
+ max_dom = get_Block_dom_max_subtree_pre_num(def_bl);
+
+ DBG((lv->dbg, LEVEL_2, "\tuses: %B\n", uses));
+
+ /* prepare a set with all reachable back edge targets.
+ * this will determine our "looking points" from where
+ * we will search/find the calculated uses. */
+ Tq = bli->be_tgt_reach;
+
+ /* now, visit all viewing points in the temporary bitset lying
+ * in the dominance range of the variable. Note that for reducible
+ * flow-graphs the first iteration is sufficient and the loop
+ * will be left. */
+ DBG((lv->dbg, LEVEL_2, "\tbe tgt reach: %B, dom span: [%d, %d]\n", Tq, min_dom, max_dom));
+ i = bitset_next_set(Tq, min_dom);
+ while (i <= max_dom) {
+ bl_info_t *ti = lv->map[i];
+ int use_in_current_block = bitset_is_set(uses, ti->id);