stmt = create_phi_node (vb, loop->header);
SSA_NAME_DEF_STMT (vb) = stmt;
- add_phi_arg (&stmt, initial, loop_preheader_edge (loop));
- add_phi_arg (&stmt, va, loop_latch_edge (loop));
+ add_phi_arg (stmt, initial, loop_preheader_edge (loop));
+ add_phi_arg (stmt, va, loop_latch_edge (loop));
}
/* Add exit phis for the USE on EXIT. */
phi = create_phi_node (use, exit);
FOR_EACH_EDGE (e, ei, exit->preds)
- add_phi_arg (&phi, use, e);
+ add_phi_arg (phi, use, e);
SSA_NAME_DEF_STMT (use) = def_stmt;
}
{
for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
for (i = 0; i < (unsigned) PHI_NUM_ARGS (phi); i++)
- find_uses_to_rename_use (PHI_ARG_EDGE (phi, i)->src,
+ find_uses_to_rename_use (EDGE_PRED (bb, i)->src,
PHI_ARG_DEF (phi, i), use_blocks);
for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
new_name = duplicate_ssa_name (name, NULL);
new_phi = create_phi_node (new_name, bb);
SSA_NAME_DEF_STMT (new_name) = new_phi;
- add_phi_arg (&new_phi, name, exit);
+ add_phi_arg (new_phi, name, exit);
SET_USE (op_p, new_name);
}
}
SSA_NAME_DEF_STMT (PHI_RESULT (phi)) = phi;
}
-/* The same ad cfgloopmanip.c:duplicate_loop_to_header_edge, but also updates
+/* The same as cfgloopmanip.c:duplicate_loop_to_header_edge, but also updates
ssa. In order to achieve this, only loops whose exits all lead to the same
location are handled.
for (phi2 = phi_nodes (second), phi1 = phi_nodes (first);
phi2 && phi1;
- phi2 = TREE_CHAIN (phi2), phi1 = TREE_CHAIN (phi1))
+ phi2 = PHI_CHAIN (phi2), phi1 = PHI_CHAIN (phi1))
{
- int i;
- for (i = 0; i < PHI_NUM_ARGS (phi2); i++)
+ edge e2 = find_edge (new_head, second);
+
+ if (e2)
{
- if (PHI_ARG_EDGE (phi2, i)->src == new_head)
- {
- tree def = PHI_ARG_DEF (phi2, i);
- add_phi_arg (&phi1, def, e);
- }
+ tree def = PHI_ARG_DEF (phi2, e2->dest_idx);
+ add_phi_arg (phi1, def, e);
}
}
}
/* Adjust entry edge for lv.
- e is a incoming edge.
+ e is an incoming edge.
--- edge e ---- > [second_head]