Removed unused variables.
[libfirm] / ir / be / bessaconstr.c
index eadea71..031493b 100644 (file)
@@ -29,7 +29,7 @@
  * to their closest copy while introducing phis as necessary.
  *
  * Algorithm: Mark all blocks in the iterated dominance frontiers of the value
- * and it's copies. Link the copies ordered by dominance to the blocks.  Then
+ * and its copies. Link the copies ordered by dominance to the blocks.  Then
  * we search for each use all definitions in the current block, if none is
  * found, then we search one in the immediate dominator. If we are in a block
  * of the dominance frontier, create a phi and do the same search for all
@@ -83,7 +83,7 @@ static void mark_iterated_dominance_frontiers(
        stat_ev_tim_push();
        while (!waitq_empty(env->worklist)) {
                int i;
-               ir_node *block = waitq_get(env->worklist);
+               ir_node  *block    = (ir_node*)waitq_get(env->worklist);
                ir_node **domfront = be_get_dominance_frontier(env->domfronts, block);
                int domfront_len = ARR_LEN(domfront);
 
@@ -126,14 +126,11 @@ static ir_node *create_phi(be_ssa_construction_env_t *env, ir_node *block,
                ins[i] = dummy;
        }
        phi = be_new_Phi(block, n_preds, ins, env->mode, env->phi_cls);
+       sched_add_after(block, phi);
        if (env->new_phis != NULL) {
                ARR_APP1(ir_node*, env->new_phis, phi);
        }
 
-       if (env->mode != mode_M) {
-               sched_add_after(block, phi);
-       }
-
        DBG((dbg, LEVEL_2, "\tcreating phi %+F in %+F\n", phi, block));
        set_irn_link(link_with, phi);
        mark_irn_visited(block);
@@ -160,7 +157,7 @@ static ir_node *search_def_end_of_block(be_ssa_construction_env_t *env,
 {
        if (irn_visited(block)) {
                assert(get_irn_link(block) != NULL);
-               return get_irn_link(block);
+               return (ir_node*)get_irn_link(block);
        } else if (Block_block_visited(block)) {
                return create_phi(env, block, block);
        } else {
@@ -189,7 +186,7 @@ static ir_node *search_def(be_ssa_construction_env_t *env, ir_node *at)
           the one immediately dominating us
         */
        node = block;
-       def  = get_irn_link(node);
+       def  = (ir_node*)get_irn_link(node);
        while (def != NULL) {
                if (!value_dominates(at, def)) {
                        DBG((dbg, LEVEL_3, "\t...found dominating def %+F\n", def));
@@ -197,7 +194,7 @@ static ir_node *search_def(be_ssa_construction_env_t *env, ir_node *at)
                }
 
                node = def;
-               def  = get_irn_link(node);
+               def  = (ir_node*)get_irn_link(node);
        }
 
        /* block in dominance frontier? create a phi then */
@@ -223,7 +220,7 @@ static void introduce_def_at_block(ir_node *block, ir_node *def)
                ir_node *current_def;
 
                for (;;) {
-                       current_def = get_irn_link(node);
+                       current_def = (ir_node*)get_irn_link(node);
                        if (current_def == def) {
                                /* already in block */
                                return;