-#if 0
-/**
- * Checks if node is hoistable into block.
- *
- * A clean node in block block can be hoisted above block succ.
- * A node is not clean if its representative is killed in block block.
- * The node can still be hoisted into block block.
- *
- * @param n the node to be checked
- * @param block the block to be hoisted into
- * @returns block which node can be hoisted above
- */
-static unsigned is_hoistable_above(ir_node *node, ir_node *block, unsigned translated)
-{
- int i;
- int arity = get_irn_arity(node);
-
- /* make sure that node can be hoisted above block */
-
- if (is_irn_constlike(node))
- return 1;
-
- for (i = 0; i < arity; ++i) {
- block_info *info = get_block_info(block);
- ir_node *pred = get_irn_n(node, i);
- ir_node *pred_value = identify(pred);
- ir_node *pred_block = get_nodes_block(pred);
-
- /* predecessor strictly dominating */
- if (block_strictly_dominates(pred_block, block))
- continue;
-
- /* if we didn't translate the exact representative we cannot translate */
- if (translated && !get_translated(pred_block, pred))
- return 0;
-
- if (! ir_valueset_lookup(info->antic_in, pred_value))
- return 0;
- }
- return 1;
-}
-#endif
-
-#if LOADS || DIVMODS
-/* Helper function to compare the values of pred and avail_pred. */
-static unsigned match_pred(ir_node *pred, ir_node *avail_pred, ir_node *block, int pos)
-{
- ir_node *avail_value = identify(avail_pred);
- ir_node *trans_pred = get_translated_pred(block, pos, pred);
- ir_node *value;
-
- if (trans_pred == NULL)
- trans_pred = pred;
- value = identify(trans_pred);
-
- DB((dbg, LEVEL_3, "manual compare %+F %+F\n", pred, avail_pred));
-
- return (value == avail_value);
-}
-#endif
-
-#if LOADS
-/**
- * Does phi translation for redundant load nodes only.
- * Returns NULL for non-redundant loads, which need to be phi translated.
- * Loads are compared by comparing their pointer values,
- * and assuring that they are adjacent.
- * This is equivalent to what phi_translation does.
- */
-static ir_node *phi_translate_load(ir_node *load, ir_node *block, int pos)
-{
- ir_node *mem = get_Load_mem(load);
- ir_node *trans = get_translated_pred(block, pos, mem);
-
- if (trans == NULL)
- trans = mem;
-
- /* no partial redundancy if this is a mode_M phi */
- if (is_Proj(trans)) {
- /* The last memory operation in predecessor block */
- ir_node *avail_load = get_Proj_pred(trans);
-
- /* memop is a load with matching type */
- if (is_Load(avail_load) &&
- get_Load_mode(load) == get_Load_mode(avail_load)) {
-
- unsigned match = match_pred(get_Load_ptr(load), get_Load_ptr(avail_load), block, pos);
-
- if (match)
- return avail_load;
- }
- }
- return NULL;
-}
-#endif
-
-#if DIVMODS
-/**
- * Does phi translation for redundant Div/Mod nodes only.
- * Returns NULL for non-redundant node, which needs to be phi translated.
- */
-static ir_node *phi_translate_divmod(ir_node *divmod, ir_node *block, int pos)
-{
- ir_node *mem = get_memop_mem(divmod);
- ir_node *trans = get_translated_pred(block, pos, mem);
-
- if (trans == NULL)
- trans = mem;
-
- /* no partial redundancy if this is a mode_M phi */
- if (is_Proj(trans)) {
- /* The last memory operation in predecessor block */
- ir_node *avail_op = get_Proj_pred(trans);
-
- if (get_irn_op(divmod) == get_irn_op(avail_op)) {
- unsigned left, right;
-
- if (is_Div(avail_op)) {
- if (get_Div_resmode(divmod) == get_Div_resmode(avail_op) &&
- get_Div_no_remainder(divmod) == get_Div_no_remainder(avail_op)) {
-
- left = match_pred(get_Div_left(divmod), get_Div_left(avail_op), block, pos);
- right = match_pred(get_Div_right(divmod), get_Div_right(avail_op), block, pos);
-
- if (left && right)
- return avail_op;
- }
- } else if (is_Mod(avail_op)) {
- if (get_Mod_resmode(divmod) == get_Mod_resmode(avail_op)) {
-
- left = match_pred(get_Mod_left(divmod), get_Mod_left(avail_op), block, pos);
- right = match_pred(get_Mod_right(divmod), get_Mod_right(avail_op), block, pos);
-
- if (left && right)
- return avail_op;
- }
- }
- }
- }
- return NULL;
-}
-#endif
-