libFirm 1.20
Phi node

Choose a value based on control flow. More...

Functions

int is_Phi0 (const ir_node *n)
 Returns 1 if irg in phase phase_building and the Phi has zero predecessors.
ir_node ** get_Phi_preds_arr (ir_node *node)
 Returns all phi predecessors as array.
int get_Phi_n_preds (const ir_node *node)
 Returns number of predecessors of phi node node.
ir_nodeget_Phi_pred (const ir_node *node, int pos)
 Returns the predecessor with number pos of phi node node.
void set_Phi_pred (ir_node *node, int pos, ir_node *pred)
 Sets value pred as predecessor number pos of phi node node.
ir_nodeget_Phi_next (const ir_node *phi)
 Returns the next element of a block phi list.
void set_Phi_next (ir_node *phi, ir_node *next)
 Sets the next link of a block Phi list.
ir_nodenew_rd_Phi (dbg_info *dbgi, ir_node *block, int arity, ir_node *const *in, ir_mode *mode)
 Construct a Phi node.
ir_nodenew_r_Phi (ir_node *block, int arity, ir_node *const *in, ir_mode *mode)
 Construct a Phi node.
ir_nodenew_d_Phi (dbg_info *dbgi, int arity, ir_node *const *in, ir_mode *mode)
 Construct a Phi node.
ir_nodenew_Phi (int arity, ir_node *const *in, ir_mode *mode)
 Construct a Phi node.
int is_Phi (const ir_node *node)
 Test if node is a Phi.
ir_opget_op_Phi (void)
 Returns opcode for Phi nodes.

Variables

ir_opop_Phi
 Phi opcode.

Detailed Description

Choose a value based on control flow.

A phi node has 1 input for each predecessor of its block. If a block is entered from its nth predecessor all phi nodes produce their nth input as result.


Function Documentation

ir_op* get_op_Phi ( void  )

Returns opcode for Phi nodes.

int get_Phi_n_preds ( const ir_node node)

Returns number of predecessors of phi node node.

ir_node* get_Phi_next ( const ir_node phi)

Returns the next element of a block phi list.

ir_node* get_Phi_pred ( const ir_node node,
int  pos 
)

Returns the predecessor with number pos of phi node node.

This is the value selected when control flow comes from predecessor pos of the containing basic block.

ir_node** get_Phi_preds_arr ( ir_node node)

Returns all phi predecessors as array.

int is_Phi ( const ir_node node)

Test if node is a Phi.

Returns:
1 if the node is a Phi node, 0 otherwise
int is_Phi0 ( const ir_node n)

Returns 1 if irg in phase phase_building and the Phi has zero predecessors.

It's a "Phi0" then.

ir_node* new_d_Phi ( dbg_info dbgi,
int  arity,
ir_node *const *  in,
ir_mode mode 
)

Construct a Phi node.

Parameters:
dbgiA pointer to debug information.
aritysize of additional inputs array
inadditional inputs
modemode of the operations result
ir_node* new_Phi ( int  arity,
ir_node *const *  in,
ir_mode mode 
)

Construct a Phi node.

Parameters:
aritysize of additional inputs array
inadditional inputs
modemode of the operations result
ir_node* new_r_Phi ( ir_node block,
int  arity,
ir_node *const *  in,
ir_mode mode 
)

Construct a Phi node.

Parameters:
blockThe IR block the node belongs to.
aritysize of additional inputs array
inadditional inputs
modemode of the operations result
ir_node* new_rd_Phi ( dbg_info dbgi,
ir_node block,
int  arity,
ir_node *const *  in,
ir_mode mode 
)

Construct a Phi node.

Parameters:
dbgiA pointer to debug information.
blockThe IR block the node belongs to.
aritysize of additional inputs array
inadditional inputs
modemode of the operations result
void set_Phi_next ( ir_node phi,
ir_node next 
)

Sets the next link of a block Phi list.

void set_Phi_pred ( ir_node node,
int  pos,
ir_node pred 
)

Sets value pred as predecessor number pos of phi node node.


Variable Documentation

Phi opcode.

Definition at line 284 of file opcodes.h.