* 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
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);
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);
{
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 {
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));
}
node = def;
- def = get_irn_link(node);
+ def = (ir_node*)get_irn_link(node);
}
/* block in dominance frontier? create a phi then */
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;