Commit 24a97175 authored by Matthias Braun's avatar Matthias Braun
Browse files

remove Phi0 concept at some places

parent eff21a4b
......@@ -602,11 +602,6 @@ FIRM_API int is_Cast_downcast(ir_node *node);
* @{
*/
/**
* Returns 1 if irg in phase phase_building and the Phi has zero
* predecessors. It's a "Phi0" then.
*/
FIRM_API int is_Phi0(const ir_node *n);
/**
* Returns all phi predecessors as array
*/
......
......@@ -379,8 +379,6 @@ unsigned (get_irn_opcode)(const ir_node *node)
const char *get_irn_opname(const ir_node *node)
{
assert(node);
if (is_Phi0(node)) return "Phi0";
return get_id_str(node->op->name);
}
......@@ -1107,15 +1105,6 @@ void set_binop_right(ir_node *node, ir_node *right)
set_irn_n(node, node->op->op_index + 1, right);
}
int is_Phi0(const ir_node *n)
{
assert(n);
return ((get_irn_op(n) == op_Phi) &&
(get_irn_arity(n) == 0) &&
(get_irg_phase_state(get_irn_irg(n)) == phase_building));
}
ir_node **get_Phi_preds_arr(ir_node *node)
{
assert(is_Phi(node));
......@@ -1124,19 +1113,19 @@ ir_node **get_Phi_preds_arr(ir_node *node)
int get_Phi_n_preds(const ir_node *node)
{
assert(is_Phi(node) || is_Phi0(node));
return (get_irn_arity(node));
assert(is_Phi(node));
return get_irn_arity(node);
}
ir_node *get_Phi_pred(const ir_node *node, int pos)
{
assert(is_Phi(node) || is_Phi0(node));
assert(is_Phi(node));
return get_irn_n(node, pos);
}
void set_Phi_pred(ir_node *node, int pos, ir_node *pred)
{
assert(is_Phi(node) || is_Phi0(node));
assert(is_Phi(node));
set_irn_n(node, pos, pred);
}
......
......@@ -6516,11 +6516,11 @@ static int node_cmp_attr_Sel(const ir_node *a, const ir_node *b)
/** Compares the attributes of two Phi nodes. */
static int node_cmp_attr_Phi(const ir_node *a, const ir_node *b)
{
/* we can only enter this function if both nodes have the same number of inputs,
hence it is enough to check if one of them is a Phi0 */
if (is_Phi0(a)) {
/* check the Phi0 pos attribute */
return a->attr.phi.u.pos != b->attr.phi.u.pos;
(void) b;
/* do not CSE Phi-nodes without any inputs when building new graphs */
if (get_irn_arity(a) == 0 &&
get_irg_phase_state(get_irn_irg(a)) == phase_building) {
return 1;
}
return 0;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment