* @param in[] An array of control predecessors. The length of
* the array must be 'arity'. The constructor copies this array.
*/
-ir_node *new_rd_Block (dbg_info *db, ir_graph *irg, int arity, ir_node *in[]);
+ir_node *new_rd_Block(dbg_info *db, ir_graph *irg, int arity, ir_node *in[]);
/** Constructor for a Start node.
*
* @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
*/
-ir_node *new_rd_Start (dbg_info *db, ir_graph *irg, ir_node *block);
+ir_node *new_rd_Start(dbg_info *db, ir_graph *irg, ir_node *block);
/** Constructor for a End node.
*
* @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
*/
-ir_node *new_rd_End (dbg_info *db, ir_graph *irg, ir_node *block);
+ir_node *new_rd_End(dbg_info *db, ir_graph *irg, ir_node *block);
/** Constructor for a Jmp node.
*
* Jmp represents control flow to a single control successor.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
*/
-ir_node *new_rd_Jmp (dbg_info *db, ir_graph *irg, ir_node *block);
+ir_node *new_rd_Jmp(dbg_info *db, ir_node *block);
/** Constructor for an IJmp node.
*
* statically known i.e. an indirect Jmp.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *tgt The IR node representing the target address.
*/
-ir_node *new_rd_IJmp (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *tgt);
+ir_node *new_rd_IJmp(dbg_info *db, ir_node *block, ir_node *tgt);
/** Constructor for a Break node.
*
* behind Call nodes to represent the control flow to called procedures.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belong to.
* @param *block The block the node belong to.
*/
-ir_node *new_rd_Break (dbg_info *db, ir_graph *irg, ir_node *block);
+ir_node *new_rd_Break(dbg_info *db, ir_node *block);
/** Constructor for a Cond node.
*
* longs.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *c The conditions parameter. Can be of mode b or I_u.
*/
-ir_node *new_rd_Cond (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *c);
+ir_node *new_rd_Cond(dbg_info *db, ir_node *block, ir_node *c);
/** Constructor for a Return node.
*
* can end regular control flow.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *store The state of memory.
* @param arity Number of return values.
* @param *in Array of length arity with return values. The constructor copies this array.
*/
-ir_node *new_rd_Return (dbg_info *db, ir_graph *irg, ir_node *block,
- ir_node *store, int arity, ir_node *in[]);
+ir_node *new_rd_Return(dbg_info *db, ir_node *block,
+ ir_node *store, int arity, ir_node *in[]);
/** Constructor for a Const_type node.
*
* @param *con Points to an entry in the constant table.
* @param *tp The type of the constant.
*/
-ir_node *new_rd_Const_type (dbg_info *db, ir_graph *irg,
+ir_node *new_rd_Const_type(dbg_info *db, ir_graph *irg,
tarval *con, ir_type *tp);
/** Constructor for a Const node.
* @param *irg The IR graph the node belongs to.
* @param *con Points to an entry in the constant table.
*/
-ir_node *new_rd_Const (dbg_info *db, ir_graph *irg, tarval *con);
+ir_node *new_rd_Const(dbg_info *db, ir_graph *irg, tarval *con);
/** Constructor for a Const node.
*
* @param *mode The mode of the operands and results.
* @param value A value from which the tarval is made.
*/
-ir_node *new_rd_Const_long (dbg_info *db, ir_graph *irg,
- ir_mode *mode, long value);
+ir_node *new_rd_Const_long(dbg_info *db, ir_graph *irg,
+ ir_mode *mode, long value);
/** Constructor for a SymConst_type node.
*
*
* @param *db A pointer for debug information.
* @param *irg The IR graph the node belongs to.
- * @param *block The IR block the node belongs to.
* @param mode The mode for the SymConst.
* @param symkind The kind of the symbolic constant: type_tag, size, addr_name or addr_ent.
* @param value A type, entity or a ident depending on the SymConst kind.
* @param tp The source type of the constant.
*/
-ir_node *new_rd_SymConst_type(dbg_info *db, ir_graph *irg, ir_node *block, ir_mode *mode,
+ir_node *new_rd_SymConst_type(dbg_info *db, ir_graph *irg, ir_mode *mode,
union symconst_symbol value,
symconst_kind symkind, ir_type *tp);
*
* Same as new_rd_SymConst_type, except that it sets the type to type_unknown.
*/
-ir_node *new_rd_SymConst(dbg_info *db, ir_graph *irg, ir_node *block, ir_mode *mode,
+ir_node *new_rd_SymConst(dbg_info *db, ir_graph *irg, ir_mode *mode,
union symconst_symbol value, symconst_kind symkind);
/** Constructor for a SymConst addr_ent node.
* inputs. It adds the two parameters 0, NULL.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *store The memory in which the object the entity should be
* selected from is allocated.
* single attribute out.
* @param *ent The entity to select.
*/
-ir_node *new_rd_simpleSel (dbg_info *db, ir_graph *irg, ir_node *block,
- ir_node *store, ir_node *objptr, ir_entity *ent);
+ir_node *new_rd_simpleSel(dbg_info *db, ir_node *block,
+ ir_node *store, ir_node *objptr, ir_entity *ent);
/** Constructor for a Sel node.
*
* node takes the required array indices as inputs.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *store The memory in which the object the entity should be selected
* from is allocated.
* element entity. The constructor copies this array.
* @param *ent The entity to select.
*/
-ir_node *new_rd_Sel (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *store,
- ir_node *objptr, int n_index, ir_node *index[], ir_entity *ent);
+ir_node *new_rd_Sel(dbg_info *db, ir_node *block, ir_node *store,
+ ir_node *objptr, int n_index, ir_node *index[], ir_entity *ent);
/** Constructor for a Call node.
*
* Represents all kinds of method and function calls.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *store The current memory state.
* @param *callee A pointer to the called procedure.
* @param *in[] An array with the procedure parameters. The constructor copies this array.
* @param *tp Type information of the procedure called.
*/
-ir_node *new_rd_Call (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *store,
- ir_node *callee, int arity, ir_node *in[], ir_type *tp);
+ir_node *new_rd_Call(dbg_info *db, ir_node *block, ir_node *store,
+ ir_node *callee, int arity, ir_node *in[], ir_type *tp);
/** Constructor for a ´Builtin node.
*
* Represents a call of a backend-specific builtin..
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *store The current memory state.
* @param arity The number of procedure parameters.
* @param kind The kind of the called builtin.
* @param *tp Type information of the procedure called.
*/
-ir_node *new_rd_Builtin(dbg_info *db, ir_graph *irg, ir_node *block, ir_node *store,
- int arity, ir_node *in[], ir_builtin_kind kind, ir_type *tp);
+ir_node *new_rd_Builtin(dbg_info *db, ir_node *block, ir_node *store,
+ int arity, ir_node *in[], ir_builtin_kind kind, ir_type *tp);
/** Constructor for a Add node.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *op1 The first operand.
* @param *op2 The second operand.
* @param *mode The mode of the operands and the result.
*/
-ir_node *new_rd_Add (dbg_info *db, ir_graph *irg, ir_node *block,
- ir_node *op1, ir_node *op2, ir_mode *mode);
+ir_node *new_rd_Add(dbg_info *db, ir_node *block,
+ ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Sub node.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *op1 The first operand.
* @param *op2 The second operand.
* @param *mode The mode of the operands and the result.
*/
-ir_node *new_rd_Sub (dbg_info *db, ir_graph *irg, ir_node *block,
- ir_node *op1, ir_node *op2, ir_mode *mode);
+ir_node *new_rd_Sub(dbg_info *db, ir_node *block,
+ ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Minus node.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *op The operand .
* @param *mode The mode of the operand and the result.
*/
-ir_node *new_rd_Minus (dbg_info *db, ir_graph *irg, ir_node *block,
- ir_node *op, ir_mode *mode);
+ir_node *new_rd_Minus(dbg_info *db, ir_node *block,
+ ir_node *op, ir_mode *mode);
/** Constructor for a Mul node.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *op1 The first operand.
* @param *op2 The second operand.
* @param *mode The mode of the operands and the result.
*/
-ir_node *new_rd_Mul (dbg_info *db, ir_graph *irg, ir_node *block,
- ir_node *op1, ir_node *op2, ir_mode *mode);
+ir_node *new_rd_Mul(dbg_info *db, ir_node *block,
+ ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Mulh node.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *op1 The first operand.
* @param *op2 The second operand.
* @param *mode The mode of the operands and the result.
*/
-ir_node *new_rd_Mulh (dbg_info *db, ir_graph *irg, ir_node *block,
- ir_node *op1, ir_node *op2, ir_mode *mode);
+ir_node *new_rd_Mulh(dbg_info *db, ir_node *block,
+ ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Quot node.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *memop The store needed to model exceptions
* @param *op1 The first operand.
* @param *mode The mode of the result.
* @param state The pinned state.
*/
-ir_node *new_rd_Quot (dbg_info *db, ir_graph *irg, ir_node *block,
- ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
+ir_node *new_rd_Quot(dbg_info *db, ir_node *block, ir_node *memop,
+ ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
/** Constructor for a DivMod node.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *memop The store needed to model exceptions
* @param *op1 The first operand.
* @param *mode The mode of the results.
* @param state The pinned state.
*/
-ir_node *new_rd_DivMod (dbg_info *db, ir_graph *irg, ir_node *block,
- ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
+ir_node *new_rd_DivMod(dbg_info *db, ir_node *block, ir_node *memop,
+ ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
/** Constructor for a Div node.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *memop The store needed to model exceptions
* @param *op1 The first operand.
* @param *mode The mode of the result.
* @param state The pinned state.
*/
-ir_node *new_rd_Div (dbg_info *db, ir_graph *irg, ir_node *block,
- ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
+ir_node *new_rd_Div(dbg_info *db, ir_node *block, ir_node *memop,
+ ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
/** Constructor for a remainderless Div node.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *memop The store needed to model exceptions
* @param *op1 The first operand.
* @param *mode The mode of the result.
* @param state The pinned state.
*/
-ir_node *new_rd_DivRL (dbg_info *db, ir_graph *irg, ir_node *block,
- ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
+ir_node *new_rd_DivRL(dbg_info *db, ir_node *block, ir_node *memop,
+ ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
/** Constructor for a Mod node.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *memop The store needed to model exceptions
* @param *op1 The first operand.
* @param *mode The mode of the result.
* @param state The pinned state.
*/
-ir_node *new_rd_Mod (dbg_info *db, ir_graph *irg, ir_node *block,
- ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
+ir_node *new_rd_Mod(dbg_info *db, ir_node *block, ir_node *memop,
+ ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
/** Constructor for a Abs node.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *op The operand
* @param *mode The mode of the operands and the result.
*/
-ir_node *new_rd_Abs (dbg_info *db, ir_graph *irg, ir_node *block,
- ir_node *op, ir_mode *mode);
+ir_node *new_rd_Abs(dbg_info *db, ir_node *block, ir_node *op, ir_mode *mode);
/** Constructor for a And node.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *op1 The first operand.
* @param *op2 The second operand.
* @param *mode The mode of the operands and the result.
*/
-ir_node *new_rd_And (dbg_info *db, ir_graph *irg, ir_node *block,
- ir_node *op1, ir_node *op2, ir_mode *mode);
+ir_node *new_rd_And(dbg_info *db, ir_node *block,
+ ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Or node.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *op1 The first operand.
* @param *op2 The second operand.
* @param *mode The mode of the operands and the result.
*/
-ir_node *new_rd_Or (dbg_info *db, ir_graph *irg, ir_node *block,
- ir_node *op1, ir_node *op2, ir_mode *mode);
+ir_node *new_rd_Or(dbg_info *db, ir_node *block,
+ ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Eor node.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *op1 The first operand.
* @param *op2 The second operand.
* @param *mode The mode of the operands and the results.
*/
-ir_node *new_rd_Eor (dbg_info *db, ir_graph *irg, ir_node *block,
- ir_node *op1, ir_node *op2, ir_mode *mode);
+ir_node *new_rd_Eor(dbg_info *db, ir_node *block,
+ ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Not node.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *op The operand.
* @param *mode The mode of the operand and the result.
*/
-ir_node *new_rd_Not (dbg_info *db, ir_graph *irg, ir_node *block,
- ir_node *op, ir_mode *mode);
+ir_node *new_rd_Not(dbg_info *db, ir_node *block, ir_node *op, ir_mode *mode);
/** Constructor for a Cmp node.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *op1 The first operand.
* @param *op2 The second operand.
*/
-ir_node *new_rd_Cmp (dbg_info *db, ir_graph *irg, ir_node *block,
- ir_node *op1, ir_node *op2);
+ir_node *new_rd_Cmp(dbg_info *db, ir_node *block, ir_node *op1, ir_node *op2);
/** Constructor for a Shl node.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *op The operand.
* @param *k The number of bits to shift the operand .
* @param *mode The mode of the operand and the result.
*/
-ir_node *new_rd_Shl (dbg_info *db, ir_graph *irg, ir_node *block,
- ir_node *op, ir_node *k, ir_mode *mode);
+ir_node *new_rd_Shl(dbg_info *db, ir_node *block,
+ ir_node *op, ir_node *k, ir_mode *mode);
/** Constructor for a Shr node.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *op The operand.
* @param *k The number of bits to shift the operand .
* @param *mode The mode of the operand and the result.
*/
-ir_node *new_rd_Shr (dbg_info *db, ir_graph *irg, ir_node *block,
- ir_node *op, ir_node *k, ir_mode *mode);
+ir_node *new_rd_Shr(dbg_info *db, ir_node *block,
+ ir_node *op, ir_node *k, ir_mode *mode);
/** Constructor for a Shrs node.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *op The operand.
* @param *k The number of bits to shift the operand.
* @param *mode The mode of the operand and the result.
*/
-ir_node *new_rd_Shrs (dbg_info *db, ir_graph *irg, ir_node *block,
- ir_node *op, ir_node *k, ir_mode *mode);
+ir_node *new_rd_Shrs(dbg_info *db, ir_node *block,
+ ir_node *op, ir_node *k, ir_mode *mode);
/** Constructor for a Rotl node.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *op The operand.
* @param *k The number of bits to rotate the operand.
* @param *mode The mode of the operand.
*/
-ir_node *new_rd_Rotl (dbg_info *db, ir_graph *irg, ir_node *block,
- ir_node *op, ir_node *k, ir_mode *mode);
+ir_node *new_rd_Rotl(dbg_info *db, ir_node *block,
+ ir_node *op, ir_node *k, ir_mode *mode);
/** Constructor for a Conv node.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *op The operand.
* @param *mode The mode of this the operand muss be converted .
*/
-ir_node *new_rd_Conv (dbg_info *db, ir_graph *irg, ir_node *block,
- ir_node *op, ir_mode *mode);
+ir_node *new_rd_Conv(dbg_info *db, ir_node *block, ir_node *op, ir_mode *mode);
/** Constructor for a strictConv node.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *op The operand.
* @param *mode The mode of this the operand muss be converted .
*/
-ir_node *new_rd_strictConv (dbg_info *db, ir_graph *irg, ir_node *block,
- ir_node *op, ir_mode *mode);
+ir_node *new_rd_strictConv(dbg_info *db, ir_node *block,
+ ir_node *op, ir_mode *mode);
/** Constructor for a Cast node.
*
* High level type cast.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *op The operand.
* @param *to_tp The type of this the operand muss be casted .
*/
-ir_node *new_rd_Cast (dbg_info *db, ir_graph *irg, ir_node *block,
- ir_node *op, ir_type *to_tp);
+ir_node *new_rd_Cast(dbg_info *db, ir_node *block,
+ ir_node *op, ir_type *to_tp);
/** Constructor for a Carry node.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *op1 The first operand.
* @param *op2 The second operand.
* @param *mode The mode of the operands and the result.
*/
-ir_node *new_rd_Carry (dbg_info *db, ir_graph *irg, ir_node *block,
- ir_node *op1, ir_node *op2, ir_mode *mode);
+ir_node *new_rd_Carry(dbg_info *db, ir_node *block,
+ ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Borrow node.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *op1 The first operand.
* @param *op2 The second operand.
* @param *mode The mode of the operands and the result.
*/
-ir_node *new_rd_Borrow (dbg_info *db, ir_graph *irg, ir_node *block,
- ir_node *op1, ir_node *op2, ir_mode *mode);
+ir_node *new_rd_Borrow(dbg_info *db, ir_node *block,
+ ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Phi node.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param arity The number of predecessors
* @param *in[] Array with predecessors. The constructor copies this array.
* @param *mode The mode of it's inputs and output.
*/
-ir_node *new_rd_Phi (dbg_info *db, ir_graph *irg, ir_node *block, int arity,
- ir_node *in[], ir_mode *mode);
+ir_node *new_rd_Phi(dbg_info *db, ir_node *block, int arity,
+ ir_node *in[], ir_mode *mode);
/** Constructor for a Load node.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *store The current memory
* @param *adr A pointer to the variable to be read in this memory.
* @param *mode The mode of the value to be loaded.
* @param flags Additional flags for alignment, volatility and pin state.
*/
-ir_node *new_rd_Load (dbg_info *db, ir_graph *irg, ir_node *block,
- ir_node *store, ir_node *adr, ir_mode *mode, ir_cons_flags flags);
+ir_node *new_rd_Load(dbg_info *db, ir_node *block, ir_node *store,
+ ir_node *adr, ir_mode *mode, ir_cons_flags flags);
/** Constructor for a Store node.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *store The current memory
* @param *adr A pointer to the variable to be read in this memory.
* @param *val The value to write to this variable.
* @param flags Additional flags for alignment, volatility and pin state.
*/
-ir_node *new_rd_Store (dbg_info *db, ir_graph *irg, ir_node *block,
- ir_node *store, ir_node *adr, ir_node *val, ir_cons_flags flags);
+ir_node *new_rd_Store(dbg_info *db, ir_node *block, ir_node *store,
+ ir_node *adr, ir_node *val, ir_cons_flags flags);
/** Constructor for a Alloc node.
*
* The Alloc node extends the memory by space for an entity of type alloc_type.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *store The memory which shall contain the new variable.
* @param *size The number of bytes to allocate.
* @param *alloc_type The type of the allocated variable.
* @param where Where to allocate the variable, either heap_alloc or stack_alloc.
*/
-ir_node *new_rd_Alloc (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *store,
- ir_node *size, ir_type *alloc_type, ir_where_alloc where);
+ir_node *new_rd_Alloc(dbg_info *db, ir_node *block, ir_node *store,
+ ir_node *size, ir_type *alloc_type, ir_where_alloc where);
/** Constructor for a Free node.
*
* arg. Type indicates the type of the entity the argument points to.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *store The memory which shall contain the new variable.
* @param *ptr The pointer to the object to free.
* @param *free_type The type of the freed variable.
* @param where Where the variable was allocated, either heap_alloc or stack_alloc.
*/
-ir_node *new_rd_Free (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *store,
- ir_node *ptr, ir_node *size, ir_type *free_type, ir_where_alloc where);
+ir_node *new_rd_Free(dbg_info *db, ir_node *block, ir_node *store,
+ ir_node *ptr, ir_node *size, ir_type *free_type, ir_where_alloc where);
/** Constructor for a Sync node.
*
* value in all memories where it occurs.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param arity The number of memories to synchronize.
* @param *in[] An array of pointers to nodes that produce an output of type
* memory. The constructor copies this array.
*/
-ir_node *new_rd_Sync (dbg_info *db, ir_graph *irg, ir_node *block, int arity, ir_node *in[]);
+ir_node *new_rd_Sync(dbg_info *db, ir_node *block, int arity, ir_node *in[]);
/** Constructor for a Proj node.
*
* position of the value within the tuple.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param arg A node producing a tuple. The node must have mode_T.
* @param *mode The mode of the value to project.
* @param proj The position of the value in the tuple.
*/
-ir_node *new_rd_Proj (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *arg,
- ir_mode *mode, long proj);
+ir_node *new_rd_Proj(dbg_info *db, ir_node *block, ir_node *arg,
+ ir_mode *mode, long proj);
/** Constructor for a defaultProj node.
*
* Represents the default control flow of a Switch-Cond node.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param arg A node producing a tuple.
* @param max_proj The end position of the value in the tuple.
*/
-ir_node *new_rd_defaultProj (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *arg,
- long max_proj);
+ir_node *new_rd_defaultProj(dbg_info *db, ir_node *block,
+ ir_node *arg, long max_proj);
/** Constructor for a Tuple node.
*
* without changing the corresponding Proj nodes.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param arity The number of tuple elements.
* @param *in[] An array containing pointers to the nodes producing the tuple
* elements. The constructor copies this array.
*/
-ir_node *new_rd_Tuple (dbg_info *db, ir_graph *irg, ir_node *block,
- int arity, ir_node *in[]);
+ir_node *new_rd_Tuple(dbg_info *db, ir_node *block,
+ int arity, ir_node *in[]);
/** Constructor for a Id node.
*
* value.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *val The value
* @param *mode The mode of *val.
*/
-ir_node *new_rd_Id (dbg_info *db, ir_graph *irg, ir_node *block,
- ir_node *val, ir_mode *mode);
+ir_node *new_rd_Id(dbg_info *db, ir_node *block,
+ ir_node *val, ir_mode *mode);
/** Constructor for a Confirm node.
*
* Example: If the value never exceeds '100' this is expressed by placing a
* Confirm node val = new_d_Confirm(db, val, 100, '<=') on the dataflow edge.
*
- * @param *irg The IR graph the node belong to.
- * @param *block The IR block the node belong to.
* @param *db A pointer for debug information.
+ * @param *block The IR block the node belong to.
* @param *val The value we express a constraint for
* @param *bound The value to compare against. Must be a firm node, typically a constant.
* @param cmp The compare operation.
*/
-ir_node *new_rd_Confirm (dbg_info *db, ir_graph *irg, ir_node *block,
- ir_node *val, ir_node *bound, pn_Cmp cmp);
+ir_node *new_rd_Confirm(dbg_info *db, ir_node *block,
+ ir_node *val, ir_node *bound, pn_Cmp cmp);
/** Constructor for an Unknown node.
*
* node.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belong to.
* @param *block The block the node belong to.
* @param *callee The call node visible in the intra procedural view.
*/
-ir_node *new_rd_CallBegin(dbg_info *db, ir_graph *irg, ir_node *block, ir_node *ptr, ir_node *call);
+ir_node *new_rd_CallBegin(dbg_info *db, ir_node *block, ir_node *ptr, ir_node *call);
/** Constructor for a EndReg node.
*
* @param *irg The IR graph the node belong to.
* @param *block The block the node belong to.
*/
-ir_node *new_rd_EndReg (dbg_info *db, ir_graph *irg, ir_node *block);
+ir_node *new_rd_EndReg(dbg_info *db, ir_graph *irg, ir_node *block);
/** Constructor for a EndExcept node.
*
* The constructor builds the Filter in intraprocedural view.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belong to.
* @param *block The block the node belong to.
* @param *arg The tuple value to project from.
* @param *mode The mode of the projected value.
* @param proj The position in the tuple to project from.
*/
-ir_node *new_rd_Filter (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *arg,
- ir_mode *mode, long proj);
+ir_node *new_rd_Filter(dbg_info *db,ir_node *block, ir_node *arg,
+ ir_mode *mode, long proj);
/** Constructor for a Mux node.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belong to.
* @param *block The block the node belong to.
* @param *sel The ir_node that calculates the boolean select.
* @param *ir_true The ir_node that calculates the true result.
* @param *ir_false The ir_node that calculates the false result.
* @param *mode The mode of the node (and it_true and ir_false).
*/
-ir_node *new_rd_Mux (dbg_info *db, ir_graph *irg, ir_node *block,
- ir_node *sel, ir_node *ir_false, ir_node *ir_true, ir_mode *mode);
+ir_node *new_rd_Mux(dbg_info *db, ir_node *block, ir_node *sel,
+ ir_node *ir_false, ir_node *ir_true, ir_mode *mode);
/** Constructor for a CopyB node.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belong to.
* @param *block The block the node belong to.
* @param *store The current memory
* @param *dst The ir_node that represents the destination address.
* @param *src The ir_node that represents the source address.
* @param *data_type The type of the copied data
*/
-ir_node *new_rd_CopyB(dbg_info *db, ir_graph *irg, ir_node *block,
- ir_node *store, ir_node *dst, ir_node *src, ir_type *data_type);
+ir_node *new_rd_CopyB(dbg_info *db, ir_node *block, ir_node *store,
+ ir_node *dst, ir_node *src, ir_type *data_type);
/** Constructor for a InstOf node.
*
* A High-Level Type check.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *store The memory in which the object the entity should be selected
* from is allocated.
* @param *objptr A pointer to a object of a class type.
* @param *type The type of which objptr must be.
*/
-ir_node *new_rd_InstOf (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *store,
- ir_node *objptr, ir_type *type);
+ir_node *new_rd_InstOf(dbg_info *db, ir_node *block, ir_node *store,
+ ir_node *objptr, ir_type *type);
/** Constructor for a Raise node.
*
* A High-Level Exception throw.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *store The current memory.
* @param *obj A pointer to the Except variable.
*/
-ir_node *new_rd_Raise (dbg_info *db, ir_graph *irg, ir_node *block,
- ir_node *store, ir_node *obj);
+ir_node *new_rd_Raise(dbg_info *db, ir_node *block, ir_node *store, ir_node *obj);
/** Constructor for a Bound node.
*
* A High-Level bounds check. Checks whether lower <= idx && idx < upper.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belong to.
* @param *block The block the node belong to.
* @param *store The current memory.
* @param *idx The ir_node that represents an index.
* @param *lower The ir_node that represents the lower bound for the index.
* @param *upper The ir_node that represents the upper bound for the index.
*/
-ir_node *new_rd_Bound(dbg_info *db, ir_graph *irg, ir_node *block,
- ir_node *store, ir_node *idx, ir_node *lower, ir_node *upper);
+ir_node *new_rd_Bound(dbg_info *db, ir_node *block,
+ ir_node *store, ir_node *idx, ir_node *lower, ir_node *upper);
/** Constructor for a Pin node.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belong to.
* @param *block The block the node belong to.
* @param *node The node which value should be pinned.
*/
-ir_node *new_rd_Pin(dbg_info *db, ir_graph *irg, ir_node *block, ir_node *node);
+ir_node *new_rd_Pin(dbg_info *db, ir_node *block, ir_node *node);
/** Constructor for an ASM pseudo node.
*
* @param *db A pointer for debug information.
- * @param *irg The IR graph the node belong to.
* @param *block The block the node belong to.
* @param arity The number of data inputs to the node.
* @param *in The array of length arity of data inputs.
* @param *clobber The array of length n_clobber of clobbered registers.
* @param *asm_text The assembler text.
*/
-ir_node *new_rd_ASM(dbg_info *db, ir_graph *irg, ir_node *block,
+ir_node *new_rd_ASM(dbg_info *db, ir_node *block,
int arity, ir_node *in[], ir_asm_constraint *inputs,
int n_outs, ir_asm_constraint *outputs,
int n_clobber, ident *clobber[], ident *asm_text);
* @param in[] An array of control predecessors. The length of
* the array must be 'arity'. The constructor copies this array.
*/
-ir_node *new_r_Block (ir_graph *irg, int arity, ir_node *in[]);
+ir_node *new_r_Block(ir_graph *irg, int arity, ir_node *in[]);
/** Constructor for a Start node.
*
* @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
*/
-ir_node *new_r_Start (ir_graph *irg, ir_node *block);
+ir_node *new_r_Start(ir_graph *irg, ir_node *block);
/** Constructor for a End node.
*
* @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
*/
-ir_node *new_r_End (ir_graph *irg, ir_node *block);
+ir_node *new_r_End(ir_graph *irg, ir_node *block);
/** Constructor for a Jmp node.
*
* Jmp represents control flow to a single control successor.
*
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
*/
-ir_node *new_r_Jmp (ir_graph *irg, ir_node *block);
+ir_node *new_r_Jmp(ir_node *block);
/** Constructor for an IJmp node.
*
* IJmp represents control flow to a single control successor not
* statically known i.e. an indirect Jmp.
*
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *tgt The IR node representing the target address.
*/
-ir_node *new_r_IJmp (ir_graph *irg, ir_node *block, ir_node *tgt);
+ir_node *new_r_IJmp(ir_node *block, ir_node *tgt);
/** Constructor for a Cond node.
*
* This is not consistent: Input to Cond is Is, Proj has as proj number
* longs.
*
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *c The conditions parameter.Can be of mode b or I_u.
*/
-ir_node *new_r_Cond (ir_graph *irg, ir_node *block, ir_node *c);
+ir_node *new_r_Cond(ir_node *block, ir_node *c);
/** Constructor for a Return node.
*
* Returns the memory and zero or more return values. Only node that
* can end regular control flow.
*
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *store The state of memory.
* @param arity Number of array indices.
* @param *in[] Array with index inputs to the node. The constructor copies this array.
*/
-ir_node *new_r_Return (ir_graph *irg, ir_node *block,
- ir_node *store, int arity, ir_node *in[]);
+ir_node *new_r_Return(ir_node *block, ir_node *store, int arity, ir_node *in[]);
/** Constructor for a Const node.
*
* @param *block The IR block the node belongs to.
* @param *con Points to an entry in the constant table.
*/
-ir_node *new_r_Const (ir_graph *irg, tarval *con);
+ir_node *new_r_Const(ir_graph *irg, tarval *con);
/** Constructor for a Const node.
*
* @param *mode The mode of the operands and the results.
* @param value A value from which the tarval is made.
*/
-ir_node *new_r_Const_long(ir_graph *irg,
- ir_mode *mode, long value);
+ir_node *new_r_Const_long(ir_graph *irg, ir_mode *mode, long value);
/** Constructor for a Const_type node.
*
* An unsigned integer (I_u) or a pointer (P).
*
* @param *irg The IR graph the node belongs to.
- * @param *block The IR block the node belongs to.
* @param mode The mode for the SymConst.
* @param value A type, entity or a ident depending on the SymConst kind.
* @param symkind The kind of the symbolic constant: type_tag, size or link_info.
*/
-ir_node *new_r_SymConst(ir_graph *irg, ir_node *block, ir_mode *mode,
+ir_node *new_r_SymConst(ir_graph *irg, ir_mode *mode,
union symconst_symbol value, symconst_kind symkind);
/** Constructor for a simpleSel node.
* Sel nodes that do not select from an array, i.e., have no index
* inputs. It adds the two parameters 0, NULL.
*
- * @param *irg The IR graph the node belongs to.
- * @param *block The IR block the node belongs to.
- * @param *store The memory in which the object the entity should be selected
- * from is allocated.
- * @param *objptr The object from that the Sel operation selects a
- * single attribute out.
- * @param *ent The entity to select.
+ * @param *block The IR block the node belongs to.
+ * @param *store The memory in which the object the entity should be selected
+ * from is allocated.
+ * @param *objptr The object from that the Sel operation selects a
+ * single attribute out.
+ * @param *ent The entity to select.
*/
-ir_node *new_r_simpleSel(ir_graph *irg, ir_node *block, ir_node *store,
+ir_node *new_r_simpleSel(ir_node *block, ir_node *store,
ir_node *objptr, ir_entity *ent);
/** Constructor for a Sel node.
* entity. If the selected entity is an array element entity the Sel
* node takes the required array indices as inputs.
*
- * @param *irg The IR graph the node belongs to.
- * @param *block The IR block the node belongs to.
- * @param *store The memory in which the object the entity should be selected
- * from is allocated.
- * @param *objptr A pointer to a compound entity the Sel operation selects a
- * single attribute from.
- * @param *n_index The number of array indices needed to select an array element entity.
- * @param *index[] If the compound entity is an array the indices of the selected
- * element entity. The constructor copies this array.
- * @param *ent The entity to select.
+ * @param *block The IR block the node belongs to.
+ * @param *store The memory in which the object the entity should be selected
+ * from is allocated.
+ * @param *objptr A pointer to a compound entity the Sel operation selects a
+ * single attribute from.
+ * @param *n_index The number of array indices needed to select an array element entity.
+ * @param *index[] If the compound entity is an array the indices of the selected
+ * element entity. The constructor copies this array.
+ * @param *ent The entity to select.
*/
-ir_node *new_r_Sel (ir_graph *irg, ir_node *block, ir_node *store,
- ir_node *objptr, int n_index, ir_node *index[],
- ir_entity *ent);
+ir_node *new_r_Sel(ir_node *block, ir_node *store,
+ ir_node *objptr, int n_index, ir_node *index[],
+ ir_entity *ent);
/** Constructor for a Call node.
*
* Represents all kinds of method and function calls.
*
- * @param *irg The IR graph the node belongs to.
- * @param *block The IR block the node belongs to.
- * @param *store The actual store.
- * @param *callee A pointer to the called procedure.
- * @param arity The number of procedure parameters.
- * @param *in[] An array with the pointers to the parameters. The constructor copies this array.
- * @param *tp Type information of the procedure called.
+ * @param *block The IR block the node belongs to.
+ * @param *store The actual store.
+ * @param *callee A pointer to the called procedure.
+ * @param arity The number of procedure parameters.
+ * @param *in[] An array with the pointers to the parameters. The constructor copies this array.
+ * @param *tp Type information of the procedure called.
*/
-ir_node *new_r_Call (ir_graph *irg, ir_node *block, ir_node *store,
- ir_node *callee, int arity, ir_node *in[], ir_type *tp);
+ir_node *new_r_Call(ir_node *block, ir_node *store,
+ ir_node *callee, int arity, ir_node *in[], ir_type *tp);
/** Constructor for a Builtin node.
*
* Represents a call of a backend-specific builtin..
*
- * @param *irg The IR graph the node belongs to.
- * @param *block The IR block the node belongs to.
- * @param *store The actual store.
- * @param arity The number of procedure parameters.
- * @param *in[] An array with the pointers to the parameters. The constructor copies this array.
- * @param kind The kind of the called builtin.
- * @param *tp Type information of the procedure called.
+ * @param *block The IR block the node belongs to.
+ * @param *store The actual store.
+ * @param arity The number of procedure parameters.
+ * @param *in[] An array with the pointers to the parameters. The constructor copies this array.
+ * @param kind The kind of the called builtin.
+ * @param *tp Type information of the procedure called.
*/
-ir_node *new_r_Builtin(ir_graph *irg, ir_node *block, ir_node *store,
+ir_node *new_r_Builtin(ir_node *block, ir_node *store,
int arity, ir_node *in[], ir_builtin_kind kind, ir_type *tp);
/** Constructor for a Add node.
*
- * @param *irg The IR graph the node belongs to.
- * @param *block The IR block the node belongs to.
- * @param *op1 The first operand.
- * @param *op2 The second operand.
- * @param *mode The mode of the operands and the result.
+ * @param *block The IR block the node belongs to.
+ * @param *op1 The first operand.
+ * @param *op2 The second operand.
+ * @param *mode The mode of the operands and the result.
*/
-ir_node *new_r_Add (ir_graph *irg, ir_node *block,
- ir_node *op1, ir_node *op2, ir_mode *mode);
+ir_node *new_r_Add(ir_node *block, ir_node *op1, ir_node *op2, ir_mode *mode);
/**
* Constructor for a Sub node.
*
- * @param *irg The IR graph the node belongs to.
- * @param *block The IR block the node belongs to.
- * @param *op1 The first operand.
- * @param *op2 The second operand.
- * @param *mode The mode of the operands and the results.
+ * @param *block The IR block the node belongs to.
+ * @param *op1 The first operand.
+ * @param *op2 The second operand.
+ * @param *mode The mode of the operands and the results.
*/
-ir_node *new_r_Sub (ir_graph *irg, ir_node *block,
- ir_node *op1, ir_node *op2, ir_mode *mode);
+ir_node *new_r_Sub(ir_node *block, ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Minus node.
*
- * @param *irg The IR graph the node belongs to.
- * @param *block The IR block the node belongs to.
- * @param *op The operand.
- * @param *mode The mode of the operand and the result.
+ * @param *irg The IR graph the node belongs to.
+ * @param *block The IR block the node belongs to.
+ * @param *op The operand.
+ * @param *mode The mode of the operand and the result.
*/
-ir_node *new_r_Minus (ir_graph *irg, ir_node *block,
- ir_node *op, ir_mode *mode);
+ir_node *new_r_Minus(ir_node *block, ir_node *op, ir_mode *mode);
/** Constructor for a Mul node.
*
- * @param *irg The IR graph the node belongs to.
- * @param *block The IR block the node belongs to.
- * @param *op1 The first operand.
- * @param *op2 The second operand.
- * @param *mode The mode of the operands and the result.
+ * @param *irg The IR graph the node belongs to.
+ * @param *block The IR block the node belongs to.
+ * @param *op1 The first operand.
+ * @param *op2 The second operand.
+ * @param *mode The mode of the operands and the result.
*/
-ir_node *new_r_Mul (ir_graph *irg, ir_node *block,
- ir_node *op1, ir_node *op2, ir_mode *mode);
+ir_node *new_r_Mul(ir_node *block, ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Mulh node.
*
- * @param *irg The IR graph the node belongs to.
- * @param *block The IR block the node belongs to.
- * @param *op1 The first operand.
- * @param *op2 The second operand.
- * @param *mode The mode of the operands and the result.
+ * @param *irg The IR graph the node belongs to.
+ * @param *block The IR block the node belongs to.
+ * @param *op1 The first operand.
+ * @param *op2 The second operand.
+ * @param *mode The mode of the operands and the result.
*/
-ir_node *new_r_Mulh (ir_graph *irg, ir_node *block,
- ir_node *op1, ir_node *op2, ir_mode *mode);
+ir_node *new_r_Mulh(ir_node *block, ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Quot node.
*
- * @param *irg The IR graph the node belongs to.
- * @param *block The IR block the node belongs to.
- * @param *memop The store needed to model exceptions
- * @param *op1 The first operand.
- * @param *op2 The second operand.
- * @param *mode The mode of the result.
- * @param state The pinned state.
+ * @param *block The IR block the node belongs to.
+ * @param *memop The store needed to model exceptions
+ * @param *op1 The first operand.
+ * @param *op2 The second operand.
+ * @param *mode The mode of the result.
+ * @param state The pinned state.
*/
-ir_node *new_r_Quot (ir_graph *irg, ir_node *block,
- ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
+ir_node *new_r_Quot(ir_node *block, ir_node *memop, ir_node *op1, ir_node *op2,
+ ir_mode *mode, op_pin_state state);
/** Constructor for a DivMod node.
*
- * @param *irg The IR graph the node belongs to.
- * @param *block The IR block the node belongs to.
- * @param *memop The store needed to model exceptions
- * @param *op1 The first operand.
- * @param *op2 The second operand.
- * @param *mode The mode of the results.
- * @param state The pinned state.
+ * @param *block The IR block the node belongs to.
+ * @param *memop The store needed to model exceptions
+ * @param *op1 The first operand.
+ * @param *op2 The second operand.
+ * @param *mode The mode of the results.
+ * @param state The pinned state.
*/
-ir_node *new_r_DivMod (ir_graph *irg, ir_node *block,
- ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
+ir_node *new_r_DivMod(ir_node *block, ir_node *memop, ir_node *op1, ir_node *op2,
+ ir_mode *mode, op_pin_state state);
/** Constructor for a Div node.
*
- * @param *irg The IR graph the node belongs to.
- * @param *block The IR block the node belongs to.
- * @param *memop The store needed to model exceptions
- * @param *op1 The first operand.
- * @param *op2 The second operand.
- * @param *mode The mode of the result.
- * @param state The pinned state.
+ * @param *block The IR block the node belongs to.
+ * @param *memop The store needed to model exceptions
+ * @param *op1 The first operand.
+ * @param *op2 The second operand.
+ * @param *mode The mode of the result.
+ * @param state The pinned state.
*/
-ir_node *new_r_Div (ir_graph *irg, ir_node *block,
- ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
+ir_node *new_r_Div(ir_node *block, ir_node *memop, ir_node *op1, ir_node *op2,
+ ir_mode *mode, op_pin_state state);
/** Constructor for a remainderless Div node.
*
- * @param *irg The IR graph the node belongs to.
- * @param *block The IR block the node belongs to.
- * @param *memop The store needed to model exceptions
- * @param *op1 The first operand.
- * @param *op2 The second operand.
- * @param *mode The mode of the result.
- * @param state The pinned state.
+ * @param *block The IR block the node belongs to.
+ * @param *memop The store needed to model exceptions
+ * @param *op1 The first operand.
+ * @param *op2 The second operand.
+ * @param *mode The mode of the result.
+ * @param state The pinned state.
*/
-ir_node *new_r_DivRL (ir_graph *irg, ir_node *block,
- ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
+ir_node *new_r_DivRL(ir_node *block, ir_node *memop, ir_node *op1, ir_node *op2,
+ ir_mode *mode, op_pin_state state);
/** Constructor for a Mod node.
*
- * @param *irg The IR graph the node belongs to.
- * @param *block The IR block the node belongs to.
- * @param *memop The store needed to model exceptions
- * @param *op1 The first operand.
- * @param *op2 The second operand.
- * @param *mode The mode of the result.
- * @param state The pinned state.
+ * @param *block The IR block the node belongs to.
+ * @param *memop The store needed to model exceptions
+ * @param *op1 The first operand.
+ * @param *op2 The second operand.
+ * @param *mode The mode of the result.
+ * @param state The pinned state.
*/
-ir_node *new_r_Mod (ir_graph *irg, ir_node *block,
- ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
+ir_node *new_r_Mod(ir_node *block, ir_node *memop, ir_node *op1, ir_node *op2,
+ ir_mode *mode, op_pin_state state);
/** Constructor for a Abs node.
*
- * @param *irg The IR graph the node belongs to.
- * @param *block The IR block the node belongs to.
- * @param *op The operand
- * @param *mode The mode of the operands and the result.
+ * @param *block The IR block the node belongs to.
+ * @param *op The operand
+ * @param *mode The mode of the operands and the result.
*/
-ir_node *new_r_Abs (ir_graph *irg, ir_node *block,
- ir_node *op, ir_mode *mode);
+ir_node *new_r_Abs(ir_node *block, ir_node *op, ir_mode *mode);
/** Constructor for a And node.
*
- * @param *irg The IR graph the node belongs to.
- * @param *block The IR block the node belongs to.
- * @param *op1 The first operand.
- * @param *op2 The second operand.
- * @param *mode The mode of the operands and the result.
+ * @param *block The IR block the node belongs to.
+ * @param *op1 The first operand.
+ * @param *op2 The second operand.
+ * @param *mode The mode of the operands and the result.
*/
-ir_node *new_r_And (ir_graph *irg, ir_node *block,
- ir_node *op1, ir_node *op2, ir_mode *mode);
+ir_node *new_r_And(ir_node *block, ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Or node.
*
- * @param *irg The IR graph the node belongs to.
- * @param *block The IR block the node belongs to.
- * @param *op1 The first operand.
- * @param *op2 The second operand.
- * @param *mode The mode of the operands and the result.
+ * @param *block The IR block the node belongs to.
+ * @param *op1 The first operand.
+ * @param *op2 The second operand.
+ * @param *mode The mode of the operands and the result.
*/
-ir_node *new_r_Or (ir_graph *irg, ir_node *block,
- ir_node *op1, ir_node *op2, ir_mode *mode);
+ir_node *new_r_Or(ir_node *block, ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Eor node.
*
- * @param *irg The IR graph the node belongs to.
- * @param *block The IR block the node belongs to.
- * @param *op1 The first operand.
- * @param *op2 The second operand.
- * @param *mode The mode of the operands and the results.
+ * @param *block The IR block the node belongs to.
+ * @param *op1 The first operand.
+ * @param *op2 The second operand.
+ * @param *mode The mode of the operands and the results.
*/
-ir_node *new_r_Eor (ir_graph *irg, ir_node *block,
- ir_node *op1, ir_node *op2, ir_mode *mode);
+ir_node *new_r_Eor(ir_node *block, ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Not node.
*
- * @param *irg The IR graph the node belongs to.
- * @param *block The IR block the node belongs to.
- * @param *op The operand.
- * @param *mode The mode of the operand and the result.
+ * @param *block The IR block the node belongs to.
+ * @param *op The operand.
+ * @param *mode The mode of the operand and the result.
*/
-ir_node *new_r_Not (ir_graph *irg, ir_node *block,
- ir_node *op, ir_mode *mode);
+ir_node *new_r_Not(ir_node *block, ir_node *op, ir_mode *mode);
/** Constructor for a Cmp node.
*
- * @param *irg The IR graph the node belongs to.
- * @param *block The IR block the node belongs to.
- * @param *op1 The first operand.
- * @param *op2 The second operand.
+ * @param *block The IR block the node belongs to.
+ * @param *op1 The first operand.
+ * @param *op2 The second operand.
*/
-ir_node *new_r_Cmp (ir_graph *irg, ir_node *block,
- ir_node *op1, ir_node *op2);
+ir_node *new_r_Cmp(ir_node *block, ir_node *op1, ir_node *op2);
/** Constructor for a Shl node.
*
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *op The operand.
* @param *k The number of bits to shift the operand .
* @param *mode The mode of the operand and the result.
*/
-ir_node *new_r_Shl (ir_graph *irg, ir_node *block,
- ir_node *op, ir_node *k, ir_mode *mode);
+ir_node *new_r_Shl(ir_node *block, ir_node *op, ir_node *k, ir_mode *mode);
/** Constructor for a Shr node.
*
- * @param *irg The IR graph the node belongs to.
- * @param *block The IR block the node belongs to.
- * @param *op The operand.
- * @param *k The number of bits to shift the operand .
- * @param *mode The mode of the operand and the result.
+ * @param *block The IR block the node belongs to.
+ * @param *op The operand.
+ * @param *k The number of bits to shift the operand .
+ * @param *mode The mode of the operand and the result.
*/
-ir_node *new_r_Shr (ir_graph *irg, ir_node *block,
- ir_node *op, ir_node *k, ir_mode *mode);
+ir_node *new_r_Shr(ir_node *block, ir_node *op, ir_node *k, ir_mode *mode);
/**
* Constructor for a Shrs node.
*
- * @param *irg The IR graph the node belongs to.
- * @param *block The IR block the node belongs to.
- * @param *op The operand.
- * @param *k The number of bits to shift the operand.
- * @param *mode The mode of the operand and the result.
+ * @param *block The IR block the node belongs to.
+ * @param *op The operand.
+ * @param *k The number of bits to shift the operand.
+ * @param *mode The mode of the operand and the result.
*/
-ir_node *new_r_Shrs (ir_graph *irg, ir_node *block,
- ir_node *op, ir_node *k, ir_mode *mode);
+ir_node *new_r_Shrs(ir_node *block, ir_node *op, ir_node *k, ir_mode *mode);
/** Constructor for a Rotl node.
*
- * @param *irg The IR graph the node belongs to.
- * @param *block The IR block the node belongs to.
- * @param *op The operand.
- * @param *k The number of bits to rotate the operand.
- * @param *mode The mode of the operand.
+ * @param *block The IR block the node belongs to.
+ * @param *op The operand.
+ * @param *k The number of bits to rotate the operand.
+ * @param *mode The mode of the operand.
*/
-ir_node *new_r_Rotl (ir_graph *irg, ir_node *block,
- ir_node *op, ir_node *k, ir_mode *mode);
+ir_node *new_r_Rotl(ir_node *block, ir_node *op, ir_node *k, ir_mode *mode);
/** Constructor for a Conv node.
*
- * @param *irg The IR graph the node belongs to.
- * @param *block The IR block the node belongs to.
- * @param *op The operand.
- * @param *mode The mode of this the operand muss be converted .
+ * @param *block The IR block the node belongs to.
+ * @param *op The operand.
+ * @param *mode The mode of this the operand muss be converted .
*/
-ir_node *new_r_Conv (ir_graph *irg, ir_node *block,
- ir_node *op, ir_mode *mode);
+ir_node *new_r_Conv(ir_node *block, ir_node *op, ir_mode *mode);
/** Constructor for a strict Conv node.
*
- * @param *irg The IR graph the node belongs to.
- * @param *block The IR block the node belongs to.
- * @param *op The operand.
- * @param *mode The mode of this the operand muss be converted .
+ * @param *block The IR block the node belongs to.
+ * @param *op The operand.
+ * @param *mode The mode of this the operand muss be converted .
*/
-ir_node *new_r_strictConv (ir_graph *irg, ir_node *block,
- ir_node *op, ir_mode *mode);
+ir_node *new_r_strictConv(ir_node *block, ir_node *op, ir_mode *mode);
/** Constructor for a Cast node.
*
* High level type cast
*
- * @param *irg The IR graph the node belongs to.
- * @param *block The IR block the node belongs to.
- * @param *op The operand.
- * @param *to_tp The type of this the operand muss be casted .
+ * @param *block The IR block the node belongs to.
+ * @param *op The operand.
+ * @param *to_tp The type of this the operand muss be casted .
*/
-ir_node *new_r_Cast (ir_graph *irg, ir_node *block,
- ir_node *op, ir_type *to_tp);
+ir_node *new_r_Cast(ir_node *block, ir_node *op, ir_type *to_tp);
/** Constructor for a Carry node.
*
- * @param *irg The IR graph the node belongs to.
- * @param *block The IR block the node belongs to.
- * @param *op1 The first operand.
- * @param *op2 The second operand.
- * @param *mode The mode of the operands and the result.
+ * @param *block The IR block the node belongs to.
+ * @param *op1 The first operand.
+ * @param *op2 The second operand.
+ * @param *mode The mode of the operands and the result.
*/
-ir_node *new_r_Carry (ir_graph *irg, ir_node *block,
- ir_node *op1, ir_node *op2, ir_mode *mode);
+ir_node *new_r_Carry(ir_node *block, ir_node *op1, ir_node *op2, ir_mode *mode);
/**
* Constructor for a Borrow node.
*
- * @param *irg The IR graph the node belongs to.
- * @param *block The IR block the node belongs to.
- * @param *op1 The first operand.
- * @param *op2 The second operand.
- * @param *mode The mode of the operands and the results.
+ * @param *block The IR block the node belongs to.
+ * @param *op1 The first operand.
+ * @param *op2 The second operand.
+ * @param *mode The mode of the operands and the results.
*/
-ir_node *new_r_Borrow (ir_graph *irg, ir_node *block,
- ir_node *op1, ir_node *op2, ir_mode *mode);
+ir_node *new_r_Borrow(ir_node *block, ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Phi node.
*
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param arity The number of predecessors
- * @param *in[] Array with predecessors. The constructor copies this array.
+ * @param *in[] Array with predecessors. The constructor copies this array.
* @param *mode The mode of it's inputs and output.
*/
-ir_node *new_r_Phi (ir_graph *irg, ir_node *block, int arity,
- ir_node *in[], ir_mode *mode);
+ir_node *new_r_Phi(ir_node *block, int arity, ir_node *in[], ir_mode *mode);
/** Constructor for a Load node.
*
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *store The current memory
* @param *adr A pointer to the variable to be read in this memory.
* @param *mode The mode of the value to be loaded.
* @param flags Additional flags for alignment, volatility and pin state.
*/
-ir_node *new_r_Load (ir_graph *irg, ir_node *block,
- ir_node *store, ir_node *adr, ir_mode *mode, ir_cons_flags flags);
+ir_node *new_r_Load(ir_node *block, ir_node *store,
+ ir_node *adr, ir_mode *mode, ir_cons_flags flags);
/** Constructor for a Store node.
*
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *store The current memory
* @param *adr A pointer to the variable to be read in this memory.
* @param *val The value to write to this variable.
* @param flags Additional flags for alignment, volatility and pin state.
*/
-ir_node *new_r_Store (ir_graph *irg, ir_node *block,
- ir_node *store, ir_node *adr, ir_node *val, ir_cons_flags flags);
+ir_node *new_r_Store(ir_node *block, ir_node *store,
+ ir_node *adr, ir_node *val, ir_cons_flags flags);
/** Constructor for a Alloc node.
*
* The Alloc node extends the memory by space for an entity of type alloc_type.
*
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *store The memory which shall contain the new variable.
* @param *size The number of bytes to allocate.
* @param *alloc_type The type of the allocated variable.
* @param where Where to allocate the variable, either heap_alloc or stack_alloc.
*/
-ir_node *new_r_Alloc (ir_graph *irg, ir_node *block, ir_node *store,
- ir_node *size, ir_type *alloc_type, ir_where_alloc where);
+ir_node *new_r_Alloc(ir_node *block, ir_node *store,
+ ir_node *size, ir_type *alloc_type, ir_where_alloc where);
/** Constructor for a Free node.
*
* Frees the memory occupied by the entity pointed to by the pointer
* arg. Type indicates the type of the entity the argument points to.
*
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *store The memory which shall contain the new variable.
* @param *ptr The pointer to the object to free.
* @param *free_type The type of the freed variable.
* @param where Where the variable was allocated, either heap_alloc or stack_alloc.
*/
-ir_node *new_r_Free (ir_graph *irg, ir_node *block, ir_node *store,
- ir_node *ptr, ir_node *size, ir_type *free_type, ir_where_alloc where);
+ir_node *new_r_Free(ir_node *block, ir_node *store,
+ ir_node *ptr, ir_node *size, ir_type *free_type, ir_where_alloc where);
/** Constructor for a Sync node.
*
* either occurs only in one of the memories, or it contains the same
* value in all memories where it occurs.
*
- * @param *irg The IR graph the node belongs to.
- * @param *block The IR block the node belongs to.
- * @param arity The number of memories to synchronize.
- * @param *in[] An array of pointers to nodes that produce an output of type memory.
- * The constructor copies this array.
+ * @param *block The IR block the node belongs to.
+ * @param arity The number of memories to synchronize.
+ * @param *in[] An array of pointers to nodes that produce an output of type memory.
+ * The constructor copies this array.
*/
-ir_node *new_r_Sync (ir_graph *irg, ir_node *block, int arity, ir_node *in[]);
+ir_node *new_r_Sync(ir_node *block, int arity, ir_node *in[]);
/** Constructor for a Proj node.
*
* Projects a single value out of a tuple. The parameter proj gives the
* position of the value within the tuple.
*
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param arg A node producing a tuple.
* @param *mode The mode of the value to project.
* @param proj The position of the value in the tuple.
*/
-ir_node *new_r_Proj (ir_graph *irg, ir_node *block, ir_node *arg,
- ir_mode *mode, long proj);
+ir_node *new_r_Proj(ir_node *block, ir_node *arg,
+ ir_mode *mode, long proj);
/** Constructor for a defaultProj node.
*
* Represents the default control flow of a Switch-Cond node.
*
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param arg A node producing a tuple.
* @param max_proj The end position of the value in the tuple.
*/
-ir_node *new_r_defaultProj (ir_graph *irg, ir_node *block, ir_node *arg, long max_proj);
+ir_node *new_r_defaultProj(ir_node *block, ir_node *arg, long max_proj);
/** Constructor for a Tuple node.
* This is an auxiliary node to replace a node that returns a tuple
* without changing the corresponding Proj nodes.
*
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param arity The number of tuple elements.
* @param *in[] An array containing pointers to the nodes producing the tuple elements.
* The constructor copies this array.
*/
-ir_node *new_r_Tuple (ir_graph *irg, ir_node *block, int arity, ir_node *in[]);
+ir_node *new_r_Tuple(ir_node *block, int arity, ir_node *in[]);
/** Constructor for a Id node.
*
* This is an auxiliary node to replace a node that returns a single
* value.
*
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *val The operand to Id.
* @param *mode The mode of *val.
*/
-ir_node *new_r_Id (ir_graph *irg, ir_node *block,
- ir_node *val, ir_mode *mode);
+ir_node *new_r_Id(ir_node *block, ir_node *val, ir_mode *mode);
/** Constructor for a Bad node.
*
* get_irg_bad().
*
* @param *irg The IR graph the node belongs to.
- *
*/
-ir_node *new_r_Bad (ir_graph *irg);
+ir_node *new_r_Bad(ir_graph *irg);
/** Constructor for a Confirm node.
*
* Example: If the value never exceeds '100' this is expressed by placing a
* Confirm node val = new_d_Confirm(db, val, 100, '<=') on the dataflow edge.
*
- * @param *irg The IR graph the node belong to.
* @param *block The IR block the node belong to.
* @param *val The value we express a constraint for
* @param *bound The value to compare against. Must be a firm node, typically a constant.
* @param cmp The compare operation.
*/
-ir_node *new_r_Confirm(ir_graph *irg, ir_node *block,
- ir_node *val, ir_node *bound, pn_Cmp cmp);
+ir_node *new_r_Confirm(ir_node *block, ir_node *val, ir_node *bound, pn_Cmp cmp);
/** Constructor for a Unknown node.
*
* constructor copies the method pointer input from the passed Call
* node.
*
- * @param *irg The IR graph the node belong to.
* @param *block The block the node belong to.
* @param *callee The call node visible in the intra procedural view.
*/
-ir_node *new_r_CallBegin(ir_graph *irg, ir_node *block, ir_node *ptr, ir_node *call);
+ir_node *new_r_CallBegin(ir_node *block, ir_node *ptr, ir_node *call);
/** Constructor for a EndReg node.
*
* It is used for the interprocedural representation where blocks are parted
* behind Call nodes to represent the control flow to called procedures.
*
- * @param *irg The IR graph the node belong to.
* @param *block The block the node belong to.
*/
-ir_node *new_r_Break (ir_graph *irg, ir_node *block);
+ir_node *new_r_Break(ir_node *block);
/** Constructor for a Filter node.
*
*
* The constructor builds the Filter in intraprocedural view.
*
- * @param *irg The IR graph the node belong to.
* @param *block The block the node belong to.
- * @param *arg The tuple value to project from.
- * @param *mode The mode of the projected value.
- * @param proj The position in the tuple to project from.
+ * @param *arg The tuple value to project from.
+ * @param *mode The mode of the projected value.
+ * @param proj The position in the tuple to project from.
*/
-ir_node *new_r_Filter (ir_graph *irg, ir_node *block, ir_node *arg,
- ir_mode *mode, long proj);
+ir_node *new_r_Filter(ir_node *block, ir_node *arg, ir_mode *mode, long proj);
/** Constructor for a NoMem node.
*
*
* @param *irg The IR graph the node belongs to.
*/
-ir_node *new_r_NoMem (ir_graph *irg);
+ir_node *new_r_NoMem(ir_graph *irg);
/** Constructor for a Mux node.
*
- * @param *irg The IR graph the node belong to.
* @param *block The block the node belong to.
* @param *sel The ir_node that calculates the boolean select.
* @param *ir_true The ir_node that calculates the true result.
* @param *ir_false The ir_node that calculates the false result.
* @param *mode The mode of the node (and it_true and ir_false).
*/
-ir_node *new_r_Mux (ir_graph *irg, ir_node *block,
- ir_node *sel, ir_node *ir_false, ir_node *ir_true, ir_mode *mode);
+ir_node *new_r_Mux(ir_node *block, ir_node *sel,
+ ir_node *ir_false, ir_node *ir_true, ir_mode *mode);
/** Constructor for a CopyB node.
*
- * @param *irg The IR graph the node belong to.
* @param *block The block the node belong to.
* @param *store The current memory
* @param *dst The ir_node that represents the destination address.
* @param *src The ir_node that represents the source address.
* @param *data_type The type of the copied data
*/
-ir_node *new_r_CopyB(ir_graph *irg, ir_node *block,
- ir_node *store, ir_node *dst, ir_node *src, ir_type *data_type);
+ir_node *new_r_CopyB(ir_node *block, ir_node *store,
+ ir_node *dst, ir_node *src, ir_type *data_type);
/** Constructor for a InstOf node.
*
* A High-Level Type check.
*
- * @param *irg The IR graph the node belongs to.
- * @param *block The IR block the node belongs to.
- * @param *store The memory in which the object the entity should be selected
- * from is allocated.
- * @param *objptr A pointer to a object of a class type.
- * @param *type The type of which objptr must be.
+ * @param *block The block the node belong to.
+ * @param *store The memory in which the object the entity should be selected
+ * from is allocated.
+ * @param *objptr A pointer to a object of a class type.
+ * @param *type The type of which objptr must be.
*/
-ir_node *new_r_InstOf(ir_graph *irg, ir_node *block, ir_node *store,
+ir_node *new_r_InstOf(ir_node *block, ir_node *store,
ir_node *objptr, ir_type *type);
/** Constructor for a Raise node.
*
* A High-Level Exception throw.
*
- * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *store The current memory.
* @param *obj A pointer to the Except variable.
*/
-ir_node *new_r_Raise(ir_graph *irg, ir_node *block,
- ir_node *store, ir_node *obj);
+ir_node *new_r_Raise(ir_node *block, ir_node *store, ir_node *obj);
/** Constructor for a Bound node.
*
* A High-Level bounds check. Checks whether lower <= idx && idx < upper.
*
- * @param *irg The IR graph the node belong to.
* @param *block The block the node belong to.
* @param *store The current memory.
* @param *idx The ir_node that represents an index.
* @param *lower The ir_node that represents the lower bound for the index.
* @param *upper The ir_node that represents the upper bound for the index.
*/
-ir_node *new_r_Bound(ir_graph *irg, ir_node *block,
- ir_node *store, ir_node *idx, ir_node *lower, ir_node *upper);
+ir_node *new_r_Bound(ir_node *block, ir_node *store,
+ ir_node *idx, ir_node *lower, ir_node *upper);
/** Constructor for a Pin node.
*
- * @param *irg The IR graph the node belong to.
* @param *block The block the node belong to.
* @param *node The node which value should be pinned.
*/
-ir_node *new_r_Pin(ir_graph *irg, ir_node *block, ir_node *node);
+ir_node *new_r_Pin(ir_node *block, ir_node *node);
/** Constructor for an ASM pseudo node.
*
- * @param *irg The IR graph the node belong to.
* @param *block The block the node belong to.
* @param arity The number of data inputs to the node.
* @param *in The array of length arity of data inputs.
* @param *clobber The array of length n_clobber of clobbered registers.
* @param *asm_text The assembler text.
*/
-ir_node *new_r_ASM(ir_graph *irg, ir_node *block,
+ir_node *new_r_ASM(ir_node *block,
int arity, ir_node *in[], ir_asm_constraint *inputs,
int n_outs, ir_asm_constraint *outputs,
int n_clobber, ident *clobber[], ident *asm_text);
*
* @param target The new current block.
*/
-void set_cur_block (ir_node *target);
+void set_cur_block(ir_node *target);
/** Returns the current block of the current graph. */
ir_node *get_cur_block(void);
*
* @param *db A pointer for debug information.
*/
-ir_node *new_d_Start (dbg_info *db);
+ir_node *new_d_Start(dbg_info *db);
/** Constructor for a End node.
*
*
* @param *db A pointer for debug information.
*/
-ir_node *new_d_End (dbg_info *db);
+ir_node *new_d_End(dbg_info *db);
/** Constructor for a Jmp node.
*
*
* @param *db A pointer for debug information.
*/
-ir_node *new_d_Jmp (dbg_info *db);
+ir_node *new_d_Jmp(dbg_info *db);
/** Constructor for an IJmp node.
*
* @param *db A pointer for debug information.
* @param *tgt The IR node representing the target address.
*/
-ir_node *new_d_IJmp (dbg_info *db, ir_node *tgt);
+ir_node *new_d_IJmp(dbg_info *db, ir_node *tgt);
/** Constructor for a Cond node.
*
* @param *db A pointer for debug information.
* @param *c The conditions parameter.Can be of mode b or I_u.
*/
-ir_node *new_d_Cond (dbg_info *db, ir_node *c);
+ir_node *new_d_Cond(dbg_info *db, ir_node *c);
/** Constructor for a Return node.
*
* @param arity Number of array indices.
* @param *in Array with index inputs to the node.
*/
-ir_node *new_d_Return (dbg_info *db, ir_node *store, int arity, ir_node *in[]);
+ir_node *new_d_Return(dbg_info *db, ir_node *store, int arity, ir_node *in[]);
/** Constructor for a Const_type node.
*
added to the attributes of the node.
* @param *tp The type of the constant.
*/
-ir_node *new_d_Const_type (dbg_info *db, tarval *con, ir_type *tp);
+ir_node *new_d_Const_type(dbg_info *db, tarval *con, ir_type *tp);
/** Constructor for a Const node.
*
* @param *con Points to an entry in the constant table. This pointer is added
* to the attributes of the node.
*/
-ir_node *new_d_Const (dbg_info *db, tarval *con);
+ir_node *new_d_Const(dbg_info *db, tarval *con);
/** Constructor for a SymConst_type node.
*
* element entity. The constructor copies this array.
* @param *ent The entity to select.
*/
-ir_node *new_d_Sel (dbg_info *db, ir_node *store, ir_node *objptr, int arity, ir_node *in[],
- ir_entity *ent);
+ir_node *new_d_Sel(dbg_info *db, ir_node *store, ir_node *objptr, int arity, ir_node *in[],
+ ir_entity *ent);
/** Constructor for a Call node.
*
* @param *in[] An array with the pointers to the parameters. The constructor copies this array.
* @param *tp Type information of the procedure called.
*/
-ir_node *new_d_Call (dbg_info *db, ir_node *store, ir_node *callee, int arity, ir_node *in[],
- ir_type *tp);
+ir_node *new_d_Call(dbg_info *db, ir_node *store, ir_node *callee, int arity, ir_node *in[],
+ ir_type *tp);
/** Constructor for a Builtin node.
*
* @param *op2 The second operand.
* @param *mode The mode of the operands and the result.
*/
-ir_node *new_d_Add (dbg_info *db, ir_node *op1, ir_node *op2, ir_mode *mode);
+ir_node *new_d_Add(dbg_info *db, ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Sub node.
*
* @param *op2 The second operand.
* @param *mode The mode of the operands and the result.
*/
-ir_node *new_d_Sub (dbg_info *db, ir_node *op1, ir_node *op2, ir_mode *mode);
+ir_node *new_d_Sub(dbg_info *db, ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Minus node.
*
* @param *op The operand .
* @param *mode The mode of the operand and the result.
*/
-ir_node *new_d_Minus (dbg_info *db, ir_node *op, ir_mode *mode);
+ir_node *new_d_Minus(dbg_info *db, ir_node *op, ir_mode *mode);
/** Constructor for a Mul node.
*
* @param *op2 The second operand.
* @param *mode The mode of the operands and the result.
*/
-ir_node *new_d_Mul (dbg_info *db, ir_node *op1, ir_node *op2, ir_mode *mode);
+ir_node *new_d_Mul(dbg_info *db, ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Mulh node.
*
* @param *op2 The second operand.
* @param *mode The mode of the operands and the result.
*/
-ir_node *new_d_Mulh (dbg_info *db, ir_node *op1, ir_node *op2, ir_mode *mode);
+ir_node *new_d_Mulh(dbg_info *db, ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Quot node.
*
* @param *mode The mode of the result.
* @param state The pinned state.
*/
-ir_node *new_d_Quot (dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
+ir_node *new_d_Quot(dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
/** Constructor for a DivMod node.
*
* @param *mode The mode of the results.
* @param state The pinned state.
*/
-ir_node *new_d_DivMod (dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
+ir_node *new_d_DivMod(dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
/** Constructor for a Div node.
*
* @param *mode The mode of the result.
* @param state The pinned state.
*/
-ir_node *new_d_Div (dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
+ir_node *new_d_Div(dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
/** Constructor for a remainderless Div node.
*
* @param *mode The mode of the result.
* @param state The pinned state.
*/
-ir_node *new_d_DivRL (dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
+ir_node *new_d_DivRL(dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
/** Constructor for a Mod node.
*
* @param *mode The mode of the result.
* @param state The pinned state.
*/
-ir_node *new_d_Mod (dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
+ir_node *new_d_Mod(dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
/** Constructor for a Abs node.
*
* @param *op The operand
* @param *mode The mode of the operands and the result.
*/
-ir_node *new_d_Abs (dbg_info *db, ir_node *op, ir_mode *mode);
+ir_node *new_d_Abs(dbg_info *db, ir_node *op, ir_mode *mode);
/** Constructor for a And node.
*
* @param *op2 The second operand.
* @param *mode The mode of the operands and the result.
*/
-ir_node *new_d_And (dbg_info *db, ir_node *op1, ir_node *op2, ir_mode *mode);
+ir_node *new_d_And(dbg_info *db, ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Or node.
*
* @param *op2 The second operand.
* @param *mode The mode of the operands and the result.
*/
-ir_node *new_d_Or (dbg_info *db, ir_node *op1, ir_node *op2, ir_mode *mode);
+ir_node *new_d_Or(dbg_info *db, ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Eor node.
*
* @param *op2 The second operand.
* @param *mode The mode of the operands and the results.
*/
-ir_node *new_d_Eor (dbg_info *db, ir_node *op1, ir_node *op2, ir_mode *mode);
+ir_node *new_d_Eor(dbg_info *db, ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Not node.
*
* @param *op The operand.
* @param *mode The mode of the operand and the result.
*/
-ir_node *new_d_Not (dbg_info *db, ir_node *op, ir_mode *mode);
+ir_node *new_d_Not(dbg_info *db, ir_node *op, ir_mode *mode);
/** Constructor for a Shl node.
*
* @param *k The number of bits to shift the operand .
* @param *mode The mode of the operand and the result.
*/
-ir_node *new_d_Shl (dbg_info *db, ir_node *op, ir_node *k, ir_mode *mode);
+ir_node *new_d_Shl(dbg_info *db, ir_node *op, ir_node *k, ir_mode *mode);
/** Constructor for a Shr node.
*
* @param *k The number of bits to shift the operand .
* @param *mode The mode of the operand and the result.
*/
-ir_node *new_d_Shr (dbg_info *db, ir_node *op, ir_node *k, ir_mode *mode);
+ir_node *new_d_Shr(dbg_info *db, ir_node *op, ir_node *k, ir_mode *mode);
/** Constructor for a Shrs node.
*
* @param *k The number of bits to shift the operand .
* @param *mode The mode of the operand and the result.
*/
-ir_node *new_d_Shrs (dbg_info *db, ir_node *op, ir_node *k, ir_mode *mode);
+ir_node *new_d_Shrs(dbg_info *db, ir_node *op, ir_node *k, ir_mode *mode);
/** Constructor for a Rotl node.
*
* @param *k The number of bits to rotate the operand.
* @param *mode The mode of the operand.
*/
-ir_node *new_d_Rotl (dbg_info *db, ir_node *op, ir_node *k, ir_mode *mode);
+ir_node *new_d_Rotl(dbg_info *db, ir_node *op, ir_node *k, ir_mode *mode);
/** Constructor for a Cmp node.
*
* @param *op1 The first operand.
* @param *op2 The second operand.
*/
-ir_node *new_d_Cmp (dbg_info *db, ir_node *op1, ir_node *op2);
+ir_node *new_d_Cmp(dbg_info *db, ir_node *op1, ir_node *op2);
/** Constructor for a Conv node.
*
* @param *op The operand.
* @param *mode The mode of this the operand muss be converted .
*/
-ir_node *new_d_Conv (dbg_info *db, ir_node *op, ir_mode *mode);
+ir_node *new_d_Conv(dbg_info *db, ir_node *op, ir_mode *mode);
/** Constructor for a strict Conv node.
*
* @param *op The operand.
* @param *mode The mode of this the operand muss be converted .
*/
-ir_node *new_d_strictConv (dbg_info *db, ir_node *op, ir_mode *mode);
+ir_node *new_d_strictConv(dbg_info *db, ir_node *op, ir_mode *mode);
/** Constructor for a Cast node.
*
* @param *op The operand.
* @param *to_tp The type of this the operand muss be casted .
*/
-ir_node *new_d_Cast (dbg_info *db, ir_node *op, ir_type *to_tp);
+ir_node *new_d_Cast(dbg_info *db, ir_node *op, ir_type *to_tp);
/** Constructor for a Carry node.
*
* @param *op2 The second operand.
* @param *mode The mode of the operands and the result.
*/
-ir_node *new_d_Carry (dbg_info *db, ir_node *op1, ir_node *op2, ir_mode *mode);
+ir_node *new_d_Carry(dbg_info *db, ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Borrow node.
*
* @param *op2 The second operand.
* @param *mode The mode of the operands and the result.
*/
-ir_node *new_d_Borrow (dbg_info *db, ir_node *op1, ir_node *op2, ir_mode *mode);
+ir_node *new_d_Borrow(dbg_info *db, ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Phi node.
*
* @param *in Array with predecessors
* @param *mode The mode of it's inputs and output.
*/
-ir_node *new_d_Phi (dbg_info *db, int arity, ir_node *in[], ir_mode *mode);
+ir_node *new_d_Phi(dbg_info *db, int arity, ir_node *in[], ir_mode *mode);
/** Constructor for a Load node.
*
* @param *alloc_type The type of the allocated variable.
* @param where Where to allocate the variable, either heap_alloc or stack_alloc.
*/
-ir_node *new_d_Alloc (dbg_info *db, ir_node *store, ir_node *size, ir_type *alloc_type,
- ir_where_alloc where);
+ir_node *new_d_Alloc(dbg_info *db, ir_node *store, ir_node *size, ir_type *alloc_type,
+ ir_where_alloc where);
/** Constructor for a Free node.
*
* @param *free_type The type of the freed variable.
* @param where Where the variable was allocated, either heap_alloc or stack_alloc.
*/
-ir_node *new_d_Free (dbg_info *db, ir_node *store, ir_node *ptr, ir_node *size,
- ir_type *free_type, ir_where_alloc where);
+ir_node *new_d_Free(dbg_info *db, ir_node *store, ir_node *ptr, ir_node *size,
+ ir_type *free_type, ir_where_alloc where);
/** Constructor for a Sync node.
*
* @param **in An array of pointers to nodes that produce an output of type
* memory. The constructor copies this array.
*/
-ir_node *new_d_Sync (dbg_info *db, int arity, ir_node *in[]);
+ir_node *new_d_Sync(dbg_info *db, int arity, ir_node *in[]);
/** Constructor for a Proj node.
*
* @param *mode The mode of the value to project.
* @param proj The position of the value in the tuple.
*/
-ir_node *new_d_Proj (dbg_info *db, ir_node *arg, ir_mode *mode, long proj);
+ir_node *new_d_Proj(dbg_info *db, ir_node *arg, ir_mode *mode, long proj);
/** Constructor for a defaultProj node.
*
* @param arg A node producing a tuple.
* @param max_proj The end position of the value in the tuple.
*/
-ir_node *new_d_defaultProj (dbg_info *db, ir_node *arg, long max_proj);
+ir_node *new_d_defaultProj(dbg_info *db, ir_node *arg, long max_proj);
/** Constructor for a Tuple node.
*
* @param arity The number of tuple elements.
* @param **in An array containing pointers to the nodes producing the tuple elements.
*/
-ir_node *new_d_Tuple (dbg_info *db, int arity, ir_node *in[]);
+ir_node *new_d_Tuple(dbg_info *db, int arity, ir_node *in[]);
/** Constructor for a Id node.
*
* @param *val The operand to Id.
* @param *mode The mode of *val.
*/
-ir_node *new_d_Id (dbg_info *db, ir_node *val, ir_mode *mode);
+ir_node *new_d_Id(dbg_info *db, ir_node *val, ir_mode *mode);
/** Constructor for a Confirm node.
*
* @param *bound The value to compare against. Must be a firm node, typically a constant.
* @param cmp The compare operation.
*/
-ir_node *new_d_Confirm (dbg_info *db, ir_node *val, ir_node *bound, pn_Cmp cmp);
+ir_node *new_d_Confirm(dbg_info *db, ir_node *val, ir_node *bound, pn_Cmp cmp);
/** Constructor for an Unknown node.
*
*
* @param *db A pointer for debug information.
*/
-ir_node *new_d_EndReg (dbg_info *db);
+ir_node *new_d_EndReg(dbg_info *db);
/** Constructor for an EndExcept node.
*
*
* @param *db A pointer for debug information.
*/
-ir_node *new_d_Break (dbg_info *db);
+ir_node *new_d_Break(dbg_info *db);
/** Constructor for a Filter node.
*
* @param *mode The mode of the projected value.
* @param proj The position in the tuple to project from.
*/
-ir_node *new_d_Filter (dbg_info *db, ir_node *arg, ir_mode *mode, long proj);
+ir_node *new_d_Filter(dbg_info *db, ir_node *arg, ir_mode *mode, long proj);
/** Constructor for a Mux node.
*
* @param *ir_false The ir_node that calculates the false result.
* @param *mode The mode of the node (and it_true and ir_false).
*/
-ir_node *new_d_Mux (dbg_info *db, ir_node *sel,
- ir_node *ir_false, ir_node *ir_true, ir_mode *mode);
+ir_node *new_d_Mux(dbg_info *db, ir_node *sel,
+ ir_node *ir_false, ir_node *ir_true, ir_mode *mode);
/** Constructor for a CopyB node.
*
* @param *objptr A pointer to a object of a class type.
* @param *type The type of which objptr must be.
*/
-ir_node *new_d_InstOf (dbg_info *db, ir_node *store, ir_node *objptr, ir_type *type);
+ir_node *new_d_InstOf(dbg_info *db, ir_node *store, ir_node *objptr, ir_type *type);
/** Constructor for a Raise node.
*
* @param *store The current memory.
* @param *obj A pointer to the Except variable.
*/
-ir_node *new_d_Raise (dbg_info *db, ir_node *store, ir_node *obj);
+ir_node *new_d_Raise(dbg_info *db, ir_node *store, ir_node *obj);
/** Constructor for a Bound node.
*
* Adds the node to the block in current_ir_block.
*
*/
-ir_node *new_Start (void);
+ir_node *new_Start(void);
/** Constructor for an End node.
*
* Adds the node to the block in current_ir_block.
*/
-ir_node *new_End (void);
+ir_node *new_End(void);
/** Constructor for an EndReg node.
*
* Used to represent regular procedure end in interprocedual view.
* Adds the node to the block in current_ir_block.
*/
-ir_node *new_EndReg (void);
+ir_node *new_EndReg(void);
/** Constructor for an EndExpcept node.
*
*
* Jmp represents control flow to a single control successor.
*/
-ir_node *new_Jmp (void);
+ir_node *new_Jmp(void);
/** Constructor for an IJmp node.
*
*
* @param *tgt The IR node representing the target address.
*/
-ir_node *new_IJmp (ir_node *tgt);
+ir_node *new_IJmp(ir_node *tgt);
/** Constructor for a Break node.
* Break represents control flow to a single control successor just as Jmp.
* behind Call nodes to represent the control flow to called procedures.
* Adds the node to the block in current_ir_block.
*/
-ir_node *new_Break (void);
+ir_node *new_Break(void);
/** Constructor for a Cond node.
*
*
* @param *c The conditions parameter.Can be of mode b or I_u.
*/
-ir_node *new_Cond (ir_node *c);
+ir_node *new_Cond(ir_node *c);
/** Constructor for a Return node.
*
* @param arity Number of array indices.
* @param *in Array with index inputs to the node.
*/
-ir_node *new_Return (ir_node *store, int arity, ir_node *in[]);
+ir_node *new_Return(ir_node *store, int arity, ir_node *in[]);
/** Constructor for a Const node.
*
* @param *con Points to an entry in the constant table. This pointer is
* added to the attributes of the node.
*/
-ir_node *new_Const (tarval *con);
+ir_node *new_Const(tarval *con);
/**
* Make a const from a long.
* element entity. The constructor copies this array.
* @param *ent The entity to select.
*/
-ir_node *new_Sel (ir_node *store, ir_node *objptr, int arity, ir_node *in[],
- ir_entity *ent);
+ir_node *new_Sel(ir_node *store, ir_node *objptr, int arity, ir_node *in[],
+ ir_entity *ent);
/** Constructor for a Call node.
*
* @param *in[] An array with the pointers to the parameters. The constructor copies this array.
* @param *tp Type information of the procedure called.
*/
-ir_node *new_Call (ir_node *store, ir_node *callee, int arity, ir_node *in[],
- ir_type *tp);
+ir_node *new_Call(ir_node *store, ir_node *callee, int arity, ir_node *in[],
+ ir_type *tp);
/** Constructor for a Builtin node.
*
* @param *op2 The second operand.
* @param *mode The mode of the operands and the result.
*/
-ir_node *new_Add (ir_node *op1, ir_node *op2, ir_mode *mode);
+ir_node *new_Add(ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Sub node.
*
* @param *op2 The second operand.
* @param *mode The mode of the operands and the result.
*/
-ir_node *new_Sub (ir_node *op1, ir_node *op2, ir_mode *mode);
+ir_node *new_Sub(ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Minus node.
*
* @param *op The operand .
* @param *mode The mode of the operand and the result.
*/
-ir_node *new_Minus (ir_node *op, ir_mode *mode);
+ir_node *new_Minus(ir_node *op, ir_mode *mode);
/**
* Constructor for a Mul node. Adds the node to the block in current_ir_block.
* @param *op2 The second operand.
* @param *mode The mode of the operands and the result.
*/
-ir_node *new_Mul (ir_node *op1, ir_node *op2, ir_mode *mode);
+ir_node *new_Mul(ir_node *op1, ir_node *op2, ir_mode *mode);
/**
* Constructor for a Mulh node. Adds the node to the block in current_ir_block.
* @param *op2 The second operand.
* @param *mode The mode of the operands and the result.
*/
-ir_node *new_Mulh (ir_node *op1, ir_node *op2, ir_mode *mode);
+ir_node *new_Mulh(ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Quot node.
*
* @param *mode The mode of the result.
* @param state The pinned state.
*/
-ir_node *new_Quot (ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
+ir_node *new_Quot(ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
/** Constructor for a DivMod node.
*
* @param *mode The mode of the results.
* @param state The pinned state.
*/
-ir_node *new_DivMod (ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
+ir_node *new_DivMod(ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
/** Constructor for a Div node.
*
* @param *mode The mode of the result.
* @param state The pinned state.
*/
-ir_node *new_Div (ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
+ir_node *new_Div(ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
/** Constructor for a remainderless Div node.
*
* @param *mode The mode of the result.
* @param state The pinned state.
*/
-ir_node *new_DivRL (ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
+ir_node *new_DivRL(ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
/** Constructor for a Mod node.
*
* @param *mode The mode of the result.
* @param state The pinned state.
*/
-ir_node *new_Mod (ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
+ir_node *new_Mod(ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
/** Constructor for a Abs node.
*
* @param *op The operand
* @param *mode The mode of the operands and the result.
*/
-ir_node *new_Abs (ir_node *op, ir_mode *mode);
+ir_node *new_Abs(ir_node *op, ir_mode *mode);
/** Constructor for a And node.
*
* @param *op2 The second operand.
* @param *mode The mode of the operands and the result.
*/
-ir_node *new_And (ir_node *op1, ir_node *op2, ir_mode *mode);
+ir_node *new_And(ir_node *op1, ir_node *op2, ir_mode *mode);
/**
* Constructor for a Or node. Adds the node to the block in current_ir_block.
* @param *op2 The second operand.
* @param *mode The mode of the operands and the result.
*/
-ir_node *new_Or (ir_node *op1, ir_node *op2, ir_mode *mode);
+ir_node *new_Or(ir_node *op1, ir_node *op2, ir_mode *mode);
/**
* Constructor for a Eor node. Adds the node to the block in current_ir_block.
* @param *op2 The second operand.
* @param *mode The mode of the operands and the results.
*/
-ir_node *new_Eor (ir_node *op1, ir_node *op2, ir_mode *mode);
+ir_node *new_Eor(ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Not node.
*
* @param *op The operand.
* @param *mode The mode of the operand and the result.
*/
-ir_node *new_Not (ir_node *op, ir_mode *mode);
+ir_node *new_Not(ir_node *op, ir_mode *mode);
/** Constructor for a Shl node.
*
* @param *k The number of bits to shift the operand .
* @param *mode The mode of the operand and the result.
*/
-ir_node *new_Shl (ir_node *op, ir_node *k, ir_mode *mode);
+ir_node *new_Shl(ir_node *op, ir_node *k, ir_mode *mode);
/**
* Constructor for a Shr node. Adds the node to the block in current_ir_block.
* @param *k The number of bits to shift the operand .
* @param *mode The mode of the operand and the result.
*/
-ir_node *new_Shr (ir_node *op, ir_node *k, ir_mode *mode);
+ir_node *new_Shr(ir_node *op, ir_node *k, ir_mode *mode);
/** Constructor for a Shrs node.
*
* @param *k The number of bits to shift the operand .
* @param *mode The mode of the operand and the result.
*/
-ir_node *new_Shrs (ir_node *op, ir_node *k, ir_mode *mode);
+ir_node *new_Shrs(ir_node *op, ir_node *k, ir_mode *mode);
/** Constructor for a Rotl node.
*
* @param *k The number of bits to rotate the operand.
* @param *mode The mode of the operand.
*/
-ir_node *new_Rotl (ir_node *op, ir_node *k, ir_mode *mode);
+ir_node *new_Rotl(ir_node *op, ir_node *k, ir_mode *mode);
/** Constructor for a Cmp node.
*
* @param *op1 The first operand.
* @param *op2 The second operand.
*/
-ir_node *new_Cmp (ir_node *op1, ir_node *op2);
+ir_node *new_Cmp(ir_node *op1, ir_node *op2);
/** Constructor for a Conv node.
*
* @param *op The operand.
* @param *mode The mode of this the operand muss be converted.
*/
-ir_node *new_Conv (ir_node *op, ir_mode *mode);
+ir_node *new_Conv(ir_node *op, ir_mode *mode);
/** Constructor for a strict Conv node.
*
* @param *op The operand.
* @param *mode The mode of this the operand muss be converted.
*/
-ir_node *new_strictConv (ir_node *op, ir_mode *mode);
+ir_node *new_strictConv(ir_node *op, ir_mode *mode);
/** Constructor for a Cast node.
*
* @param *op The operand.
* @param *to_tp The type of this the operand muss be casted .
*/
-ir_node *new_Cast (ir_node *op, ir_type *to_tp);
+ir_node *new_Cast(ir_node *op, ir_type *to_tp);
/** Constructor for a Carry node.
*
* @param *op2 The second operand.
* @param *mode The mode of the operands and the result.
*/
-ir_node *new_Carry (ir_node *op1, ir_node *op2, ir_mode *mode);
+ir_node *new_Carry(ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Borrow node.
*
* @param *op2 The second operand.
* @param *mode The mode of the operands and the result.
*/
-ir_node *new_Borrow (ir_node *op1, ir_node *op2, ir_mode *mode);
+ir_node *new_Borrow(ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Phi node.
*
* @param *in Array with predecessors.
* @param *mode The mode of it's inputs and output.
*/
-ir_node *new_Phi (int arity, ir_node *in[], ir_mode *mode);
+ir_node *new_Phi(int arity, ir_node *in[], ir_mode *mode);
/** Constructor for a Load node.
*
* @param *alloc_type The type of the allocated variable.
* @param where Where to allocate the variable, either heap_alloc or stack_alloc.
*/
-ir_node *new_Alloc (ir_node *store, ir_node *size, ir_type *alloc_type,
- ir_where_alloc where);
+ir_node *new_Alloc(ir_node *store, ir_node *size, ir_type *alloc_type,
+ ir_where_alloc where);
/** Constructor for a Free node.
*
* @param *free_type The type of the freed variable.
* @param where Where the variable was allocated, either heap_alloc or stack_alloc.
*/
-ir_node *new_Free (ir_node *store, ir_node *ptr, ir_node *size,
- ir_type *free_type, ir_where_alloc where);
+ir_node *new_Free(ir_node *store, ir_node *ptr, ir_node *size,
+ ir_type *free_type, ir_where_alloc where);
/** Constructor for a Sync node.
*
* @param **in An array of pointers to nodes that produce an output of type
* memory. The constructor copies this array.
*/
-ir_node *new_Sync (int arity, ir_node *in[]);
+ir_node *new_Sync(int arity, ir_node *in[]);
/** Constructor for a Proj node.
*
* @param *mode The mode of the value to project.
* @param proj The position of the value in the tuple.
*/
-ir_node *new_Proj (ir_node *arg, ir_mode *mode, long proj);
+ir_node *new_Proj(ir_node *arg, ir_mode *mode, long proj);
/** Constructor for a Filter node.
*
* @param *mode The mode of the projected value.
* @param proj The position in the tuple to project from.
*/
-ir_node *new_Filter (ir_node *arg, ir_mode *mode, long proj);
+ir_node *new_Filter(ir_node *arg, ir_mode *mode, long proj);
/** Constructor for a defaultProj node.
*
* @param arg A node producing a tuple.
* @param max_proj The end position of the value in the tuple.
*/
-ir_node *new_defaultProj (ir_node *arg, long max_proj);
+ir_node *new_defaultProj(ir_node *arg, long max_proj);
/** Constructor for a Tuple node.
*
* @param arity The number of tuple elements.
* @param **in An array containing pointers to the nodes producing the tuple elements.
*/
-ir_node *new_Tuple (int arity, ir_node *in[]);
+ir_node *new_Tuple(int arity, ir_node *in[]);
/** Constructor for an Id node.
*
* @param *val The operand to Id.
* @param *mode The mode of *val.
*/
-ir_node *new_Id (ir_node *val, ir_mode *mode);
+ir_node *new_Id(ir_node *val, ir_mode *mode);
/** Constructor for a Bad node.
*
* Returns the unique Bad node of the graph. The same as
* get_irg_bad().
*/
-ir_node *new_Bad (void);
+ir_node *new_Bad(void);
/** Constructor for a Confirm node.
*
* @param *bound The value to compare against. Must be a firm node, typically a constant.
* @param cmp The compare operation.
*/
-ir_node *new_Confirm (ir_node *val, ir_node *bound, pn_Cmp cmp);
+ir_node *new_Confirm(ir_node *val, ir_node *bound, pn_Cmp cmp);
/** Constructor for an Unknown node.
*
* Returns the unique NoMem node of the graph. The same as
* get_irg_no_mem().
*/
-ir_node *new_NoMem (void);
+ir_node *new_NoMem(void);
/** Constructor for a Mux node.
*
* @param *ir_false The ir_node that calculates the false result.
* @param *mode The mode of the node (and it_true and ir_false).
*/
-ir_node *new_Mux (ir_node *sel, ir_node *ir_false, ir_node *ir_true, ir_mode *mode);
+ir_node *new_Mux(ir_node *sel, ir_node *ir_false, ir_node *ir_true, ir_mode *mode);
/** Constructor for a CopyB node.
*
* @param *objptr A pointer to a object of a class type.
* @param *type The type of which objptr must be.
*/
-ir_node *new_InstOf (ir_node *store, ir_node *objptr, ir_type *type);
+ir_node *new_InstOf(ir_node *store, ir_node *objptr, ir_type *type);
/**Constructor for a Raise node.
*
* @param *store The current memory.
* @param *obj A pointer to the Except variable.
*/
-ir_node *new_Raise (ir_node *store, ir_node *obj);
+ir_node *new_Raise(ir_node *store, ir_node *obj);
/** Constructor for a Bound node.
*
* @param *lower The ir_node that represents the lower bound for the index.
* @param *upper The ir_node that represents the upper bound for the index.
*/
-ir_node *new_Bound (ir_node *store, ir_node *idx, ir_node *lower, ir_node *upper);
+ir_node *new_Bound(ir_node *store, ir_node *idx, ir_node *lower, ir_node *upper);
/** Constructor for a Pin node.
*
* @param *node The node which value should be pinned.
*/
-ir_node *new_Pin (ir_node *node);
+ir_node *new_Pin(ir_node *node);
/** Constructor for an ASM pseudo node.
*
else
in[i] = c_o;
}
- phi = new_r_Phi(current_ir_graph, user_blk, n, in, mode_b);
+ phi = new_r_Phi(user_blk, n, in, mode_b);
set_irn_n(user, pos, phi);
}
}
* We can replace the input with a Confirm(left, pnc, right).
*/
if (! c)
- c = new_r_Confirm(current_ir_graph, block, left, right, pnc);
+ c = new_r_Confirm(block, left, right, pnc);
pos = get_edge_src_pos(edge);
set_irn_n(succ, pos, c);
* We can replace the input with a Confirm(right, pnc^-1, left).
*/
if (! rc)
- rc = new_r_Confirm(current_ir_graph, block, right, left, pnc);
+ rc = new_r_Confirm(block, right, left, pnc);
pos = get_edge_src_pos(edge);
set_irn_n(succ, pos, rc);
ir_mode *mode = get_irn_mode(ptr);
c = new_Const(get_mode_null(mode));
- c = new_r_Confirm(current_ir_graph, block, ptr, c, pn_Cmp_Lg);
+ c = new_r_Confirm(block, ptr, c, pn_Cmp_Lg);
}
set_irn_n(succ, pos, c);
res = clone_type_method(tp, prefix);
pmap_insert(mtp_map, tp, res);
- DB((dbgcall, LEVEL_2, "cloned type %+F into %+F\n", tp, res));
return res;
} /* clone_type_and_cache */
ctp = clone_type_and_cache(ctp);
set_method_additional_property(ctp, mtp_property_private);
set_Call_type(call, ctp);
- DB((dbgcall, LEVEL_1, "changed call to private method %+F\n", ent));
+ DB((dbgcall, LEVEL_1, "changed call to private method %+F using cloned type %+F\n", ent, ctp));
}
}
}
if ((get_method_additional_properties(mtp) & mtp_property_private) == 0) {
/* need a new type */
mtp = clone_type_and_cache(mtp);
- set_entity_type(ent, mtp);
set_method_additional_property(mtp, mtp_property_private);
+ set_entity_type(ent, mtp);
+ DB((dbgcall, LEVEL_2, "changed entity type of %+F to %+F\n", ent, mtp));
changed = 1;
}
}
}
/**
- * Return non-if a given firm thing is a region.
+ * Return non-zero if a given firm thing is a region.
*/
int is_region(const void *thing) {
const firm_kind *kind = thing;
}
/**
- * Return the number of predecessors in a region.
+ * Return the number of predecessors of a region.
*/
int get_region_n_preds(const ir_region *reg) {
return ARR_LEN(reg->pred);
/** Walker environment. */
typedef struct walk_env {
- struct obstack *obst; /**< an obstack to allocate from. */
+ struct obstack *obst; /**< An obstack to allocate from. */
ir_region **post; /**< The list of all currently existent top regions. */
- unsigned l_post; /**< length of the allocated regions array. */
+ unsigned l_post; /**< The length of the allocated regions array. */
unsigned premax; /**< maximum pre counter */
unsigned postmax; /**< maximum post counter */
- ir_node *start_block; /**< the start block of the graph. */
- ir_node *end_block; /**< the end block of the graph. */
+ ir_node *start_block; /**< The start block of the graph. */
+ ir_node *end_block; /**< The end block of the graph. */
} walk_env;
/**
} /* wrap_BasicBlocks */
/**
- * Create the pred and succ edges for Block wrapper.
+ * Post-walker: Create the pred and succ edges for Block wrapper.
* Kill edges to the Start and End blocks.
*/
static void update_BasicBlock_regions(ir_node *blk, void *ctx) {
int i, j, len;
if (blk == env->start_block) {
- /* handle Firm's self loop */
+ /* handle Firm's self loop: Start block has no predecessors */
reg->pred = NEW_ARR_D(ir_region *, env->obst, 0);
} else {
len = get_Block_n_cfgpreds(blk);
ARR_SHRINKLEN(reg->succ, j);
} /* update_BasicBlock_regions */
-/** Allocate a new region of a obstack */
+/** Allocate a new region on an obstack */
#define ALLOC_REG(obst, reg, tp) \
do { \
(reg) = obstack_alloc((obst), sizeof(*(reg))); \
} /* new_NaturalLoop */
/**
- * Return true if a is an ancestor of b in DFS search.
+ * Return true if region a is an ancestor of region b in DFS search.
*/
static int is_ancestor(const ir_region *a, const ir_region *b) {
return (a->prenum <= b->prenum && a->postnum > b->postnum);
}
/**
- * Return true if region pred is a predecessor of region n.
+ * Return true if region pred is a predecessor of region n.
*/
static int pred_of(const ir_region *pred, const ir_region *n) {
int i;
}
/**
- * Return true if region succ is a successor of region n.
+ * Return true if region succ is a successor of region n.
*/
static int succ_of(const ir_region *succ, const ir_region *n) {
int i;
}
/**
- * Reverse linked list.
+ * Reverse a linked list of regions.
*/
static struct ir_region *reverse_list(ir_region *n) {
ir_region *prev = NULL, *next;
}
/**
- * Clear all links on a list. Needed, because we expect cleared links-
+ * Clear all links on a list. Needed, because we expect cleared links.
*/
static void clear_list(ir_region *list) {
ir_region *next;
replace_pred(succ, reg);
}
- /* second third: replace all succs in predessors */
+ /* third step: replace all succs in predessors */
for (i = get_region_n_preds(reg) - 1; i >= 0; --i) {
ir_region *pred = get_region_pred(reg, i);
do {
ir_region *reg, *n = env.post[postctr];
do {
- if (n->parent) {
+ if (n->parent != NULL) {
/* already folded */
break;
}
* Fix an IncSP node if the offset gets too big
*/
static void peephole_be_IncSP(ir_node *node) {
- ir_graph *irg;
ir_node *block;
int offset, cnt, align, sign = 1;
arm_vals v;
be_set_IncSP_offset(node, (int)arm_rol(v.values[0], v.shifts[0]) * sign);
- irg = current_ir_graph;
block = get_nodes_block(node);
align = be_get_IncSP_align(node);
for (cnt = 1; cnt < v.ops; ++cnt) {
int value = (int)arm_rol(v.values[cnt], v.shifts[cnt]);
- ir_node *next = be_new_IncSP(&arm_gp_regs[REG_SP], irg, block, node, value * sign, align);
+ ir_node *next = be_new_IncSP(&arm_gp_regs[REG_SP], block, node, value * sign, align);
sched_add_after(node, next);
node = next;
}
ir_node *block, *ptr, *frame, *load, *mem, *proj;
ir_mode *mode;
dbg_info *dbg;
- ir_graph *irg;
arm_vals v;
const arch_register_t *reg;
reg = arch_get_irn_register(node);
mem = be_get_Reload_mem(node);
mode = get_irn_mode(node);
- irg = current_ir_graph;
dbg = get_irn_dbg_info(node);
block = get_nodes_block(node);
/* transform into fpaLdf */
load = new_bd_arm_fpaLdf(dbg, block, ptr, mem, mode);
sched_add_before(node, load);
- proj = new_rd_Proj(dbg, irg, block, load, mode, pn_arm_fpaLdf_res);
+ proj = new_rd_Proj(dbg, block, load, mode, pn_arm_fpaLdf_res);
arch_set_irn_register(proj, reg);
} else {
panic("peephole_be_Spill: spill not supported for this mode");
/* transform into Store */;
load = new_bd_arm_Load(dbg, block, ptr, mem);
sched_add_before(node, load);
- proj = new_rd_Proj(dbg, irg, block, load, mode_Iu, pn_arm_Load_res);
+ proj = new_rd_Proj(dbg, block, load, mode_Iu, pn_arm_Load_res);
arch_set_irn_register(proj, reg);
} else {
panic("peephole_be_Spill: spill not supported for this mode");
ir_graph *irg = current_ir_graph;
/* add a result proj and a Keep to produce a pseudo use */
- ir_node *proj = new_r_Proj(irg, block, new_load, mode_Iu, pn_arm_Load_res);
- be_new_Keep(arch_get_irn_reg_class_out(proj), irg, block, 1, &proj);
+ ir_node *proj = new_r_Proj(block, new_load, mode_Iu, pn_arm_Load_res);
+ be_new_Keep(arch_get_irn_reg_class_out(proj), block, 1, &proj);
}
return new_load;
ir_node *src_copy;
ir_node *dst_copy;
- src_copy = be_new_Copy(&arm_reg_classes[CLASS_arm_gp], irg, block, new_src);
- dst_copy = be_new_Copy(&arm_reg_classes[CLASS_arm_gp], irg, block, new_dst);
+ src_copy = be_new_Copy(&arm_reg_classes[CLASS_arm_gp], block, new_src);
+ dst_copy = be_new_Copy(&arm_reg_classes[CLASS_arm_gp], block, new_dst);
return new_bd_arm_CopyB(dbg, block, dst_copy, src_copy,
new_bd_arm_EmptyReg(dbg, block, mode_Iu),
ir_node *block = be_transform_node(get_nodes_block(node));
ir_node *load = get_Proj_pred(node);
ir_node *new_load = be_transform_node(load);
- ir_graph *irg = current_ir_graph;
dbg_info *dbgi = get_irn_dbg_info(node);
long proj = get_Proj_proj(node);
case iro_arm_Loadhs:
/* handle all gp loads equal: they have the same proj numbers. */
if (proj == pn_Load_res) {
- return new_rd_Proj(dbgi, irg, block, new_load, mode_Iu, pn_arm_Load_res);
+ return new_rd_Proj(dbgi, block, new_load, mode_Iu, pn_arm_Load_res);
} else if (proj == pn_Load_M) {
- return new_rd_Proj(dbgi, irg, block, new_load, mode_M, pn_arm_Load_M);
+ return new_rd_Proj(dbgi, block, new_load, mode_M, pn_arm_Load_M);
}
break;
case iro_arm_fpaLdf:
if (proj == pn_Load_res) {
ir_mode *mode = get_Load_mode(load);
- return new_rd_Proj(dbgi, irg, block, new_load, mode, pn_arm_fpaLdf_res);
+ return new_rd_Proj(dbgi, block, new_load, mode, pn_arm_fpaLdf_res);
} else if (proj == pn_Load_M) {
- return new_rd_Proj(dbgi, irg, block, new_load, mode_M, pn_arm_fpaLdf_M);
+ return new_rd_Proj(dbgi, block, new_load, mode_M, pn_arm_fpaLdf_M);
}
break;
default:
ir_node *block = be_transform_node(get_nodes_block(node));
ir_node *pred = get_Proj_pred(node);
ir_node *new_pred = be_transform_node(pred);
- ir_graph *irg = current_ir_graph;
dbg_info *dbgi = get_irn_dbg_info(node);
long proj = get_Proj_proj(node);
switch(proj) {
case pn_CopyB_M_regular:
if (is_arm_CopyB(new_pred)) {
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_M, pn_arm_CopyB_M);
+ return new_rd_Proj(dbgi, block, new_pred, mode_M, pn_arm_CopyB_M);
}
break;
default:
ir_node *block = be_transform_node(get_nodes_block(node));
ir_node *pred = get_Proj_pred(node);
ir_node *new_pred = be_transform_node(pred);
- ir_graph *irg = current_ir_graph;
dbg_info *dbgi = get_irn_dbg_info(node);
ir_mode *mode = get_irn_mode(node);
long proj = get_Proj_proj(node);
switch (proj) {
case pn_Quot_M:
if (is_arm_fpaDvf(new_pred) || is_arm_fpaDvf_i(new_pred)) {
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_M, pn_arm_fpaDvf_M);
+ return new_rd_Proj(dbgi, block, new_pred, mode_M, pn_arm_fpaDvf_M);
} else if (is_arm_fpaRdf(new_pred) || is_arm_fpaRdf_i(new_pred)) {
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_M, pn_arm_fpaRdf_M);
+ return new_rd_Proj(dbgi, block, new_pred, mode_M, pn_arm_fpaRdf_M);
} else if (is_arm_fpaFdv(new_pred) || is_arm_fpaFdv_i(new_pred)) {
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_M, pn_arm_fpaFdv_M);
+ return new_rd_Proj(dbgi, block, new_pred, mode_M, pn_arm_fpaFdv_M);
} else if (is_arm_fpaFrd(new_pred) || is_arm_fpaFrd_i(new_pred)) {
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_M, pn_arm_fpaFrd_M);
+ return new_rd_Proj(dbgi, block, new_pred, mode_M, pn_arm_fpaFrd_M);
}
break;
case pn_Quot_res:
if (is_arm_fpaDvf(new_pred) || is_arm_fpaDvf_i(new_pred)) {
- return new_rd_Proj(dbgi, irg, block, new_pred, mode, pn_arm_fpaDvf_res);
+ return new_rd_Proj(dbgi, block, new_pred, mode, pn_arm_fpaDvf_res);
} else if (is_arm_fpaRdf(new_pred) || is_arm_fpaRdf_i(new_pred)) {
- return new_rd_Proj(dbgi, irg, block, new_pred, mode, pn_arm_fpaRdf_res);
+ return new_rd_Proj(dbgi, block, new_pred, mode, pn_arm_fpaRdf_res);
} else if (is_arm_fpaFdv(new_pred) || is_arm_fpaFdv_i(new_pred)) {
- return new_rd_Proj(dbgi, irg, block, new_pred, mode, pn_arm_fpaFdv_res);
+ return new_rd_Proj(dbgi, block, new_pred, mode, pn_arm_fpaFdv_res);
} else if (is_arm_fpaFrd(new_pred) || is_arm_fpaFrd_i(new_pred)) {
- return new_rd_Proj(dbgi, irg, block, new_pred, mode, pn_arm_fpaFrd_res);
+ return new_rd_Proj(dbgi, block, new_pred, mode, pn_arm_fpaFrd_res);
}
break;
default:
ir_node *block = be_transform_node(get_nodes_block(node));
ir_node *pred = get_Proj_pred(node);
ir_node *new_pred = be_transform_node(pred);
- ir_graph *irg = current_ir_graph;
dbg_info *dbgi = get_irn_dbg_info(node);
long proj = get_Proj_proj(node);
if (proj == pn_be_AddSP_sp) {
- ir_node *res = new_rd_Proj(dbgi, irg, block, new_pred, mode_Iu,
+ ir_node *res = new_rd_Proj(dbgi, block, new_pred, mode_Iu,
pn_arm_SubSPandCopy_stack);
arch_set_irn_register(res, &arm_gp_regs[REG_SP]);
return res;
} else if(proj == pn_be_AddSP_res) {
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_Iu,
- pn_arm_SubSPandCopy_addr);
+ return new_rd_Proj(dbgi, block, new_pred, mode_Iu, pn_arm_SubSPandCopy_addr);
} else if (proj == pn_be_AddSP_M) {
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_M, pn_arm_SubSPandCopy_M);
+ return new_rd_Proj(dbgi, block, new_pred, mode_M, pn_arm_SubSPandCopy_M);
}
panic("Unsupported Proj from AddSP");
}
ir_node *block = be_transform_node(get_nodes_block(node));
ir_node *pred = get_Proj_pred(node);
ir_node *new_pred = be_transform_node(pred);
- ir_graph *irg = current_ir_graph;
dbg_info *dbgi = get_irn_dbg_info(node);
long proj = get_Proj_proj(node);
if (proj == pn_be_SubSP_sp) {
- ir_node *res = new_rd_Proj(dbgi, irg, block, new_pred, mode_Iu,
+ ir_node *res = new_rd_Proj(dbgi, block, new_pred, mode_Iu,
pn_arm_AddSP_stack);
arch_set_irn_register(res, &arm_gp_regs[REG_SP]);
return res;
} else if (proj == pn_be_SubSP_M) {
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_M, pn_arm_AddSP_M);
+ return new_rd_Proj(dbgi, block, new_pred, mode_M, pn_arm_AddSP_M);
}
panic("Unsupported Proj from SubSP");
}
/* we exchange the ProjX with a jump */
block = be_transform_node(block);
- jump = new_rd_Jmp(dbgi, irg, block);
+ jump = new_rd_Jmp(dbgi, block);
return jump;
}
if (node == get_irg_anchor(irg, anchor_tls)) {
ir_mode *mode = get_irn_mode(node);
if (mode_needs_gp_reg(mode)) {
ir_node *block = be_transform_node(get_nodes_block(node));
- ir_node *new_proj = new_r_Proj(irg, block, new_pred, mode_Iu,
+ ir_node *new_proj = new_r_Proj(block, new_pred, mode_Iu,
get_Proj_proj(node));
new_proj->node_nr = node->node_nr;
return new_proj;
conv = new_bd_arm_fpaDbl2GP(NULL, bl, arg, mem);
/* move high/low */
- *resL = new_r_Proj(irg, bl, conv, mode_Is, pn_arm_fpaDbl2GP_low);
- *resH = new_r_Proj(irg, bl, conv, mode_Is, pn_arm_fpaDbl2GP_high);
- mem = new_r_Proj(irg, bl, conv, mode_M, pn_arm_fpaDbl2GP_M);
+ *resL = new_r_Proj(bl, conv, mode_Is, pn_arm_fpaDbl2GP_low);
+ *resH = new_r_Proj(bl, conv, mode_Is, pn_arm_fpaDbl2GP_high);
+ mem = new_r_Proj(bl, conv, mode_M, pn_arm_fpaDbl2GP_M);
}
return mem;
}
arch_register_req_type_ignore);
/* copy SP to IP (so we can spill it */
- ip = be_new_Copy(gp, irg, block, sp);
+ ip = be_new_Copy(gp, block, sp);
be_set_constr_single_reg_out(ip, 0, &arm_gp_regs[REG_R12], 0);
/* spill stuff */
store = new_bd_arm_StoreStackM4Inc(NULL, block, sp, fp, ip, lr, pc, *mem);
- sp = new_r_Proj(irg, block, store, env->arch_env->sp->reg_class->mode, pn_arm_StoreStackM4Inc_ptr);
+ sp = new_r_Proj(block, store, env->arch_env->sp->reg_class->mode, pn_arm_StoreStackM4Inc_ptr);
arch_set_irn_register(sp, env->arch_env->sp);
- *mem = new_r_Proj(irg, block, store, mode_M, pn_arm_StoreStackM4Inc_M);
+ *mem = new_r_Proj(block, store, mode_M, pn_arm_StoreStackM4Inc_M);
/* frame pointer is ip-4 (because ip is our old sp value) */
fp = new_bd_arm_Sub_i(NULL, block, ip, get_irn_mode(fp), 4);
* to extract this order from register requirements) */
add_irn_dep(fp, store);
- fp = be_new_Copy(gp, irg, block, fp); // XXX Gammelfix: only be_ have custom register requirements
+ fp = be_new_Copy(gp, block, fp); // XXX Gammelfix: only be_ have custom register requirements
be_set_constr_single_reg_out(fp, 0, env->arch_env->bp,
arch_register_req_type_ignore);
arch_set_irn_register(fp, env->arch_env->bp);
// TODO: Activate Omit fp in epilogue
if (env->flags.try_omit_fp) {
- curr_sp = be_new_IncSP(env->arch_env->sp, env->irg, bl, curr_sp, BE_STACK_FRAME_SIZE_SHRINK, 0);
+ curr_sp = be_new_IncSP(env->arch_env->sp, bl, curr_sp, BE_STACK_FRAME_SIZE_SHRINK, 0);
- curr_lr = be_new_CopyKeep_single(&arm_reg_classes[CLASS_arm_gp], env->irg, bl, curr_lr, curr_sp, get_irn_mode(curr_lr));
+ curr_lr = be_new_CopyKeep_single(&arm_reg_classes[CLASS_arm_gp], bl, curr_lr, curr_sp, get_irn_mode(curr_lr));
be_set_constr_single_reg_out(curr_lr, 0, &arm_gp_regs[REG_LR], 0);
- curr_pc = be_new_Copy(&arm_reg_classes[CLASS_arm_gp], env->irg, bl, curr_lr );
+ curr_pc = be_new_Copy(&arm_reg_classes[CLASS_arm_gp], bl, curr_lr );
be_set_constr_single_reg_out(curr_pc, BE_OUT_POS(0), &arm_gp_regs[REG_PC], 0);
} else {
ir_node *load_node;
load_node = new_bd_arm_LoadStackM3Epilogue(NULL, bl, curr_bp, *mem);
- curr_bp = new_r_Proj(env->irg, bl, load_node, env->arch_env->bp->reg_class->mode, pn_arm_LoadStackM3Epilogue_res0);
- curr_sp = new_r_Proj(env->irg, bl, load_node, env->arch_env->sp->reg_class->mode, pn_arm_LoadStackM3Epilogue_res1);
- curr_pc = new_r_Proj(env->irg, bl, load_node, mode_Iu, pn_arm_LoadStackM3Epilogue_res2);
- *mem = new_r_Proj(env->irg, bl, load_node, mode_M, pn_arm_LoadStackM3Epilogue_M);
+ curr_bp = new_r_Proj(bl, load_node, env->arch_env->bp->reg_class->mode, pn_arm_LoadStackM3Epilogue_res0);
+ curr_sp = new_r_Proj(bl, load_node, env->arch_env->sp->reg_class->mode, pn_arm_LoadStackM3Epilogue_res1);
+ curr_pc = new_r_Proj(bl, load_node, mode_Iu, pn_arm_LoadStackM3Epilogue_res2);
+ *mem = new_r_Proj(bl, load_node, mode_M, pn_arm_LoadStackM3Epilogue_M);
arch_set_irn_register(curr_bp, env->arch_env->bp);
arch_set_irn_register(curr_sp, env->arch_env->sp);
arch_set_irn_register(curr_pc, &arm_gp_regs[REG_PC]);
* to adjust stack alignment for the call.
*/
if (stack_dir < 0 && !do_seq && !no_alloc) {
- curr_sp = be_new_IncSP(sp, irg, bl, curr_sp, stack_size, 1);
+ curr_sp = be_new_IncSP(sp, bl, curr_sp, stack_size, 1);
}
dbgi = get_irn_dbg_info(irn);
*/
if (do_seq) {
curr_ofs = 0;
- addr = curr_sp = be_new_IncSP(sp, irg, bl, curr_sp, param_size + arg->space_before, 0);
+ addr = curr_sp = be_new_IncSP(sp, bl, curr_sp, param_size + arg->space_before, 0);
add_irn_dep(curr_sp, curr_mem);
}
else {
constmode = mode_Is;
}
addr = new_r_Const_long(irg, constmode, curr_ofs);
- addr = new_r_Add(irg, bl, curr_sp, addr, mach_mode);
+ addr = new_r_Add(bl, curr_sp, addr, mach_mode);
}
}
if (is_atomic_type(param_type)) {
ir_node *store;
ir_node *mem_input = do_seq ? curr_mem : new_NoMem();
- store = new_rd_Store(dbgi, irg, bl, mem_input, addr, param, 0);
- mem = new_r_Proj(irg, bl, store, mode_M, pn_Store_M);
+ store = new_rd_Store(dbgi, bl, mem_input, addr, param, 0);
+ mem = new_r_Proj(bl, store, mode_M, pn_Store_M);
}
/* Make a mem copy for compound arguments. */
ir_node *copy;
assert(mode_is_reference(get_irn_mode(param)));
- copy = new_rd_CopyB(dbgi, irg, bl, curr_mem, addr, param, param_type);
- mem = new_r_Proj(irg, bl, copy, mode_M, pn_CopyB_M_regular);
+ copy = new_rd_CopyB(dbgi, bl, curr_mem, addr, param, param_type);
+ mem = new_r_Proj(bl, copy, mode_M, pn_CopyB_M_regular);
}
curr_ofs += param_size;
/* We need the sync only, if we didn't build the stores sequentially. */
if (! do_seq) {
if (n_stack_params >= 1) {
- curr_mem = new_r_Sync(irg, bl, n_stack_params + 1, in);
+ curr_mem = new_r_Sync(bl, n_stack_params + 1, in);
} else {
curr_mem = get_Call_mem(irn);
}
ARR_APP1(ir_node *, env->calls, low_call);
/* create new stack pointer */
- curr_sp = new_r_Proj(irg, bl, low_call, get_irn_mode(curr_sp),
- pn_be_Call_sp);
+ curr_sp = new_r_Proj(bl, low_call, get_irn_mode(curr_sp), pn_be_Call_sp);
be_set_constr_single_reg_out(low_call, pn_be_Call_sp, sp,
arch_register_req_type_ignore | arch_register_req_type_produces_sp);
arch_set_irn_register(curr_sp, sp);
if (proj == NULL) {
ir_type *res_type = get_method_res_type(call_tp, i);
ir_mode *mode = get_type_mode(res_type);
- proj = new_r_Proj(irg, bl, low_call, mode, pn);
+ proj = new_r_Proj(bl, low_call, mode, pn);
res_projs[i] = proj;
} else {
set_Proj_pred(proj, low_call);
obstack_ptr_grow(obst, curr_sp);
foreach_pset_new(&destroyed_regs, reg, iter) {
- ir_node *proj = new_r_Proj(irg, bl, low_call, reg->reg_class->mode, curr_res_proj);
+ ir_node *proj = new_r_Proj(bl, low_call, reg->reg_class->mode, curr_res_proj);
/* memorize the register in the link field. we need afterwards to set the register class of the keep correctly. */
be_set_constr_single_reg_out(low_call, curr_res_proj, reg, 0);
/* create the Keep for the caller save registers */
in = (ir_node **) obstack_finish(obst);
- keep = be_new_Keep(NULL, irg, bl, n, in);
+ keep = be_new_Keep(NULL, bl, n, in);
for (i = 0; i < n; ++i) {
const arch_register_t *reg = get_irn_link(in[i]);
be_node_set_reg_class_in(keep, i, reg->reg_class);
}
if (! mem_proj) {
- mem_proj = new_r_Proj(irg, bl, low_call, mode_M, pn_be_Call_M_regular);
+ mem_proj = new_r_Proj(bl, low_call, mode_M, pn_be_Call_M_regular);
keep_alive(mem_proj);
}
}
/* Clean up the stack frame or revert alignment fixes if we allocated it */
if (! no_alloc) {
- curr_sp = be_new_IncSP(sp, irg, bl, curr_sp, -stack_size, 0);
+ curr_sp = be_new_IncSP(sp, bl, curr_sp, -stack_size, 0);
}
be_abi_call_free(call);
*
* @param alignment the minimum stack alignment
* @param size the node containing the non-aligned size
- * @param irg the irg where new nodes are allocated on
- * @param irg the block where new nodes are allocated on
+ * @param block the block where new nodes are allocated on
* @param dbg debug info for new nodes
*
* @return a node representing the aligned size
*/
static ir_node *adjust_alloc_size(unsigned stack_alignment, ir_node *size,
- ir_graph *irg, ir_node *block, dbg_info *dbg)
+ ir_node *block, dbg_info *dbg)
{
if (stack_alignment > 1) {
- ir_mode *mode;
- tarval *tv;
- ir_node *mask;
+ ir_mode *mode;
+ tarval *tv;
+ ir_node *mask;
+ ir_graph *irg;
assert(is_po2(stack_alignment));
mode = get_irn_mode(size);
tv = new_tarval_from_long(stack_alignment-1, mode);
+ irg = get_Block_irg(block);
mask = new_r_Const(irg, tv);
- size = new_rd_Add(dbg, irg, block, size, mask, mode);
+ size = new_rd_Add(dbg, block, size, mask, mode);
tv = new_tarval_from_long(-(long)stack_alignment, mode);
mask = new_r_Const(irg, tv);
- size = new_rd_And(dbg, irg, block, size, mask, mode);
+ size = new_rd_And(dbg, block, size, mask, mode);
}
return size;
}
assert(get_Alloc_where(alloc) == stack_alloc);
block = get_nodes_block(alloc);
- irg = get_irn_irg(block);
+ irg = get_Block_irg(block);
alloc_mem = NULL;
alloc_res = NULL;
type = get_Alloc_type(alloc);
tarval *tv = new_tarval_from_long(get_type_size_bytes(type),
mode);
ir_node *cnst = new_rd_Const(dbg, irg, tv);
- size = new_rd_Mul(dbg, irg, block, size, cnst, mode);
+ size = new_rd_Mul(dbg, block, size, cnst, mode);
}
/* The stack pointer will be modified in an unknown manner.
env->call->flags.bits.try_omit_fp = 0;
stack_alignment = 1 << env->arch_env->stack_alignment;
- size = adjust_alloc_size(stack_alignment, size, irg, block, dbg);
- new_alloc = be_new_AddSP(env->arch_env->sp, irg, block, curr_sp, size);
+ size = adjust_alloc_size(stack_alignment, size, block, dbg);
+ new_alloc = be_new_AddSP(env->arch_env->sp, block, curr_sp, size);
set_irn_dbg_info(new_alloc, dbg);
if (alloc_mem != NULL) {
ir_node *addsp_mem;
ir_node *sync;
- addsp_mem = new_r_Proj(irg, block, new_alloc, mode_M, pn_be_AddSP_M);
+ addsp_mem = new_r_Proj(block, new_alloc, mode_M, pn_be_AddSP_M);
/* We need to sync the output mem of the AddSP with the input mem
edge into the alloc node. */
ins[0] = get_Alloc_mem(alloc);
ins[1] = addsp_mem;
- sync = new_r_Sync(irg, block, 2, ins);
+ sync = new_r_Sync(block, 2, ins);
exchange(alloc_mem, sync);
}
set_Proj_proj(alloc_res, pn_be_AddSP_res);
addr = alloc_res;
- curr_sp = new_r_Proj(irg, block, new_alloc, get_irn_mode(curr_sp),
+ curr_sp = new_r_Proj(block, new_alloc, get_irn_mode(curr_sp),
pn_be_AddSP_sp);
return curr_sp;
if (type != firm_unknown_type && get_type_size_bytes(type) != 1) {
tarval *tv = new_tarval_from_long(get_type_size_bytes(type), mode_Iu);
ir_node *cnst = new_rd_Const(dbg, irg, tv);
- ir_node *mul = new_rd_Mul(dbg, irg, block, get_Free_size(free),
+ ir_node *mul = new_rd_Mul(dbg, block, get_Free_size(free),
cnst, mode_Iu);
size = mul;
} else {
}
stack_alignment = 1 << env->arch_env->stack_alignment;
- size = adjust_alloc_size(stack_alignment, size, irg, block, dbg);
+ size = adjust_alloc_size(stack_alignment, size, block, dbg);
/* The stack pointer will be modified in an unknown manner.
We cannot omit it. */
env->call->flags.bits.try_omit_fp = 0;
- subsp = be_new_SubSP(env->arch_env->sp, irg, block, curr_sp, size);
+ subsp = be_new_SubSP(env->arch_env->sp, block, curr_sp, size);
set_irn_dbg_info(subsp, dbg);
- mem = new_r_Proj(irg, block, subsp, mode_M, pn_be_SubSP_M);
- res = new_r_Proj(irg, block, subsp, sp_mode, pn_be_SubSP_sp);
+ mem = new_r_Proj(block, subsp, mode_M, pn_be_SubSP_M);
+ res = new_r_Proj(block, subsp, sp_mode, pn_be_SubSP_sp);
/* we need to sync the memory */
in[0] = get_Free_mem(free);
in[1] = mem;
- sync = new_r_Sync(irg, block, 2, in);
+ sync = new_r_Sync(block, 2, in);
/* and make the AddSP dependent on the former memory */
add_irn_dep(subsp, get_Free_mem(free));
if (curr_sp != env->init_sp &&
!(is_Proj(curr_sp) && be_is_Call(get_Proj_pred(curr_sp)))) {
nodes[0] = curr_sp;
- keep = be_new_Keep(env->arch_env->sp->reg_class,
- get_irn_irg(bl), bl, 1, nodes);
+ keep = be_new_Keep(env->arch_env->sp->reg_class, bl, 1, nodes);
pmap_insert(env->keep_map, bl, keep);
}
}
}
in = (ir_node **) obstack_finish(&env->obst);
- irn = be_new_Barrier(irg, bl, n, in);
+ irn = be_new_Barrier(bl, n, in);
obstack_free(&env->obst, in);
for (n = 0; n < n_regs; ++n) {
add_type |= arch_register_req_type_produces_sp;
}
- proj = new_r_Proj(irg, bl, irn, get_irn_mode(pred), n);
+ proj = new_r_Proj(bl, irn, get_irn_mode(pred), n);
be_node_set_reg_class_in(irn, n, reg->reg_class);
if (in_req)
be_set_constr_single_reg_in(irn, n, reg, 0);
}
if (mem) {
- *mem = new_r_Proj(irg, bl, irn, mode_M, n);
+ *mem = new_r_Proj(bl, irn, mode_M, n);
}
obstack_free(&env->obst, rm);
ent = get_argument_entity(ent, ctx);
}
- nw = be_new_FrameAddr(ctx->sp_class, current_ir_graph, bl, ctx->frame, ent);
+ nw = be_new_FrameAddr(ctx->sp_class, bl, ctx->frame, ent);
exchange(irn, nw);
/* check, if it's a param Sel and if have not seen this entity before */
save_optimization_state(&state);
set_optimize(0);
- nmem = new_r_Proj(irg, start_bl, get_irg_start(irg), mode_M, pn_Start_M);
+ nmem = new_r_Proj(start_bl, get_irg_start(irg), mode_M, pn_Start_M);
restore_optimization_state(&state);
/* reroute all edges to the new memory source */
ir_node *addr;
/* address for the backing store */
- addr = be_new_FrameAddr(env->arch_env->sp->reg_class, irg, first_bl, frame, entry->ent);
+ addr = be_new_FrameAddr(env->arch_env->sp->reg_class, first_bl, frame, entry->ent);
if (store)
- mem = new_r_Proj(irg, first_bl, store, mode_M, pn_Store_M);
+ mem = new_r_Proj(first_bl, store, mode_M, pn_Store_M);
/* the backing store itself */
- store = new_r_Store(irg, first_bl, mem, addr,
- new_r_Proj(irg, args_bl, args, mode, i), 0);
+ store = new_r_Store(first_bl, mem, addr,
+ new_r_Proj(args_bl, args, mode, i), 0);
}
/* the new memory Proj gets the last Proj from store */
set_Proj_pred(nmem, store);
if (is_Anchor(block))
continue;
if (block != start_block) {
- ir_node *jmp = new_r_Jmp(irg, start_block);
+ ir_node *jmp = new_r_Jmp(start_block);
set_Block_cfgpred(block, get_edge_src_pos(edge), jmp);
return;
pmap_insert(env->regs, (void *) sp, NULL);
pmap_insert(env->regs, (void *) arch_env->bp, NULL);
reg_params_bl = get_irg_start_block(irg);
- env->reg_params = be_new_RegParams(irg, reg_params_bl, pmap_count(env->regs));
+ env->reg_params = be_new_RegParams(reg_params_bl, pmap_count(env->regs));
add_irn_dep(env->reg_params, get_irg_start(irg));
/*
add_type |= arch_register_req_type_produces_sp | arch_register_req_type_ignore;
assert(nr >= 0);
- proj = new_r_Proj(irg, reg_params_bl, env->reg_params, mode, nr);
+ proj = new_r_Proj(reg_params_bl, env->reg_params, mode, nr);
pmap_insert(env->regs, (void *) reg, proj);
be_set_constr_single_reg_out(env->reg_params, nr, reg, add_type);
arch_set_irn_register(proj, reg);
/* create a new initial memory proj */
assert(is_Proj(old_mem));
- new_mem_proj = new_r_Proj(irg, get_nodes_block(old_mem),
+ new_mem_proj = new_r_Proj(get_nodes_block(old_mem),
new_r_Unknown(irg, mode_T), mode_M,
get_Proj_proj(old_mem));
mem = new_mem_proj;
might be added before it */
env->init_sp = be_abi_reg_map_get(env->regs, sp);
start_bl = get_irg_start_block(irg);
- env->init_sp = be_new_IncSP(sp, irg, start_bl, env->init_sp, BE_STACK_FRAME_SIZE_EXPAND, 0);
+ env->init_sp = be_new_IncSP(sp, start_bl, env->init_sp, BE_STACK_FRAME_SIZE_EXPAND, 0);
be_abi_reg_map_set(env->regs, sp, env->init_sp);
create_barrier(env, start_bl, &mem, env->regs, 0);
if (arg->in_reg) {
repl = pmap_get(env->regs, (void *) arg->reg);
} else if (arg->on_stack) {
- ir_node *addr = be_new_FrameAddr(sp->reg_class, irg, reg_params_bl, frame_pointer, arg->stack_ent);
+ ir_node *addr = be_new_FrameAddr(sp->reg_class, reg_params_bl, frame_pointer, arg->stack_ent);
/* For atomic parameters which are actually used, we create a Load node. */
if (is_atomic_type(param_type) && get_irn_n_edges(args[i]) > 0) {
ir_mode *mode = get_type_mode(param_type);
ir_mode *load_mode = arg->load_mode;
- ir_node *load = new_r_Load(irg, reg_params_bl, new_NoMem(), addr, load_mode, cons_floats);
- repl = new_r_Proj(irg, reg_params_bl, load, load_mode, pn_Load_res);
+ ir_node *load = new_r_Load(reg_params_bl, new_NoMem(), addr, load_mode, cons_floats);
+ repl = new_r_Proj(reg_params_bl, load, load_mode, pn_Load_res);
if (mode != load_mode) {
- repl = new_r_Conv(irg, reg_params_bl, repl, mode);
+ repl = new_r_Conv(reg_params_bl, repl, mode);
}
} else {
/* The stack parameter is not primitive (it is a struct or array),
which may be wrong. Add Conv's then. */
mode = get_irn_mode(args[i]);
if (mode != get_irn_mode(repl)) {
- repl = new_r_Conv(irg, get_irn_n(repl, -1), repl, mode);
+ repl = new_r_Conv(get_nodes_block(repl), repl, mode);
}
exchange(args[i], repl);
}
/* all ok now for locally constructed stuff */
if (can_address_relative(entity)) {
- ir_node *add = new_r_Add(irg, block, pic_base, pred, mode);
+ ir_node *add = new_r_Add(block, pic_base, pred, mode);
/* make sure the walker doesn't visit this add again */
mark_irn_visited(add);
pic_symbol = get_pic_symbol(be, entity);
pic_symconst = new_rd_SymConst_addr_ent(dbgi, irg, mode_P_code,
pic_symbol, NULL);
- add = new_r_Add(irg, block, pic_base, pic_symconst, mode);
+ add = new_r_Add(block, pic_base, pic_symconst, mode);
mark_irn_visited(add);
/* we need an extra indirection for global data outside our current
module. The loads are always safe and can therefore float
and need no memory input */
- load = new_r_Load(irg, block, new_NoMem(), add, mode, cons_floats);
- load_res = new_r_Proj(irg, block, load, mode, pn_Load_res);
+ load = new_r_Load(block, new_NoMem(), add, mode, cons_floats);
+ load_res = new_r_Proj(block, load, mode, pn_Load_res);
set_irn_n(node, i, load_res);
}
ir_mode *mode_UInt = get_reference_mode_unsigned_eq(mode);
ir_node *cnst = new_r_Const_long(current_ir_graph, mode_UInt, offset);
- ptr = new_rd_Add(dbgi, current_ir_graph, bl, ptr, cnst, mode);
+ ptr = new_rd_Add(dbgi, bl, ptr, cnst, mode);
}
exchange(sel, ptr);
}
if (rbitset_is_set(req->limited, reg->index))
continue;
- copy = be_new_Copy(env->cls, env->irg, bl, op);
+ copy = be_new_Copy(env->cls, bl, op);
be_stat_ev("constr_copy", 1);
sched_add_before(irn, copy);
if (be_is_Copy(get_irn_n(insn->irn, a_op->pos)))
continue;
- copy = be_new_Copy(env->cls, env->irg, bl, op->carrier);
+ copy = be_new_Copy(env->cls, bl, op->carrier);
be_stat_ev("constr_copy", 1);
sched_add_before(insn->irn, copy);
if (be_is_Copy(get_irn_n(insn->irn, op->pos)))
continue;
- copy = be_new_Copy(env->cls, env->irg, bl, op->carrier);
+ copy = be_new_Copy(env->cls, bl, op->carrier);
sched_add_before(insn->irn, copy);
set_irn_n(insn->irn, op->pos, copy);
if(get_irn_mode(copy) == mode_T) {
ir_node *block = get_nodes_block(copy);
ir_mode *mode = flag_class->mode;
- value = new_rd_Proj(NULL, current_ir_graph, block,
- copy, mode, pn);
+ value = new_rd_Proj(NULL, block, copy, mode, pn);
} else {
value = copy;
}
}
ir_nodeset_destroy(&live);
- perm = be_new_Perm(cls, irg, bl, n, nodes);
+ perm = be_new_Perm(cls, bl, n, nodes);
sched_add_after(pos, perm);
free(nodes);
be_ssa_construction_env_t senv;
ir_mode *mode = get_irn_mode(perm_op);
- ir_node *proj = new_r_Proj(irg, bl, perm, mode, i);
+ ir_node *proj = new_r_Proj(bl, perm, mode, i);
arch_set_irn_register(proj, reg);
curr = proj;
DBG((dbg, LEVEL_1, "%+F (%+F, %s) and (%+F, %s)\n",
irn, res1, cycle.elems[i]->name, res2, cycle.elems[i + 1]->name));
- cpyxchg = be_new_Perm(reg_class, irg, block, 2, in);
+ cpyxchg = be_new_Perm(reg_class, block, 2, in);
if (i > 0) {
/* cycle is not done yet */
int pidx = get_pairidx_for_in_regidx(pairs, n, cycle.elems[i]->index);
/* create intermediate proj */
- res1 = new_r_Proj(irg, block, cpyxchg, get_irn_mode(res1), 0);
+ res1 = new_r_Proj(block, cpyxchg, get_irn_mode(res1), 0);
/* set as in for next Perm */
pairs[pidx].in_node = res1;
DB((dbg, LEVEL_1, "%+F creating copy node (%+F, %s) -> (%+F, %s)\n",
irn, arg1, cycle.elems[i]->name, res2, cycle.elems[i + 1]->name));
- cpyxchg = be_new_Copy(reg_class, irg, block, arg1);
+ cpyxchg = be_new_Copy(reg_class, block, arg1);
arch_set_irn_register(cpyxchg, cycle.elems[i + 1]);
/* exchange copy node and proj */
/* check if already exists such a copy in the schedule immediately before */
cpy = find_copy(skip_Proj(irn), other_different);
if (! cpy) {
- cpy = be_new_Copy(cls, irg, block, other_different);
+ cpy = be_new_Copy(cls, block, other_different);
arch_irn_set_flags(cpy, arch_irn_flags_dont_spill);
DB((dbg_constr, LEVEL_1, "created non-spillable %+F for value %+F\n", cpy, other_different));
} else {
/* Add the Keep resp. CopyKeep and reroute the users */
/* of the other_different irn in case of CopyKeep. */
if (has_irn_users(other_different)) {
- keep = be_new_CopyKeep_single(cls, irg, block, cpy, irn, get_irn_mode(other_different));
+ keep = be_new_CopyKeep_single(cls, block, cpy, irn, get_irn_mode(other_different));
be_node_set_reg_class_in(keep, 1, cls);
} else {
ir_node *in[2];
in[0] = irn;
in[1] = cpy;
- keep = be_new_Keep(cls, irg, block, 2, in);
+ keep = be_new_Keep(cls, block, 2, in);
}
DB((dbg_constr, LEVEL_1, "created %+F(%+F, %+F)\n\n", keep, irn, cpy));
}
#ifdef KEEP_ALIVE_COPYKEEP_HACK
- new_ck = be_new_CopyKeep(entry->cls, irg, get_nodes_block(ref), be_get_CopyKeep_op(ref), n_melt, new_ck_in, mode_ANY);
+ new_ck = be_new_CopyKeep(entry->cls, get_nodes_block(ref), be_get_CopyKeep_op(ref), n_melt, new_ck_in, mode_ANY);
keep_alive(new_ck);
#else
- new_ck = be_new_CopyKeep(entry->cls, irg, get_nodes_block(ref), be_get_CopyKeep_op(ref), n_melt, new_ck_in, get_irn_mode(ref));
+ new_ck = be_new_CopyKeep(entry->cls, get_nodes_block(ref), be_get_CopyKeep_op(ref), n_melt, new_ck_in, get_irn_mode(ref));
#endif /* KEEP_ALIVE_COPYKEEP_HACK */
/* set register class for all kept inputs */
int n = get_irn_arity(cp);
ir_node *keep;
- keep = be_new_Keep(cls, irg, get_nodes_block(cp), n, get_irn_in(cp) + 1);
+ keep = be_new_Keep(cls, get_nodes_block(cp), n, get_irn_in(cp) + 1);
sched_add_before(cp, keep);
/* Set all ins (including the block) of the CopyKeep BAD to keep the verifier happy. */
}
block = get_nodes_block(before);
- perm = be_new_Perm(cls, irg, block, i, in);
+ perm = be_new_Perm(cls, block, i, in);
sched_add_before(before, perm);
value = in[i];
mode = get_irn_mode(value);
- proj = new_r_Proj(irg, block, perm, mode, i);
+ proj = new_r_Proj(block, perm, mode, i);
reg = arch_register_for_index(cls, new_reg);
}
ir_node *be_new_Spill(const arch_register_class_t *cls, const arch_register_class_t *cls_frame,
- ir_graph *irg, ir_node *bl, ir_node *frame, ir_node *to_spill)
+ ir_node *bl, ir_node *frame, ir_node *to_spill)
{
be_frame_attr_t *a;
ir_node *in[2];
ir_node *res;
+ ir_graph *irg = get_Block_irg(bl);
in[0] = frame;
in[1] = to_spill;
}
ir_node *be_new_Reload(const arch_register_class_t *cls,
- const arch_register_class_t *cls_frame, ir_graph *irg, ir_node *block,
+ const arch_register_class_t *cls_frame, ir_node *block,
ir_node *frame, ir_node *mem, ir_mode *mode)
{
- ir_node *in[2];
- ir_node *res;
+ ir_node *in[2];
+ ir_node *res;
+ ir_graph *irg = get_Block_irg(block);
in[0] = frame;
in[1] = mem;
return get_irn_n(irn, be_pos_Spill_frame);
}
-ir_node *be_new_Perm(const arch_register_class_t *cls, ir_graph *irg,
- ir_node *block, int n, ir_node *in[])
+ir_node *be_new_Perm(const arch_register_class_t *cls, ir_node *block, int n, ir_node *in[])
{
- int i;
+ int i;
+ ir_graph *irg = get_Block_irg(block);
+
ir_node *irn = new_ir_node(NULL, irg, block, op_be_Perm, mode_T, n, in);
init_node_attr(irn, n);
- for(i = 0; i < n; ++i) {
+ for (i = 0; i < n; ++i) {
be_node_set_reg_class_in(irn, i, cls);
be_node_set_reg_class_out(irn, i, cls);
}
set_irn_in(perm, new_size, new_in);
}
-ir_node *be_new_MemPerm(const arch_env_t *arch_env, ir_graph *irg, ir_node *bl, int n, ir_node *in[])
+ir_node *be_new_MemPerm(const arch_env_t *arch_env, ir_node *bl, int n, ir_node *in[])
{
+ ir_graph *irg = get_Block_irg(bl);
ir_node *frame = get_irg_frame(irg);
const arch_register_class_t *cls_frame = arch_get_irn_reg_class_out(frame);
const arch_register_t *sp = arch_env->sp;
}
-ir_node *be_new_Copy(const arch_register_class_t *cls, ir_graph *irg, ir_node *bl, ir_node *op)
+ir_node *be_new_Copy(const arch_register_class_t *cls, ir_node *bl, ir_node *op)
{
ir_node *in[1];
ir_node *res;
arch_register_req_t *req;
+ ir_graph *irg = get_Block_irg(bl);
in[0] = op;
res = new_ir_node(NULL, irg, bl, op_be_Copy, get_irn_mode(op), 1, in);
set_irn_n(cpy, be_pos_Copy_op, op);
}
-ir_node *be_new_Keep(const arch_register_class_t *cls, ir_graph *irg, ir_node *bl, int n, ir_node *in[])
+ir_node *be_new_Keep(const arch_register_class_t *cls, ir_node *bl, int n, ir_node *in[])
{
int i;
ir_node *res;
+ ir_graph *irg = get_Block_irg(bl);
res = new_ir_node(NULL, irg, bl, op_be_Keep, mode_ANY, -1, NULL);
init_node_attr(res, -1);
return pos;
}
-ir_node *be_new_IncSP(const arch_register_t *sp, ir_graph *irg, ir_node *bl,
+ir_node *be_new_IncSP(const arch_register_t *sp, ir_node *bl,
ir_node *old_sp, int offset, int align)
{
be_incsp_attr_t *a;
ir_node *irn;
ir_node *in[1];
+ ir_graph *irg = get_Block_irg(bl);
in[0] = old_sp;
irn = new_ir_node(NULL, irg, bl, op_be_IncSP, sp->reg_class->mode,
return irn;
}
-ir_node *be_new_AddSP(const arch_register_t *sp, ir_graph *irg, ir_node *bl, ir_node *old_sp, ir_node *sz)
+ir_node *be_new_AddSP(const arch_register_t *sp, ir_node *bl, ir_node *old_sp, ir_node *sz)
{
be_node_attr_t *a;
ir_node *irn;
ir_node *in[be_pos_AddSP_last];
const arch_register_class_t *cls;
+ ir_graph *irg;
in[be_pos_AddSP_old_sp] = old_sp;
in[be_pos_AddSP_size] = sz;
+ irg = get_Block_irg(bl);
irn = new_ir_node(NULL, irg, bl, op_be_AddSP, mode_T, be_pos_AddSP_last, in);
a = init_node_attr(irn, be_pos_AddSP_last);
return irn;
}
-ir_node *be_new_SubSP(const arch_register_t *sp, ir_graph *irg, ir_node *bl, ir_node *old_sp, ir_node *sz)
+ir_node *be_new_SubSP(const arch_register_t *sp, ir_node *bl, ir_node *old_sp, ir_node *sz)
{
be_node_attr_t *a;
ir_node *irn;
ir_node *in[be_pos_SubSP_last];
+ ir_graph *irg;
in[be_pos_SubSP_old_sp] = old_sp;
in[be_pos_SubSP_size] = sz;
+ irg = get_Block_irg(bl);
irn = new_ir_node(NULL, irg, bl, op_be_SubSP, mode_T, be_pos_SubSP_last, in);
a = init_node_attr(irn, be_pos_SubSP_last);
return irn;
}
-ir_node *be_new_RegParams(ir_graph *irg, ir_node *bl, int n_outs)
+ir_node *be_new_RegParams(ir_node *bl, int n_outs)
{
ir_node *res;
int i;
+ ir_graph *irg = get_Block_irg(bl);
res = new_ir_node(NULL, irg, bl, op_be_RegParams, mode_T, 0, NULL);
init_node_attr(res, -1);
return res;
}
-ir_node *be_new_FrameAddr(const arch_register_class_t *cls_frame, ir_graph *irg, ir_node *bl, ir_node *frame, ir_entity *ent)
+ir_node *be_new_FrameAddr(const arch_register_class_t *cls_frame, ir_node *bl, ir_node *frame, ir_entity *ent)
{
be_frame_attr_t *a;
ir_node *irn;
ir_node *in[1];
+ ir_graph *irg = get_Block_irg(bl);
in[0] = frame;
irn = new_ir_node(NULL, irg, bl, op_be_FrameAddr, get_irn_mode(frame), 1, in);
return attr->ent;
}
-ir_node *be_new_CopyKeep(const arch_register_class_t *cls, ir_graph *irg, ir_node *bl, ir_node *src, int n, ir_node *in_keep[], ir_mode *mode)
+ir_node *be_new_CopyKeep(const arch_register_class_t *cls, ir_node *bl, ir_node *src, int n, ir_node *in_keep[], ir_mode *mode)
{
ir_node *irn;
ir_node **in = ALLOCAN(ir_node*, n + 1);
+ ir_graph *irg = get_Block_irg(bl);
in[0] = src;
memcpy(&in[1], in_keep, n * sizeof(in[0]));
return irn;
}
-ir_node *be_new_CopyKeep_single(const arch_register_class_t *cls, ir_graph *irg, ir_node *bl, ir_node *src, ir_node *keep, ir_mode *mode)
+ir_node *be_new_CopyKeep_single(const arch_register_class_t *cls, ir_node *bl, ir_node *src, ir_node *keep, ir_mode *mode)
{
- return be_new_CopyKeep(cls, irg, bl, src, 1, &keep, mode);
+ return be_new_CopyKeep(cls, bl, src, 1, &keep, mode);
}
ir_node *be_get_CopyKeep_op(const ir_node *cpy) {
set_irn_n(cpy, be_pos_CopyKeep_op, op);
}
-ir_node *be_new_Barrier(ir_graph *irg, ir_node *bl, int n, ir_node *in[])
+ir_node *be_new_Barrier(ir_node *bl, int n, ir_node *in[])
{
ir_node *res;
int i;
+ ir_graph *irg = get_Block_irg(bl);
res = new_ir_node(NULL, irg, bl, op_be_Barrier, mode_T, -1, NULL);
init_node_attr(res, -1);
ir_node *be_Barrier_append_node(ir_node *barrier, ir_node *node)
{
- ir_graph *irg = get_irn_irg(barrier);
ir_node *block = get_nodes_block(barrier);
ir_mode *mode = get_irn_mode(node);
int n = add_irn_n(barrier, node);
- ir_node *proj = new_r_Proj(irg, block, barrier, mode, n);
+ ir_node *proj = new_r_Proj(block, barrier, mode, n);
add_register_req(barrier);
return proj;
}
/* Construct a new be_Unwind. */
-ir_node *be_new_Unwind(dbg_info *dbg, ir_graph *irg, ir_node *block,
+ir_node *be_new_Unwind(dbg_info *dbg, ir_node *block,
ir_node *mem, ir_node *sp)
{
ir_node *res;
ir_node *in[2];
+ ir_graph *irg = get_Block_irg(block);
in[be_pos_Unwind_mem] = mem;
in[be_pos_Unwind_sp] = sp;
ir_node *be_spill(ir_node *block, ir_node *irn)
{
- ir_graph *irg = get_irn_irg(block);
+ ir_graph *irg = get_Block_irg(block);
ir_node *frame = get_irg_frame(irg);
const arch_register_class_t *cls = arch_get_irn_reg_class_out(irn);
const arch_register_class_t *cls_frame = arch_get_irn_reg_class_out(frame);
ir_node *spill;
- spill = be_new_Spill(cls, cls_frame, irg, block, frame, irn);
+ spill = be_new_Spill(cls, cls_frame, block, frame, irn);
return spill;
}
{
ir_node *reload;
ir_node *bl = is_Block(insert) ? insert : get_nodes_block(insert);
- ir_graph *irg = get_irn_irg(bl);
+ ir_graph *irg = get_Block_irg(bl);
ir_node *frame = get_irg_frame(irg);
const arch_register_class_t *cls_frame = arch_get_irn_reg_class_out(frame);
assert(be_is_Spill(spill) || (is_Phi(spill) && get_irn_mode(spill) == mode_M));
- reload = be_new_Reload(cls, cls_frame, irg, bl, frame, spill, mode);
+ reload = be_new_Reload(cls, cls_frame, bl, frame, spill, mode);
if (is_Block(insert)) {
insert = sched_skip(insert, 0, sched_skip_cf_predicator, NULL);
* Make a new Spill node.
*/
ir_node *be_new_Spill(const arch_register_class_t *cls, const arch_register_class_t *cls_frame,
- ir_graph *irg, ir_node *bl, ir_node *frame, ir_node *to_spill);
+ ir_node *bl, ir_node *frame, ir_node *to_spill);
/**
* Position numbers for the be_Reload inputs.
* Make a new Reload node.
*/
ir_node *be_new_Reload(const arch_register_class_t *cls, const arch_register_class_t *cls_frame,
- ir_graph *irg, ir_node *bl, ir_node *frame, ir_node *mem, ir_mode *mode);
+ ir_node *bl, ir_node *frame, ir_node *mem, ir_mode *mode);
/**
* Position numbers for the be_Copy inputs.
/**
* Make a new Copy node.
*/
-ir_node *be_new_Copy(const arch_register_class_t *cls, ir_graph *irg, ir_node *block, ir_node *in);
+ir_node *be_new_Copy(const arch_register_class_t *cls, ir_node *block, ir_node *in);
/** Returns the Copy Argument. */
ir_node *be_get_Copy_op(const ir_node *cpy);
/** Sets the Copy Argument. */
/**
* Make a new Perm node.
*/
-ir_node *be_new_Perm(const arch_register_class_t *cls, ir_graph *irg, ir_node *bl, int arity, ir_node *in[]);
+ir_node *be_new_Perm(const arch_register_class_t *cls, ir_node *bl, int arity, ir_node *in[]);
/**
* Reduce a Perm.
/**
* Create a new MemPerm node.
*/
-ir_node *be_new_MemPerm(const arch_env_t *arch_env, ir_graph *irg, ir_node *bl, int n, ir_node *in[]);
-ir_node *be_new_Keep(const arch_register_class_t *cls, ir_graph *irg, ir_node *bl, int arity, ir_node *in[]);
+ir_node *be_new_MemPerm(const arch_env_t *arch_env, ir_node *bl, int n, ir_node *in[]);
+ir_node *be_new_Keep(const arch_register_class_t *cls, ir_node *bl, int arity, ir_node *in[]);
void be_Keep_add_node(ir_node *keep, const arch_register_class_t *cls, ir_node *node);
};
/** Create a new FrameAddr node. */
-ir_node *be_new_FrameAddr(const arch_register_class_t *cls_frame, ir_graph *irg, ir_node *bl, ir_node *frame, ir_entity *ent);
+ir_node *be_new_FrameAddr(const arch_register_class_t *cls_frame, ir_node *bl, ir_node *frame, ir_entity *ent);
/** Return the frame input of a FrameAddr node. */
ir_node *be_get_FrameAddr_frame(const ir_node *node);
* grows. In contrast to IncSP, the amount of bytes the stack pointer is grown, is not
* given by a constant but an ordinary Firm node.
* @param sp The stack pointer register.
- * @param irg The graph.
* @param bl The block.
* @param old_sp The node representing the old stack pointer value.
* @param sz The node expressing the size by which the stack pointer shall be grown.
* @return A new AddSP node.
*/
-ir_node *be_new_AddSP(const arch_register_t *sp, ir_graph *irg, ir_node *bl, ir_node *old_sp, ir_node *sz);
+ir_node *be_new_AddSP(const arch_register_t *sp, ir_node *bl, ir_node *old_sp, ir_node *sz);
/**
* Position numbers for the be_SubSP inputs
* grows. In contrast to IncSP, the amount of bytes the stack pointer is grown, is not
* given by a constant but an ordinary Firm node.
* @param sp The stack pointer register.
- * @param irg The graph.
* @param bl The block.
* @param old_sp The node representing the old stack pointer value.
* @param sz The node expressing the size by which the stack pointer shall be grown.
* @return A new DecSP node.
*/
-ir_node *be_new_SubSP(const arch_register_t *sp, ir_graph *irg, ir_node *bl, ir_node *old_sp, ir_node *sz);
+ir_node *be_new_SubSP(const arch_register_t *sp, ir_node *bl, ir_node *old_sp, ir_node *sz);
/**
* Make a stack pointer increase/decrease node.
- * @param sp The stack pointer register.
- * @param irg The graph to insert the node to.
+ * @param sp The stack pointer register. * @param irg The graph to insert the node to.
* @param bl The block to insert the node into.
* @param old_sp The node defining the former stack pointer.
* @param amount The mount of bytes the stack shall be expanded/shrinked (see set_IncSP_offset)
* @return A new stack pointer increment/decrement node.
* @note This node sets a register constraint to the @p sp register on its output.
*/
-ir_node *be_new_IncSP(const arch_register_t *sp, ir_graph *irg, ir_node *bl,
+ir_node *be_new_IncSP(const arch_register_t *sp, ir_node *bl,
ir_node *old_sp, int offset, int align);
/** Returns the previous node that computes the stack pointer. */
/** appends a node to the return node, returns the position of the node */
int be_Return_append_node(ir_node *ret, ir_node *node);
-ir_node *be_new_RegParams(ir_graph *irg, ir_node *bl, int n_out);
+ir_node *be_new_RegParams(ir_node *bl, int n_out);
-ir_node *be_new_Barrier(ir_graph *irg, ir_node *bl, int n, ir_node *in[]);
+ir_node *be_new_Barrier(ir_node *bl, int n, ir_node *in[]);
/**
* Appends a node to a barrier, returns the result proj of the node
enum {
be_pos_CopyKeep_op = 0
};
-ir_node *be_new_CopyKeep(const arch_register_class_t *cls, ir_graph *irg, ir_node *bl, ir_node *src, int n, ir_node *in_keep[], ir_mode *mode);
-ir_node *be_new_CopyKeep_single(const arch_register_class_t *cls, ir_graph *irg, ir_node *bl, ir_node *src, ir_node *keep, ir_mode *mode);
+ir_node *be_new_CopyKeep(const arch_register_class_t *cls, ir_node *bl, ir_node *src, int n, ir_node *in_keep[], ir_mode *mode);
+ir_node *be_new_CopyKeep_single(const arch_register_class_t *cls, ir_node *bl, ir_node *src, ir_node *keep, ir_mode *mode);
ir_node *be_get_CopyKeep_op(const ir_node *cpy);
void be_set_CopyKeep_op(ir_node *cpy, ir_node *op);
* Construct a new be_Unwind.
*
* @param dbg debug info
- * @param irg the graph where the new node will be placed
* @param bl the block where the new node will be placed
* @param mem the memory input
* @param sp the stack pointer input
*/
-ir_node *be_new_Unwind(dbg_info *dbg, ir_graph *irg, ir_node *bl, ir_node *mem, ir_node *sp);
+ir_node *be_new_Unwind(dbg_info *dbg, ir_node *bl, ir_node *mem, ir_node *sp);
ir_node *be_get_Unwind_mem(const ir_node *irn);
ir_node *be_get_Unwind_sp(const ir_node *irn);
/* override or replace spills list... */
spill = obstack_alloc(&env->obst, sizeof(spill[0]));
spill->after = skip_keeps_phis(phi);
- spill->spill = new_r_Phi(irg, block, arity, ins, mode_M);
+ spill->spill = new_r_Phi(block, arity, ins, mode_M);
spill->next = NULL;
spillinfo->spills = spill;
nodes[i] = arg;
}
- mempermnode = be_new_MemPerm(arch_env, irg, memperm->block,
+ mempermnode = be_new_MemPerm(arch_env, memperm->block,
memperm->entrycount, nodes);
/* insert node into schedule */
ir_node *link_with)
{
int i, n_preds = get_Block_n_cfgpreds(block);
- ir_graph *irg = get_irn_irg(block);
+ ir_graph *irg = get_Block_irg(block);
ir_node **ins = ALLOCAN(ir_node*, n_preds);
ir_node *phi;
for(i = 0; i < n_preds; ++i) {
ins[i] = new_r_Unknown(irg, env->mode);
}
- phi = new_r_Phi(irg, block, n_preds, ins, env->mode);
+ phi = new_r_Phi(block, n_preds, ins, env->mode);
if(env->new_phis != NULL) {
ARR_APP1(ir_node*, env->new_phis, phi);
}
insert_all_perms_env_t *env = data;
be_chordal_env_t *chordal_env = env->chordal_env;
pmap *perm_map = env->perm_map;
- ir_graph *irg = chordal_env->irg;
be_lv_t *lv = chordal_env->birg->lv;
int i, n;
for(pp = set_first(arg_set); pp; pp = set_next(arg_set))
in[pp->pos] = pp->arg;
- perm = be_new_Perm(chordal_env->cls, irg, pred_bl, n_projs, in);
+ perm = be_new_Perm(chordal_env->cls, pred_bl, n_projs, in);
be_stat_ev("phi_perm", n_projs);
insert_after = sched_skip(sched_last(pred_bl), 0, sched_skip_cf_predicator, NULL);
*/
insert_after = perm;
for(pp = set_first(arg_set); pp; pp = set_next(arg_set)) {
- ir_node *proj = new_r_Proj(irg, pred_bl, perm, get_irn_mode(pp->arg), pp->pos);
+ ir_node *proj = new_r_Proj(pred_bl, perm, get_irn_mode(pp->arg), pp->pos);
pp->proj = proj;
assert(get_reg(pp->arg));
set_reg(proj, get_reg(pp->arg));
insert it into schedule,
pin it
*/
- ir_node *dupl = be_new_Copy(cls, chordal_env->irg, arg_block, arg);
+ ir_node *dupl = be_new_Copy(cls, arg_block, arg);
/* this is commented out because it will fail in case of unknown float */
#if 0
insert it into schedule,
pin it
*/
- ir_node *perm = get_Proj_pred(arg);
- ir_node *dupl = be_new_Copy(cls, chordal_env->irg, arg_block, arg);
+ ir_node *perm = get_Proj_pred(arg);
+ ir_node *dupl = be_new_Copy(cls, arg_block, arg);
ir_node *ins;
/* this is commented out because it will fail in case of unknown float */
DBG((dbg, LEVEL_2, "\tcreate Phi-M for %+F\n", phi));
/* create a Phi-M */
- spill_info->spill = new_r_Phi(irg, block, arity, in, mode_M);
+ spill_info->spill = new_r_Phi(block, arity, in, mode_M);
if(spill_to_kill != NULL) {
exchange(spill_to_kill, spill_info->spill);
ia32_curr_fp_ommitted = env->flags.try_omit_fp;
if (! env->flags.try_omit_fp) {
- ir_graph *irg = env->irg;
- ir_node *bl = get_irg_start_block(irg);
+ ir_node *bl = get_irg_start_block(env->irg);
ir_node *curr_sp = be_abi_reg_map_get(reg_map, arch_env->sp);
ir_node *curr_bp = be_abi_reg_map_get(reg_map, arch_env->bp);
ir_node *noreg = ia32_new_NoReg_gp(cg);
/* push ebp */
push = new_bd_ia32_Push(NULL, bl, noreg, noreg, *mem, curr_bp, curr_sp);
- curr_sp = new_r_Proj(irg, bl, push, get_irn_mode(curr_sp), pn_ia32_Push_stack);
- *mem = new_r_Proj(irg, bl, push, mode_M, pn_ia32_Push_M);
+ curr_sp = new_r_Proj(bl, push, get_irn_mode(curr_sp), pn_ia32_Push_stack);
+ *mem = new_r_Proj(bl, push, mode_M, pn_ia32_Push_M);
/* the push must have SP out register */
arch_set_irn_register(curr_sp, arch_env->sp);
*stack_bias -= 4;
/* move esp to ebp */
- curr_bp = be_new_Copy(arch_env->bp->reg_class, irg, bl, curr_sp);
+ curr_bp = be_new_Copy(arch_env->bp->reg_class, bl, curr_sp);
be_set_constr_single_reg_out(curr_bp, 0, arch_env->bp,
arch_register_req_type_ignore);
/* beware: the copy must be done before any other sp use */
- curr_sp = be_new_CopyKeep_single(arch_env->sp->reg_class, irg, bl, curr_sp, curr_bp, get_irn_mode(curr_sp));
+ curr_sp = be_new_CopyKeep_single(arch_env->sp->reg_class, bl, curr_sp, curr_bp, get_irn_mode(curr_sp));
be_set_constr_single_reg_out(curr_sp, 0, arch_env->sp,
arch_register_req_type_produces_sp);
const arch_env_t *arch_env = env->aenv;
ir_node *curr_sp = be_abi_reg_map_get(reg_map, arch_env->sp);
ir_node *curr_bp = be_abi_reg_map_get(reg_map, arch_env->bp);
- ir_graph *irg = env->irg;
if (env->flags.try_omit_fp) {
/* simply remove the stack frame here */
- curr_sp = be_new_IncSP(arch_env->sp, irg, bl, curr_sp, BE_STACK_FRAME_SIZE_SHRINK, 0);
+ curr_sp = be_new_IncSP(arch_env->sp, bl, curr_sp, BE_STACK_FRAME_SIZE_SHRINK, 0);
} else {
ir_mode *mode_bp = arch_env->bp->reg_class->mode;
/* leave */
leave = new_bd_ia32_Leave(NULL, bl, curr_bp);
- curr_bp = new_r_Proj(irg, bl, leave, mode_bp, pn_ia32_Leave_frame);
- curr_sp = new_r_Proj(irg, bl, leave, get_irn_mode(curr_sp), pn_ia32_Leave_stack);
+ curr_bp = new_r_Proj(bl, leave, mode_bp, pn_ia32_Leave_frame);
+ curr_sp = new_r_Proj(bl, leave, get_irn_mode(curr_sp), pn_ia32_Leave_stack);
} else {
ir_node *pop;
kill_node(curr_sp);
/* copy ebp to esp */
- curr_sp = be_new_Copy(&ia32_reg_classes[CLASS_ia32_gp], irg, bl, curr_bp);
+ curr_sp = be_new_Copy(&ia32_reg_classes[CLASS_ia32_gp], bl, curr_bp);
arch_set_irn_register(curr_sp, arch_env->sp);
be_set_constr_single_reg_out(curr_sp, 0, arch_env->sp,
arch_register_req_type_ignore);
/* pop ebp */
pop = new_bd_ia32_PopEbp(NULL, bl, *mem, curr_sp);
- curr_bp = new_r_Proj(irg, bl, pop, mode_bp, pn_ia32_Pop_res);
- curr_sp = new_r_Proj(irg, bl, pop, get_irn_mode(curr_sp), pn_ia32_Pop_stack);
+ curr_bp = new_r_Proj(bl, pop, mode_bp, pn_ia32_Pop_res);
+ curr_sp = new_r_Proj(bl, pop, get_irn_mode(curr_sp), pn_ia32_Pop_stack);
- *mem = new_r_Proj(irg, bl, pop, mode_M, pn_ia32_Pop_M);
+ *mem = new_r_Proj(bl, pop, mode_M, pn_ia32_Pop_M);
}
arch_set_irn_register(curr_sp, arch_env->sp);
arch_set_irn_register(curr_bp, arch_env->bp);
ir_node *turn_back_am(ir_node *node)
{
- ir_graph *irg = current_ir_graph;
dbg_info *dbgi = get_irn_dbg_info(node);
ir_node *block = get_nodes_block(node);
ir_node *base = get_irn_n(node, n_ia32_base);
ir_node *noreg;
ir_node *load = new_bd_ia32_Load(dbgi, block, base, index, mem);
- ir_node *load_res = new_rd_Proj(dbgi, irg, block, load, mode_Iu, pn_ia32_Load_res);
+ ir_node *load_res = new_rd_Proj(dbgi, block, load, mode_Iu, pn_ia32_Load_res);
ia32_copy_am_attrs(load, node);
if (is_ia32_is_reload(node))
DBG_OPT_RELOAD2LD(node, new_op);
- proj = new_rd_Proj(dbg, irg, block, new_op, mode, pn_ia32_Load_res);
+ proj = new_rd_Proj(dbg, block, new_op, mode, pn_ia32_Load_res);
if (sched_point) {
sched_add_after(sched_point, new_op);
dbg_info *dbg = get_irn_dbg_info(node);
ir_node *block = get_nodes_block(node);
ir_node *noreg = ia32_new_NoReg_gp(cg);
- ir_graph *irg = get_irn_irg(node);
+ ir_graph *irg = get_irn_irg(node);
ir_node *frame = get_irg_frame(irg);
ir_node *pop = new_bd_ia32_PopMem(dbg, block, frame, noreg, new_NoMem(), sp);
static ir_node* create_spproj(ir_node *node, ir_node *pred, int pos)
{
- ir_graph *irg = get_irn_irg(node);
dbg_info *dbg = get_irn_dbg_info(node);
ir_node *block = get_nodes_block(node);
ir_mode *spmode = mode_Iu;
const arch_register_t *spreg = &ia32_gp_regs[REG_ESP];
ir_node *sp;
- sp = new_rd_Proj(dbg, irg, block, pred, spmode, pos);
+ sp = new_rd_Proj(dbg, block, pred, spmode, pos);
arch_set_irn_register(sp, spreg);
return sp;
}
in[0] = sp;
- keep = be_new_Keep(&ia32_reg_classes[CLASS_ia32_gp], irg, block, 1, in);
+ keep = be_new_Keep(&ia32_reg_classes[CLASS_ia32_gp], block, 1, in);
sched_add_before(node, keep);
/* exchange memprojs */
*/
static ir_node *ia32_create_trampoline_fkt(ir_node *block, ir_node *mem, ir_node *trampoline, ir_node *env, ir_node *callee)
{
- ir_graph *irg = get_Block_irg(block);
ir_node *st, *p = trampoline;
ir_mode *mode = get_irn_mode(p);
/* mov ecx,<env> */
- st = new_r_Store(irg, block, mem, p, new_Const_long(mode_Bu, 0xb9), 0);
- mem = new_r_Proj(irg, block, st, mode_M, pn_Store_M);
- p = new_r_Add(irg, block, p, new_Const_long(mode_Iu, 1), mode);
- st = new_r_Store(irg, block, mem, p, env, 0);
- mem = new_r_Proj(irg, block, st, mode_M, pn_Store_M);
- p = new_r_Add(irg, block, p, new_Const_long(mode_Iu, 4), mode);
+ st = new_r_Store(block, mem, p, new_Const_long(mode_Bu, 0xb9), 0);
+ mem = new_r_Proj(block, st, mode_M, pn_Store_M);
+ p = new_r_Add(block, p, new_Const_long(mode_Iu, 1), mode);
+ st = new_r_Store(block, mem, p, env, 0);
+ mem = new_r_Proj(block, st, mode_M, pn_Store_M);
+ p = new_r_Add(block, p, new_Const_long(mode_Iu, 4), mode);
/* jmp <callee> */
- st = new_r_Store(irg, block, mem, p, new_Const_long(mode_Bu, 0xe9), 0);
- mem = new_r_Proj(irg, block, st, mode_M, pn_Store_M);
- p = new_r_Add(irg, block, p, new_Const_long(mode_Iu, 1), mode);
- st = new_r_Store(irg, block, mem, p, callee, 0);
- mem = new_r_Proj(irg, block, st, mode_M, pn_Store_M);
- p = new_r_Add(irg, block, p, new_Const_long(mode_Iu, 4), mode);
+ st = new_r_Store(block, mem, p, new_Const_long(mode_Bu, 0xe9), 0);
+ mem = new_r_Proj(block, st, mode_M, pn_Store_M);
+ p = new_r_Add(block, p, new_Const_long(mode_Iu, 1), mode);
+ st = new_r_Store(block, mem, p, callee, 0);
+ mem = new_r_Proj(block, st, mode_M, pn_Store_M);
+ p = new_r_Add(block, p, new_Const_long(mode_Iu, 4), mode);
return mem;
}
sched_add_before(irn, adc);
set_irn_mode(adc, mode_T);
- adc_flags = new_r_Proj(irg, block, adc, mode_Iu, pn_ia32_Adc_flags);
+ adc_flags = new_r_Proj(block, adc, mode_Iu, pn_ia32_Adc_flags);
arch_set_irn_register(adc_flags, &ia32_flags_regs[REG_EFLAGS]);
cmc = new_bd_ia32_Cmc(dbg, block, adc_flags);
* (the register can't be live since the operation will override it
* anyway) */
if (uses_out_reg == NULL) {
- ir_node *copy = be_new_Copy(cls, irg, block, in_node);
+ ir_node *copy = be_new_Copy(cls, block, in_node);
DBG_OPT_2ADDRCPY(copy);
/* destination is the out register */
* after! the operation as we will override the register. */
in[0] = in_node;
in[1] = uses_out_reg;
- perm = be_new_Perm(cls, irg, block, 2, in);
+ perm = be_new_Perm(cls, block, 2, in);
- perm_proj0 = new_r_Proj(irg, block, perm, get_irn_mode(in[0]), 0);
- perm_proj1 = new_r_Proj(irg, block, perm, get_irn_mode(in[1]), 1);
+ perm_proj0 = new_r_Proj(block, perm, get_irn_mode(in[0]), 0);
+ perm_proj1 = new_r_Proj(block, perm, get_irn_mode(in[1]), 1);
arch_set_irn_register(perm_proj0, out_reg);
arch_set_irn_register(perm_proj1, in_reg);
set_ia32_use_frame(load);
sched_add_before(before, load);
- load_res = new_r_Proj(irg, block, load, mode_Iu, pn_ia32_Load_res);
+ load_res = new_r_Proj(block, load, mode_Iu, pn_ia32_Load_res);
/* TODO: make the actual mode configurable in ChangeCW... */
or_const = new_bd_ia32_Immediate(NULL, get_irg_start_block(irg),
*/
old_cse = get_opt_cse();
set_opt_cse(0);
- jmp = new_r_Jmp(irg, block);
+ jmp = new_r_Jmp(block);
set_opt_cse(old_cse);
edges_reroute(proj, jmp, irg);
break;
else {
in[0] = l_res;
in[1] = h_res;
- res = new_r_Tuple(irg, block, 2, in);
+ res = new_r_Tuple(block, 2, in);
}
turn_into_tuple(call, pn_Call_max);
*/
old_cse = get_opt_cse();
set_opt_cse(0);
- jmp = new_r_Jmp(irg, block);
+ jmp = new_r_Jmp(block);
set_opt_cse(old_cse);
set_Tuple_pred(call, pn_Call_X_regular, jmp);
* Map an Add (a_l, a_h, b_l, b_h)
*/
static int map_Add(ir_node *call, void *ctx) {
- ir_graph *irg = current_ir_graph;
dbg_info *dbg = get_irn_dbg_info(call);
ir_node *block = get_nodes_block(call);
ir_node **params = get_Call_param_arr(call);
/* h_res = a_h + b_h + carry */
add_low = new_bd_ia32_l_Add(dbg, block, a_l, b_l, mode_T);
- flags = new_r_Proj(irg, block, add_low, mode_flags, pn_ia32_flags);
+ flags = new_r_Proj(block, add_low, mode_flags, pn_ia32_flags);
add_high = new_bd_ia32_l_Adc(dbg, block, a_h, b_h, flags, h_mode);
- l_res = new_r_Proj(irg, block, add_low, l_mode, pn_ia32_res);
+ l_res = new_r_Proj(block, add_low, l_mode, pn_ia32_res);
h_res = add_high;
- resolve_call(call, l_res, h_res, irg, block);
+ resolve_call(call, l_res, h_res, current_ir_graph, block);
return 1;
}
*/
static int map_Sub(ir_node *call, void *ctx)
{
- ir_graph *irg = current_ir_graph;
dbg_info *dbg = get_irn_dbg_info(call);
ir_node *block = get_nodes_block(call);
ir_node **params = get_Call_param_arr(call);
/* h_res = a_h - b_h - carry */
sub_low = new_bd_ia32_l_Sub(dbg, block, a_l, b_l, mode_T);
- flags = new_r_Proj(irg, block, sub_low, mode_flags, pn_ia32_flags);
+ flags = new_r_Proj(block, sub_low, mode_flags, pn_ia32_flags);
sub_high = new_bd_ia32_l_Sbb(dbg, block, a_h, b_h, flags, h_mode);
- l_res = new_r_Proj(irg, block, sub_low, l_mode, pn_ia32_res);
+ l_res = new_r_Proj( block, sub_low, l_mode, pn_ia32_res);
h_res = sub_high;
- resolve_call(call, l_res, h_res, irg, block);
+ resolve_call(call, l_res, h_res, current_ir_graph, block);
return 1;
}
if (tarval_cmp(tv, new_tarval_from_long(32, l_mode)) & (pn_Cmp_Gt|pn_Cmp_Eq)) {
/* simplest case: shift only the lower bits. Note that there is no
need to reduce the constant here, this is done by the hardware. */
- ir_node *conv = new_rd_Conv(dbg, irg, block, a_l, h_mode);
- h_res = new_rd_Shl(dbg, irg, block, conv, cnt, h_mode);
+ ir_node *conv = new_rd_Conv(dbg, block, a_l, h_mode);
+ h_res = new_rd_Shl(dbg, block, conv, cnt, h_mode);
l_res = new_rd_Const(dbg, irg, get_mode_null(l_mode));
} else {
c_mode = get_irn_mode(cnt);
irn = new_r_Const_long(irg, c_mode, 32);
- irn = new_rd_And(dbg, irg, upper, cnt, irn, c_mode);
- irn = new_rd_Cmp(dbg, irg, upper, irn, new_r_Const(irg, get_mode_null(c_mode)));
- irn = new_r_Proj(irg, upper, irn, mode_b, pn_Cmp_Eq);
- cond = new_rd_Cond(dbg, irg, upper, irn);
+ irn = new_rd_And(dbg, upper, cnt, irn, c_mode);
+ irn = new_rd_Cmp(dbg, upper, irn, new_r_Const(irg, get_mode_null(c_mode)));
+ irn = new_r_Proj(upper, irn, mode_b, pn_Cmp_Eq);
+ cond = new_rd_Cond(dbg, upper, irn);
- in[0] = new_r_Proj(irg, upper, cond, mode_X, pn_Cond_true);
- in[1] = new_r_Proj(irg, upper, cond, mode_X, pn_Cond_false);
+ in[0] = new_r_Proj(upper, cond, mode_X, pn_Cond_true);
+ in[1] = new_r_Proj(upper, cond, mode_X, pn_Cond_false);
/* the block for cnt >= 32 */
n_block = new_rd_Block(dbg, irg, 1, &in[1]);
- h2 = new_rd_Conv(dbg, irg, n_block, l1, h_mode);
+ h2 = new_rd_Conv(dbg, n_block, l1, h_mode);
l2 = new_r_Const(irg, get_mode_null(l_mode));
- in[1] = new_r_Jmp(irg, n_block);
+ in[1] = new_r_Jmp(n_block);
set_irn_in(block, 2, in);
in[0] = l1;
in[1] = l2;
- l_res = new_r_Phi(irg, block, 2, in, l_mode);
+ l_res = new_r_Phi(block, 2, in, l_mode);
set_Block_phis(block, l_res);
in[0] = h1;
in[1] = h2;
- h_res = new_r_Phi(irg, block, 2, in, h_mode);
+ h_res = new_r_Phi(block, 2, in, h_mode);
set_Phi_next(l_res, h_res);
set_Phi_next(h_res, NULL);
if (tarval_cmp(tv, new_tarval_from_long(32, l_mode)) & (pn_Cmp_Gt|pn_Cmp_Eq)) {
/* simplest case: shift only the higher bits. Note that there is no
need to reduce the constant here, this is done by the hardware. */
- ir_node *conv = new_rd_Conv(dbg, irg, block, a_h, l_mode);
+ ir_node *conv = new_rd_Conv(dbg, block, a_h, l_mode);
h_res = new_rd_Const(dbg, irg, get_mode_null(h_mode));
- l_res = new_rd_Shr(dbg, irg, block, conv, cnt, l_mode);
+ l_res = new_rd_Shr(dbg, block, conv, cnt, l_mode);
} else {
/* l_res = SHRD a_h:a_l, cnt */
l_res = new_bd_ia32_l_ShrD(dbg, block, a_l, a_h, cnt, l_mode);
c_mode = get_irn_mode(cnt);
irn = new_r_Const_long(irg, c_mode, 32);
- irn = new_rd_And(dbg, irg, upper, cnt, irn, c_mode);
- irn = new_rd_Cmp(dbg, irg, upper, irn, new_r_Const(irg, get_mode_null(c_mode)));
- irn = new_r_Proj(irg, upper, irn, mode_b, pn_Cmp_Eq);
- cond = new_rd_Cond(dbg, irg, upper, irn);
+ irn = new_rd_And(dbg, upper, cnt, irn, c_mode);
+ irn = new_rd_Cmp(dbg, upper, irn, new_r_Const(irg, get_mode_null(c_mode)));
+ irn = new_r_Proj(upper, irn, mode_b, pn_Cmp_Eq);
+ cond = new_rd_Cond(dbg, upper, irn);
- in[0] = new_r_Proj(irg, upper, cond, mode_X, pn_Cond_true);
- in[1] = new_r_Proj(irg, upper, cond, mode_X, pn_Cond_false);
+ in[0] = new_r_Proj(upper, cond, mode_X, pn_Cond_true);
+ in[1] = new_r_Proj(upper, cond, mode_X, pn_Cond_false);
/* the block for cnt >= 32 */
n_block = new_rd_Block(dbg, irg, 1, &in[1]);
- l2 = new_rd_Conv(dbg, irg, n_block, h1, l_mode);
+ l2 = new_rd_Conv(dbg, n_block, h1, l_mode);
h2 = new_r_Const(irg, get_mode_null(h_mode));
- in[1] = new_r_Jmp(irg, n_block);
+ in[1] = new_r_Jmp(n_block);
set_irn_in(block, 2, in);
in[0] = l1;
in[1] = l2;
- l_res = new_r_Phi(irg, block, 2, in, l_mode);
+ l_res = new_r_Phi(block, 2, in, l_mode);
set_Block_phis(block, l_res);
in[0] = h1;
in[1] = h2;
- h_res = new_r_Phi(irg, block, 2, in, h_mode);
+ h_res = new_r_Phi(block, 2, in, h_mode);
set_Phi_next(l_res, h_res);
set_Phi_next(h_res, NULL);
if (tarval_cmp(tv, new_tarval_from_long(32, l_mode)) & (pn_Cmp_Gt|pn_Cmp_Eq)) {
/* simplest case: shift only the higher bits. Note that there is no
need to reduce the constant here, this is done by the hardware. */
- ir_node *conv = new_rd_Conv(dbg, irg, block, a_h, l_mode);
+ ir_node *conv = new_rd_Conv(dbg, block, a_h, l_mode);
ir_mode *c_mode = get_irn_mode(cnt);
- h_res = new_rd_Shrs(dbg, irg, block, a_h, new_r_Const_long(irg, c_mode, 31), h_mode);
- l_res = new_rd_Shrs(dbg, irg, block, conv, cnt, l_mode);
+ h_res = new_rd_Shrs(dbg, block, a_h, new_r_Const_long(irg, c_mode, 31), h_mode);
+ l_res = new_rd_Shrs(dbg, block, conv, cnt, l_mode);
} else {
/* l_res = SHRD a_h:a_l, cnt */
l_res = new_bd_ia32_l_ShrD(dbg, block, a_l, a_h, cnt, l_mode);
c_mode = get_irn_mode(cnt);
irn = new_r_Const_long(irg, c_mode, 32);
- irn = new_rd_And(dbg, irg, upper, cnt, irn, c_mode);
- irn = new_rd_Cmp(dbg, irg, upper, irn, new_r_Const(irg, get_mode_null(c_mode)));
- irn = new_r_Proj(irg, upper, irn, mode_b, pn_Cmp_Eq);
- cond = new_rd_Cond(dbg, irg, upper, irn);
+ irn = new_rd_And(dbg, upper, cnt, irn, c_mode);
+ irn = new_rd_Cmp(dbg, upper, irn, new_r_Const(irg, get_mode_null(c_mode)));
+ irn = new_r_Proj(upper, irn, mode_b, pn_Cmp_Eq);
+ cond = new_rd_Cond(dbg, upper, irn);
- in[0] = new_r_Proj(irg, upper, cond, mode_X, pn_Cond_true);
- in[1] = new_r_Proj(irg, upper, cond, mode_X, pn_Cond_false);
+ in[0] = new_r_Proj(upper, cond, mode_X, pn_Cond_true);
+ in[1] = new_r_Proj(upper, cond, mode_X, pn_Cond_false);
/* the block for cnt >= 32 */
n_block = new_rd_Block(dbg, irg, 1, &in[1]);
- l2 = new_rd_Conv(dbg, irg, n_block, h1, l_mode);
- h2 = new_rd_Shrs(dbg, irg, n_block, a_h, new_r_Const_long(irg, c_mode, 31), h_mode);
- in[1] = new_r_Jmp(irg, n_block);
+ l2 = new_rd_Conv(dbg, n_block, h1, l_mode);
+ h2 = new_rd_Shrs(dbg, n_block, a_h, new_r_Const_long(irg, c_mode, 31), h_mode);
+ in[1] = new_r_Jmp(n_block);
set_irn_in(block, 2, in);
in[0] = l1;
in[1] = l2;
- l_res = new_r_Phi(irg, block, 2, in, l_mode);
+ l_res = new_r_Phi(block, 2, in, l_mode);
set_Block_phis(block, l_res);
in[0] = h1;
in[1] = h2;
- h_res = new_r_Phi(irg, block, 2, in, h_mode);
+ h_res = new_r_Phi(block, 2, in, h_mode);
set_Phi_next(l_res, h_res);
set_Phi_next(h_res, NULL);
* Map a Mul (a_l, a_h, b_l, b_h)
*/
static int map_Mul(ir_node *call, void *ctx) {
- ir_graph *irg = current_ir_graph;
dbg_info *dbg = get_irn_dbg_info(call);
ir_node *block = get_nodes_block(call);
ir_node **params = get_Call_param_arr(call);
/* handle the often used case of 32x32=64 mul */
if (is_sign_extend(a_l, a_h) && is_sign_extend(b_l, b_h)) {
mul = new_bd_ia32_l_IMul(dbg, block, a_l, b_l);
- h_res = new_rd_Proj(dbg, irg, block, mul, h_mode, pn_ia32_l_Mul_EDX);
- l_res = new_rd_Proj(dbg, irg, block, mul, l_mode, pn_ia32_l_Mul_EAX);
+ h_res = new_rd_Proj(dbg, block, mul, h_mode, pn_ia32_l_Mul_EDX);
+ l_res = new_rd_Proj(dbg, block, mul, l_mode, pn_ia32_l_Mul_EAX);
} else {
/* note that zero extension is handled hare efficiently */
mul = new_bd_ia32_l_Mul(dbg, block, a_l, b_l);
- pEDX = new_rd_Proj(dbg, irg, block, mul, h_mode, pn_ia32_l_Mul_EDX);
- l_res = new_rd_Proj(dbg, irg, block, mul, l_mode, pn_ia32_l_Mul_EAX);
-
- b_l = new_rd_Conv(dbg, irg, block, b_l, h_mode);
- mul = new_rd_Mul( dbg, irg, block, a_h, b_l, h_mode);
- add = new_rd_Add( dbg, irg, block, mul, pEDX, h_mode);
- a_l = new_rd_Conv(dbg, irg, block, a_l, h_mode);
- mul = new_rd_Mul( dbg, irg, block, a_l, b_h, h_mode);
- h_res = new_rd_Add( dbg, irg, block, add, mul, h_mode);
+ pEDX = new_rd_Proj(dbg, block, mul, h_mode, pn_ia32_l_Mul_EDX);
+ l_res = new_rd_Proj(dbg, block, mul, l_mode, pn_ia32_l_Mul_EAX);
+
+ b_l = new_rd_Conv(dbg, block, b_l, h_mode);
+ mul = new_rd_Mul( dbg, block, a_h, b_l, h_mode);
+ add = new_rd_Add( dbg, block, mul, pEDX, h_mode);
+ a_l = new_rd_Conv(dbg, block, a_l, h_mode);
+ mul = new_rd_Mul( dbg, block, a_l, b_h, h_mode);
+ h_res = new_rd_Add( dbg, block, add, mul, h_mode);
}
- resolve_call(call, l_res, h_res, irg, block);
+ resolve_call(call, l_res, h_res, current_ir_graph, block);
return 1;
}
* Map a Minus (a_l, a_h)
*/
static int map_Minus(ir_node *call, void *ctx) {
- ir_graph *irg = current_ir_graph;
dbg_info *dbg = get_irn_dbg_info(call);
ir_node *block = get_nodes_block(call);
ir_node **params = get_Call_param_arr(call);
(void) ctx;
res = new_bd_ia32_Minus64Bit(dbg, block, a_l, a_h);
- l_res = new_r_Proj(irg, block, res, l_mode, pn_ia32_Minus64Bit_low_res);
- h_res = new_r_Proj(irg, block, res, h_mode, pn_ia32_Minus64Bit_high_res);
+ l_res = new_r_Proj(block, res, l_mode, pn_ia32_Minus64Bit_low_res);
+ h_res = new_r_Proj(block, res, h_mode, pn_ia32_Minus64Bit_high_res);
- resolve_call(call, l_res, h_res, irg, block);
+ resolve_call(call, l_res, h_res, current_ir_graph, block);
return 1;
}
* Map a Abs (a_l, a_h)
*/
static int map_Abs(ir_node *call, void *ctx) {
- ir_graph *irg = current_ir_graph;
dbg_info *dbg = get_irn_dbg_info(call);
ir_node *block = get_nodes_block(call);
ir_node **params = get_Call_param_arr(call);
*/
/* TODO: give a hint to the backend somehow to not create a cltd here... */
- sign = new_rd_Shrs(dbg, irg, block, a_h, new_Const_long(l_mode, 31), h_mode);
- sign_l = new_rd_Conv(dbg, irg, block, sign, l_mode);
- sub_l = new_rd_Eor(dbg, irg, block, a_l, sign_l, l_mode);
- sub_h = new_rd_Eor(dbg, irg, block, a_h, sign, h_mode);
+ sign = new_rd_Shrs(dbg, block, a_h, new_Const_long(l_mode, 31), h_mode);
+ sign_l = new_rd_Conv(dbg, block, sign, l_mode);
+ sub_l = new_rd_Eor(dbg, block, a_l, sign_l, l_mode);
+ sub_h = new_rd_Eor(dbg, block, a_h, sign, h_mode);
l_sub = new_bd_ia32_l_Sub(dbg, block, sub_l, sign_l, mode_T);
- l_res = new_r_Proj(irg, block, l_sub, l_mode, pn_ia32_res);
- flags = new_r_Proj(irg, block, l_sub, mode_flags, pn_ia32_flags);
+ l_res = new_r_Proj(block, l_sub, l_mode, pn_ia32_res);
+ flags = new_r_Proj(block, l_sub, mode_flags, pn_ia32_flags);
h_res = new_bd_ia32_l_Sbb(dbg, block, sub_h, sign, flags, h_mode);
- resolve_call(call, l_res, h_res, irg, block);
+ resolve_call(call, l_res, h_res, current_ir_graph, block);
return 1;
}
/* convert from float to signed 64bit */
float_to_ll = new_bd_ia32_l_FloattoLL(dbg, block, a_f);
- l_res = new_r_Proj(irg, block, float_to_ll, l_res_mode,
+ l_res = new_r_Proj(block, float_to_ll, l_res_mode,
pn_ia32_l_FloattoLL_res_low);
- h_res = new_r_Proj(irg, block, float_to_ll, h_res_mode,
+ h_res = new_r_Proj(block, float_to_ll, h_res_mode,
pn_ia32_l_FloattoLL_res_high);
} else {
/* convert from float to signed 64bit */
part_block(call);
upper_blk = get_nodes_block(call);
- cmp = new_rd_Cmp(dbg, irg, upper_blk, a_f, flt_corr);
- proj = new_r_Proj(irg, upper_blk, cmp, mode_b, pn_Cmp_Lt);
- cond = new_rd_Cond(dbg, irg, upper_blk, proj);
- in[0] = new_r_Proj(irg, upper_blk, cond, mode_X, pn_Cond_true);
- in[1] = new_r_Proj(irg, upper_blk, cond, mode_X, pn_Cond_false);
+ cmp = new_rd_Cmp(dbg, upper_blk, a_f, flt_corr);
+ proj = new_r_Proj(upper_blk, cmp, mode_b, pn_Cmp_Lt);
+ cond = new_rd_Cond(dbg, upper_blk, proj);
+ in[0] = new_r_Proj(upper_blk, cond, mode_X, pn_Cond_true);
+ in[1] = new_r_Proj(upper_blk, cond, mode_X, pn_Cond_false);
blk = new_r_Block(irg, 1, &in[1]);
- in[1] = new_r_Jmp(irg, blk);
+ in[1] = new_r_Jmp(blk);
set_irn_in(lower_blk, 2, in);
in[0] = new_Const(get_mode_null(h_res_mode));
in[1] = new_Const_long(h_res_mode, 0x80000000);
- int_phi = new_r_Phi(irg, lower_blk, 2, in, h_res_mode);
+ int_phi = new_r_Phi(lower_blk, 2, in, h_res_mode);
in[0] = a_f;
- in[1] = new_rd_Sub(dbg, irg, upper_blk, a_f, flt_corr, flt_mode);
+ in[1] = new_rd_Sub(dbg, upper_blk, a_f, flt_corr, flt_mode);
- flt_phi = new_r_Phi(irg, lower_blk, 2, in, flt_mode);
+ flt_phi = new_r_Phi(lower_blk, 2, in, flt_mode);
/* fix Phi links for next part_block() */
set_Block_phis(lower_blk, int_phi);
float_to_ll = new_bd_ia32_l_FloattoLL(dbg, lower_blk, flt_phi);
- l_res = new_r_Proj(irg, lower_blk, float_to_ll, l_res_mode,
+ l_res = new_r_Proj(lower_blk, float_to_ll, l_res_mode,
pn_ia32_l_FloattoLL_res_low);
- h_res = new_r_Proj(irg, lower_blk, float_to_ll, h_res_mode,
+ h_res = new_r_Proj(lower_blk, float_to_ll, h_res_mode,
pn_ia32_l_FloattoLL_res_high);
- h_res = new_rd_Add(dbg, irg, lower_blk, h_res, int_phi, h_res_mode);
+ h_res = new_rd_Add(dbg, lower_blk, h_res, int_phi, h_res_mode);
/* move the call and its Proj's to the lower block */
set_nodes_block(call, lower_blk);
/* If there are other users, reroute them to result proj */
if (get_irn_n_edges(left) != 2) {
- ir_node *res = new_r_Proj(current_ir_graph, block, left,
- mode_Iu, pn_ia32_res);
+ ir_node *res = new_r_Proj(block, left, mode_Iu, pn_ia32_res);
edges_reroute(left, res, current_ir_graph);
/* Reattach the result proj to left */
}
flags_mode = ia32_reg_classes[CLASS_ia32_flags].mode;
- flags_proj = new_r_Proj(current_ir_graph, block, left, flags_mode,
- pn_ia32_flags);
+ flags_proj = new_r_Proj(block, left, flags_mode, pn_ia32_flags);
arch_set_irn_register(flags_proj, &ia32_flags_regs[REG_EFLAGS]);
assert(get_irn_mode(node) != mode_T);
sched_add_after(skip_Proj(curr_sp), push);
/* create stackpointer Proj */
- curr_sp = new_r_Proj(irg, block, push, spmode, pn_ia32_Push_stack);
+ curr_sp = new_r_Proj(block, push, spmode, pn_ia32_Push_stack);
arch_set_irn_register(curr_sp, spreg);
/* create memory Proj */
- mem_proj = new_r_Proj(irg, block, push, mode_M, pn_ia32_Push_M);
+ mem_proj = new_r_Proj(block, push, mode_M, pn_ia32_Push_M);
/* use the memproj now */
be_peephole_exchange(store, mem_proj);
block = get_nodes_block(irn);
irg = cg->irg;
if (inc_ofs > 0) {
- pred_sp = be_new_IncSP(esp, irg, block, pred_sp, -inc_ofs, be_get_IncSP_align(irn));
+ pred_sp = be_new_IncSP(esp, block, pred_sp, -inc_ofs, be_get_IncSP_align(irn));
sched_add_before(irn, pred_sp);
}
copy_mark(load, pop);
/* create stackpointer Proj */
- pred_sp = new_r_Proj(irg, block, pop, mode_Iu, pn_ia32_Pop_stack);
+ pred_sp = new_r_Proj(block, pop, mode_Iu, pn_ia32_Pop_stack);
arch_set_irn_register(pred_sp, esp);
sched_add_before(irn, pop);
* Creates a Pop instruction before the given schedule point.
*
* @param dbgi debug info
- * @param irg the graph
* @param block the block
* @param stack the previous stack value
* @param schedpoint the new node is added before this node
*
* @return the new stack value
*/
-static ir_node *create_pop(dbg_info *dbgi, ir_graph *irg, ir_node *block,
+static ir_node *create_pop(dbg_info *dbgi, ir_node *block,
ir_node *stack, ir_node *schedpoint,
const arch_register_t *reg)
{
pop = new_bd_ia32_Pop(dbgi, block, new_NoMem(), stack);
- stack = new_r_Proj(irg, block, pop, mode_Iu, pn_ia32_Pop_stack);
+ stack = new_r_Proj(block, pop, mode_Iu, pn_ia32_Pop_stack);
arch_set_irn_register(stack, esp);
- val = new_r_Proj(irg, block, pop, mode_Iu, pn_ia32_Pop_res);
+ val = new_r_Proj(block, pop, mode_Iu, pn_ia32_Pop_res);
arch_set_irn_register(val, reg);
sched_add_before(schedpoint, pop);
in[0] = val;
- keep = be_new_Keep(&ia32_reg_classes[CLASS_ia32_gp], irg, block, 1, in);
+ keep = be_new_Keep(&ia32_reg_classes[CLASS_ia32_gp], block, 1, in);
sched_add_before(schedpoint, keep);
return stack;
* Creates a Push instruction before the given schedule point.
*
* @param dbgi debug info
- * @param irg the graph
* @param block the block
* @param stack the previous stack value
* @param schedpoint the new node is added before this node
*
* @return the new stack value
*/
-static ir_node *create_push(dbg_info *dbgi, ir_graph *irg, ir_node *block,
+static ir_node *create_push(dbg_info *dbgi, ir_node *block,
ir_node *stack, ir_node *schedpoint)
{
const arch_register_t *esp = &ia32_gp_regs[REG_ESP];
ir_node *val = ia32_new_Unknown_gp(cg);
ir_node *noreg = ia32_new_NoReg_gp(cg);
- ir_node *nomem = get_irg_no_mem(irg);
+ ir_node *nomem = new_NoMem();
ir_node *push = new_bd_ia32_Push(dbgi, block, noreg, noreg, nomem, val, stack);
sched_add_before(schedpoint, push);
- stack = new_r_Proj(irg, block, push, mode_Iu, pn_ia32_Push_stack);
+ stack = new_r_Proj(block, push, mode_Iu, pn_ia32_Push_stack);
arch_set_irn_register(stack, esp);
return stack;
{
const arch_register_t *esp = &ia32_gp_regs[REG_ESP];
const arch_register_t *reg;
- ir_graph *irg = current_ir_graph;
dbg_info *dbgi;
ir_node *block;
ir_node *stack;
block = get_nodes_block(node);
stack = be_get_IncSP_pred(node);
- stack = create_pop(dbgi, irg, block, stack, node, reg);
+ stack = create_pop(dbgi, block, stack, node, reg);
if (offset == -8) {
- stack = create_pop(dbgi, irg, block, stack, node, reg);
+ stack = create_pop(dbgi, block, stack, node, reg);
}
} else {
dbgi = get_irn_dbg_info(node);
block = get_nodes_block(node);
stack = be_get_IncSP_pred(node);
- stack = create_push(dbgi, irg, block, stack, node);
+ stack = create_push(dbgi, block, stack, node);
if (offset == +8) {
- stack = create_push(dbgi, irg, block, stack, node);
+ stack = create_push(dbgi, block, stack, node);
}
}
set_ia32_op_type(load, ia32_AddrModeS);
set_ia32_am_sc(load, floatent);
arch_irn_add_flags(load, arch_irn_flags_rematerializable);
- res = new_r_Proj(current_ir_graph, block, load, mode_xmm, pn_ia32_xLoad_res);
+ res = new_r_Proj(block, load, mode_xmm, pn_ia32_xLoad_res);
}
} else {
if (is_Const_null(node)) {
set_ia32_op_type(load, ia32_AddrModeS);
set_ia32_am_sc(load, floatent);
arch_irn_add_flags(load, arch_irn_flags_rematerializable);
- res = new_r_Proj(current_ir_graph, block, load, mode_vfp, pn_ia32_vfld_res);
+ res = new_r_Proj(block, load, mode_vfp, pn_ia32_vfld_res);
}
}
#ifdef CONSTRUCT_SSE_CONST
if (mode != mode_T) {
set_irn_mode(node, mode_T);
- return new_rd_Proj(NULL, current_ir_graph, get_nodes_block(node), node, mode, pn_ia32_res);
+ return new_rd_Proj(NULL, get_nodes_block(node), node, mode, pn_ia32_res);
} else {
return node;
}
if (mode_is_signed(mode)) {
new_node = gen_binop(node, op1, op2, new_bd_ia32_IMul1OP, match_commutative | match_am);
- proj_res_high = new_rd_Proj(dbgi, current_ir_graph, new_block, new_node,
- mode_Iu, pn_ia32_IMul1OP_res_high);
+ proj_res_high = new_rd_Proj(dbgi, new_block, new_node, mode_Iu, pn_ia32_IMul1OP_res_high);
} else {
new_node = gen_binop(node, op1, op2, new_bd_ia32_Mul, match_commutative | match_am);
- proj_res_high = new_rd_Proj(dbgi, current_ir_graph, new_block, new_node,
- mode_Iu, pn_ia32_Mul_res_high);
+ proj_res_high = new_rd_Proj(dbgi, new_block, new_node, mode_Iu, pn_ia32_Mul_res_high);
}
return proj_res_high;
}
| match_am | match_immediate);
}
-static ir_node *transform_AM_mem(ir_graph *const irg, ir_node *const block,
+static ir_node *transform_AM_mem(ir_node *const block,
ir_node *const src_val,
ir_node *const src_mem,
ir_node *const am_mem)
ins[n++] = am_mem;
- return new_r_Sync(irg, block, n, ins);
+ return new_r_Sync(block, n, ins);
} else {
ir_node *ins[2];
ins[0] = be_transform_node(src_mem);
ins[1] = am_mem;
- return new_r_Sync(irg, block, 2, ins);
+ return new_r_Sync(block, 2, ins);
}
}
/* Beware: We don't need a Sync, if the memory predecessor of the Div node
is the memory of the consumed address. We can have only the second op as address
in Div nodes, so check only op2. */
- new_mem = transform_AM_mem(current_ir_graph, block, op2, mem, addr->mem);
+ new_mem = transform_AM_mem(block, op2, mem, addr->mem);
if (mode_is_signed(mode)) {
sign_extension = create_sex_32_64(dbgi, new_block, am.new_op1, node);
dbgi = get_irn_dbg_info(node);
block = be_transform_node(src_block);
- new_mem = transform_AM_mem(current_ir_graph, block, am.am_node, mem, addr->mem);
+ new_mem = transform_AM_mem(block, am.am_node, mem, addr->mem);
if (get_mode_size_bits(mode) == 8) {
new_node = func8bit(dbgi, block, addr->base, addr->index, new_mem, new_op);
dbgi = get_irn_dbg_info(node);
block = be_transform_node(src_block);
- new_mem = transform_AM_mem(current_ir_graph, block, am.am_node, mem, addr->mem);
+ new_mem = transform_AM_mem(block, am.am_node, mem, addr->mem);
new_node = func(dbgi, block, addr->base, addr->index, new_mem);
set_address(new_node, addr);
set_ia32_op_type(new_node, ia32_AddrModeD);
} while (size != 0);
if (i > 1) {
- return new_rd_Sync(dbgi, current_ir_graph, new_block, i, ins);
+ return new_rd_Sync(dbgi, new_block, i, ins);
} else {
return ins[0];
}
/**
* Generate a vfist or vfisttp instruction.
*/
-static ir_node *gen_vfist(dbg_info *dbgi, ir_graph *irg, ir_node *block, ir_node *base, ir_node *index,
+static ir_node *gen_vfist(dbg_info *dbgi, ir_node *block, ir_node *base, ir_node *index,
ir_node *mem, ir_node *val, ir_node **fist)
{
ir_node *new_node;
if other users exists */
const arch_register_class_t *reg_class = &ia32_reg_classes[CLASS_ia32_vfp];
ir_node *vfisttp = new_bd_ia32_vfisttp(dbgi, block, base, index, mem, val);
- ir_node *value = new_r_Proj(irg, block, vfisttp, mode_E, pn_ia32_vfisttp_res);
- be_new_Keep(reg_class, irg, block, 1, &value);
+ ir_node *value = new_r_Proj(block, vfisttp, mode_E, pn_ia32_vfisttp_res);
+ be_new_Keep(reg_class, block, 1, &value);
- new_node = new_r_Proj(irg, block, vfisttp, mode_M, pn_ia32_vfisttp_M);
+ new_node = new_r_Proj(block, vfisttp, mode_M, pn_ia32_vfisttp_M);
*fist = vfisttp;
} else {
ir_node *trunc_mode = ia32_new_Fpu_truncate(env_cg);
val = op;
}
new_val = be_transform_node(val);
- new_node = gen_vfist(dbgi, current_ir_graph, new_block, addr.base, addr.index, addr.mem, new_val, &store);
+ new_node = gen_vfist(dbgi, new_block, addr.base, addr.index, addr.mem, new_val, &store);
} else {
new_val = create_immediate_or_transform(val, 0);
assert(mode != mode_b);
*/
static ir_node *create_Doz(ir_node *psi, ir_node *a, ir_node *b)
{
- ir_graph *irg = current_ir_graph;
ir_mode *mode = get_irn_mode(psi);
ir_node *new_node, *sub, *sbb, *eflags, *block;
} else {
sub = new_node;
set_irn_mode(sub, mode_T);
- new_node = new_rd_Proj(NULL, irg, block, sub, mode, pn_ia32_res);
+ new_node = new_rd_Proj(NULL, block, sub, mode, pn_ia32_res);
}
- eflags = new_rd_Proj(NULL, irg, block, sub, mode_Iu, pn_ia32_Sub_flags);
+ eflags = new_rd_Proj(NULL, block, sub, mode_Iu, pn_ia32_Sub_flags);
dbgi = get_irn_dbg_info(psi);
sbb = new_bd_ia32_Sbb0(dbgi, block, eflags);
load = new_bd_ia32_vfld(dbgi, block, am.addr.base, am.addr.index, am.addr.mem, new_mode);
set_am_attributes(load, &am);
- return new_rd_Proj(NULL, current_ir_graph, block, load, mode_vfp, pn_ia32_res);
+ return new_rd_Proj(NULL, block, load, mode_vfp, pn_ia32_res);
}
panic("cannot transform floating point Mux");
ir_mode *mode = get_irn_mode(node);
ir_node *fist, *load, *mem;
- mem = gen_vfist(dbgi, irg, block, get_irg_frame(irg), noreg_GP, nomem, new_op, &fist);
+ mem = gen_vfist(dbgi, block, get_irg_frame(irg), noreg_GP, nomem, new_op, &fist);
set_irn_pinned(fist, op_pin_state_floats);
set_ia32_use_frame(fist);
set_ia32_op_type(fist, ia32_AddrModeD);
}
SET_IA32_ORIG_NODE(load, node);
- return new_r_Proj(irg, block, load, mode_Iu, pn_ia32_Load_res);
+ return new_r_Proj(block, load, mode_Iu, pn_ia32_Load_res);
}
/**
static ir_node *gen_x87_strict_conv(ir_mode *tgt_mode, ir_node *node)
{
ir_node *block = get_nodes_block(node);
- ir_graph *irg = current_ir_graph;
+ ir_graph *irg = get_Block_irg(block);
dbg_info *dbgi = get_irn_dbg_info(node);
ir_node *frame = get_irg_frame(irg);
ir_node *store, *load;
set_ia32_op_type(load, ia32_AddrModeS);
SET_IA32_ORIG_NODE(load, node);
- new_node = new_r_Proj(irg, block, load, mode_E, pn_ia32_vfld_res);
+ new_node = new_r_Proj(block, load, mode_E, pn_ia32_vfld_res);
return new_node;
}
{
ir_node *src_block = get_nodes_block(node);
ir_node *block = be_transform_node(src_block);
- ir_graph *irg = current_ir_graph;
+ ir_graph *irg = get_Block_irg(block);
dbg_info *dbgi = get_irn_dbg_info(node);
ir_node *op = get_Conv_op(node);
ir_node *new_op = NULL;
ia32_address_t *addr = &am.addr;
fild = new_bd_ia32_vfild(dbgi, block, addr->base, addr->index, addr->mem);
- new_node = new_r_Proj(irg, block, fild, mode_vfp, pn_ia32_vfild_res);
+ new_node = new_r_Proj(block, fild, mode_vfp, pn_ia32_vfild_res);
set_am_attributes(fild, &am);
SET_IA32_ORIG_NODE(fild, node);
in[0] = zero_store;
in[1] = store;
- store = new_rd_Sync(dbgi, irg, block, 2, in);
+ store = new_rd_Sync(dbgi, block, 2, in);
store_mode = mode_Ls;
} else {
store_mode = mode_Is;
set_ia32_op_type(fild, ia32_AddrModeS);
set_ia32_ls_mode(fild, store_mode);
- new_node = new_r_Proj(irg, block, fild, mode_vfp, pn_ia32_vfild_res);
+ new_node = new_r_Proj(block, fild, mode_vfp, pn_ia32_vfild_res);
return new_node;
}
set_ia32_op_type(fld, ia32_AddrModeS);
set_ia32_use_frame(fld);
- mproj = new_r_Proj(irg, block, fld, mode_M, pn_ia32_vfld_M);
- fld = new_r_Proj(irg, block, fld, mode_vfp, pn_ia32_vfld_res);
+ mproj = new_r_Proj(block, fld, mode_M, pn_ia32_vfld_M);
+ fld = new_r_Proj(block, fld, mode_vfp, pn_ia32_vfld_res);
/* create a new barrier */
arity = get_irn_arity(barrier);
if (! is_Proj(res)) {
sub = res;
set_irn_mode(sub, mode_T);
- res = new_rd_Proj(NULL, irg, block, sub, mode_Iu, pn_ia32_res);
+ res = new_rd_Proj(NULL, block, sub, mode_Iu, pn_ia32_res);
} else {
sub = get_Proj_pred(res);
}
- flags = new_rd_Proj(NULL, irg, block, sub, mode_Iu, pn_ia32_Sub_flags);
+ flags = new_rd_Proj(NULL, block, sub, mode_Iu, pn_ia32_Sub_flags);
new_node = new_bd_ia32_Jcc(dbgi, block, flags, pn_Cmp_Lt | ia32_pn_Cmp_unsigned);
SET_IA32_ORIG_NODE(new_node, node);
} else {
in[0] = store_low;
in[1] = store_high;
- sync = new_rd_Sync(dbgi, irg, block, 2, in);
+ sync = new_rd_Sync(dbgi, block, 2, in);
/* do a fild */
fild = new_bd_ia32_vfild(dbgi, block, frame, noreg_GP, sync);
SET_IA32_ORIG_NODE(fild, node);
- res = new_r_Proj(irg, block, fild, mode_vfp, pn_ia32_vfild_res);
+ res = new_r_Proj(block, fild, mode_vfp, pn_ia32_vfild_res);
if (! mode_is_signed(get_irn_mode(val_high))) {
ia32_address_mode_t am;
set_am_attributes(fadd, &am);
set_irn_mode(fadd, mode_T);
- res = new_rd_Proj(NULL, irg, block, fadd, mode_vfp, pn_ia32_res);
+ res = new_rd_Proj(NULL, block, fadd, mode_vfp, pn_ia32_res);
}
return res;
}
{
ir_node *src_block = get_nodes_block(node);
ir_node *block = be_transform_node(src_block);
- ir_graph *irg = current_ir_graph;
+ ir_graph *irg = get_Block_irg(block);
dbg_info *dbgi = get_irn_dbg_info(node);
ir_node *frame = get_irg_frame(irg);
ir_node *val = get_irn_n(node, n_ia32_l_FloattoLL_val);
ir_node *new_val = be_transform_node(val);
ir_node *fist, *mem;
- mem = gen_vfist(dbgi, irg, block, frame, noreg_GP, nomem, new_val, &fist);
+ mem = gen_vfist(dbgi, block, frame, noreg_GP, nomem, new_val, &fist);
SET_IA32_ORIG_NODE(fist, node);
set_ia32_use_frame(fist);
set_ia32_op_type(fist, ia32_AddrModeD);
static ir_node *gen_Proj_l_FloattoLL(ir_node *node)
{
- ir_graph *irg = current_ir_graph;
ir_node *block = be_transform_node(get_nodes_block(node));
+ ir_graph *irg = get_Block_irg(block);
ir_node *pred = get_Proj_pred(node);
ir_node *new_pred = be_transform_node(pred);
ir_node *frame = get_irg_frame(irg);
assert(pn == pn_ia32_l_FloattoLL_res_low);
}
- proj = new_r_Proj(irg, block, load, mode_Iu, pn_ia32_Load_res);
+ proj = new_r_Proj(block, load, mode_Iu, pn_ia32_Load_res);
return proj;
}
ir_node *block = be_transform_node(get_nodes_block(node));
ir_node *pred = get_Proj_pred(node);
ir_node *new_pred = be_transform_node(pred);
- ir_graph *irg = current_ir_graph;
dbg_info *dbgi = get_irn_dbg_info(node);
long proj = get_Proj_proj(node);
if (proj == pn_be_AddSP_sp) {
- ir_node *res = new_rd_Proj(dbgi, irg, block, new_pred, mode_Iu,
+ ir_node *res = new_rd_Proj(dbgi, block, new_pred, mode_Iu,
pn_ia32_SubSP_stack);
arch_set_irn_register(res, &ia32_gp_regs[REG_ESP]);
return res;
} else if (proj == pn_be_AddSP_res) {
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_Iu,
+ return new_rd_Proj(dbgi, block, new_pred, mode_Iu,
pn_ia32_SubSP_addr);
} else if (proj == pn_be_AddSP_M) {
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_M, pn_ia32_SubSP_M);
+ return new_rd_Proj(dbgi, block, new_pred, mode_M, pn_ia32_SubSP_M);
}
panic("No idea how to transform proj->AddSP");
long proj = get_Proj_proj(node);
if (proj == pn_be_SubSP_sp) {
- ir_node *res = new_rd_Proj(dbgi, irg, block, new_pred, mode_Iu,
+ ir_node *res = new_rd_Proj(dbgi, block, new_pred, mode_Iu,
pn_ia32_AddSP_stack);
arch_set_irn_register(res, &ia32_gp_regs[REG_ESP]);
return res;
} else if (proj == pn_be_SubSP_M) {
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_M, pn_ia32_AddSP_M);
+ return new_rd_Proj(dbgi, block, new_pred, mode_M, pn_ia32_AddSP_M);
}
panic("No idea how to transform proj->SubSP");
ir_node *new_pred;
ir_node *block = be_transform_node(get_nodes_block(node));
ir_node *pred = get_Proj_pred(node);
- ir_graph *irg = current_ir_graph;
dbg_info *dbgi = get_irn_dbg_info(node);
long proj = get_Proj_proj(node);
reachable through the ProjM */
be_enqueue_preds(node);
/* do it in 2 steps, to silence firm verifier */
- res = new_rd_Proj(dbgi, irg, old_block, pred, mode_M, pn_Load_M);
+ res = new_rd_Proj(dbgi, old_block, pred, mode_M, pn_Load_M);
set_Proj_proj(res, pn_ia32_mem);
return res;
}
if (is_ia32_Load(new_pred)) {
switch (proj) {
case pn_Load_res:
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_Iu, pn_ia32_Load_res);
+ return new_rd_Proj(dbgi, block, new_pred, mode_Iu, pn_ia32_Load_res);
case pn_Load_M:
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_M, pn_ia32_Load_M);
+ return new_rd_Proj(dbgi, block, new_pred, mode_M, pn_ia32_Load_M);
case pn_Load_X_regular:
- return new_rd_Jmp(dbgi, irg, block);
+ return new_rd_Jmp(dbgi, block);
case pn_Load_X_except:
/* This Load might raise an exception. Mark it. */
set_ia32_exc_label(new_pred, 1);
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_X, pn_ia32_Load_X_exc);
+ return new_rd_Proj(dbgi, block, new_pred, mode_X, pn_ia32_Load_X_exc);
default:
break;
}
is_ia32_Conv_I2I8Bit(new_pred)) {
set_irn_mode(new_pred, mode_T);
if (proj == pn_Load_res) {
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_Iu, pn_ia32_res);
+ return new_rd_Proj(dbgi, block, new_pred, mode_Iu, pn_ia32_res);
} else if (proj == pn_Load_M) {
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_M, pn_ia32_mem);
+ return new_rd_Proj(dbgi, block, new_pred, mode_M, pn_ia32_mem);
}
} else if (is_ia32_xLoad(new_pred)) {
switch (proj) {
case pn_Load_res:
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_xmm, pn_ia32_xLoad_res);
+ return new_rd_Proj(dbgi, block, new_pred, mode_xmm, pn_ia32_xLoad_res);
case pn_Load_M:
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_M, pn_ia32_xLoad_M);
+ return new_rd_Proj(dbgi, block, new_pred, mode_M, pn_ia32_xLoad_M);
case pn_Load_X_regular:
- return new_rd_Jmp(dbgi, irg, block);
+ return new_rd_Jmp(dbgi, block);
case pn_Load_X_except:
/* This Load might raise an exception. Mark it. */
set_ia32_exc_label(new_pred, 1);
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_X, pn_ia32_xLoad_X_exc);
+ return new_rd_Proj(dbgi, block, new_pred, mode_X, pn_ia32_xLoad_X_exc);
default:
break;
}
} else if (is_ia32_vfld(new_pred)) {
switch (proj) {
case pn_Load_res:
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_vfp, pn_ia32_vfld_res);
+ return new_rd_Proj(dbgi, block, new_pred, mode_vfp, pn_ia32_vfld_res);
case pn_Load_M:
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_M, pn_ia32_vfld_M);
+ return new_rd_Proj(dbgi, block, new_pred, mode_M, pn_ia32_vfld_M);
case pn_Load_X_regular:
- return new_rd_Jmp(dbgi, irg, block);
+ return new_rd_Jmp(dbgi, block);
case pn_Load_X_except:
/* This Load might raise an exception. Mark it. */
set_ia32_exc_label(new_pred, 1);
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_X, pn_ia32_xLoad_X_exc);
+ return new_rd_Proj(dbgi, block, new_pred, mode_X, pn_ia32_xLoad_X_exc);
default:
break;
}
if (proj != pn_Load_M) {
panic("internal error: transformed node not a Load");
}
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_M, 1);
+ return new_rd_Proj(dbgi, block, new_pred, mode_M, 1);
}
panic("No idea how to transform proj");
ir_node *block = be_transform_node(get_nodes_block(node));
ir_node *pred = get_Proj_pred(node);
ir_node *new_pred = be_transform_node(pred);
- ir_graph *irg = current_ir_graph;
dbg_info *dbgi = get_irn_dbg_info(node);
long proj = get_Proj_proj(node);
case iro_Div:
switch (proj) {
case pn_Div_M:
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_M, pn_ia32_Div_M);
+ return new_rd_Proj(dbgi, block, new_pred, mode_M, pn_ia32_Div_M);
case pn_Div_res:
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_Iu, pn_ia32_Div_div_res);
+ return new_rd_Proj(dbgi, block, new_pred, mode_Iu, pn_ia32_Div_div_res);
case pn_Div_X_regular:
- return new_rd_Jmp(dbgi, irg, block);
+ return new_rd_Jmp(dbgi, block);
case pn_Div_X_except:
set_ia32_exc_label(new_pred, 1);
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_X, pn_ia32_Div_X_exc);
+ return new_rd_Proj(dbgi, block, new_pred, mode_X, pn_ia32_Div_X_exc);
default:
break;
}
case iro_Mod:
switch (proj) {
case pn_Mod_M:
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_M, pn_ia32_Div_M);
+ return new_rd_Proj(dbgi, block, new_pred, mode_M, pn_ia32_Div_M);
case pn_Mod_res:
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_Iu, pn_ia32_Div_mod_res);
+ return new_rd_Proj(dbgi, block, new_pred, mode_Iu, pn_ia32_Div_mod_res);
case pn_Mod_X_except:
set_ia32_exc_label(new_pred, 1);
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_X, pn_ia32_Div_X_exc);
+ return new_rd_Proj(dbgi, block, new_pred, mode_X, pn_ia32_Div_X_exc);
default:
break;
}
case iro_DivMod:
switch (proj) {
case pn_DivMod_M:
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_M, pn_ia32_Div_M);
+ return new_rd_Proj(dbgi, block, new_pred, mode_M, pn_ia32_Div_M);
case pn_DivMod_res_div:
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_Iu, pn_ia32_Div_div_res);
+ return new_rd_Proj(dbgi, block, new_pred, mode_Iu, pn_ia32_Div_div_res);
case pn_DivMod_res_mod:
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_Iu, pn_ia32_Div_mod_res);
+ return new_rd_Proj(dbgi, block, new_pred, mode_Iu, pn_ia32_Div_mod_res);
case pn_DivMod_X_regular:
- return new_rd_Jmp(dbgi, irg, block);
+ return new_rd_Jmp(dbgi, block);
case pn_DivMod_X_except:
set_ia32_exc_label(new_pred, 1);
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_X, pn_ia32_Div_X_exc);
+ return new_rd_Proj(dbgi, block, new_pred, mode_X, pn_ia32_Div_X_exc);
default:
break;
}
ir_node *block = be_transform_node(get_nodes_block(node));
ir_node *pred = get_Proj_pred(node);
ir_node *new_pred = be_transform_node(pred);
- ir_graph *irg = current_ir_graph;
dbg_info *dbgi = get_irn_dbg_info(node);
long proj = get_Proj_proj(node);
switch (proj) {
case pn_CopyB_M_regular:
if (is_ia32_CopyB_i(new_pred)) {
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_M, pn_ia32_CopyB_i_M);
+ return new_rd_Proj(dbgi, block, new_pred, mode_M, pn_ia32_CopyB_i_M);
} else if (is_ia32_CopyB(new_pred)) {
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_M, pn_ia32_CopyB_M);
+ return new_rd_Proj(dbgi, block, new_pred, mode_M, pn_ia32_CopyB_M);
}
break;
default:
ir_node *block = be_transform_node(get_nodes_block(node));
ir_node *pred = get_Proj_pred(node);
ir_node *new_pred = be_transform_node(pred);
- ir_graph *irg = current_ir_graph;
dbg_info *dbgi = get_irn_dbg_info(node);
long proj = get_Proj_proj(node);
switch (proj) {
case pn_Quot_M:
if (is_ia32_xDiv(new_pred)) {
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_M, pn_ia32_xDiv_M);
+ return new_rd_Proj(dbgi, block, new_pred, mode_M, pn_ia32_xDiv_M);
} else if (is_ia32_vfdiv(new_pred)) {
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_M, pn_ia32_vfdiv_M);
+ return new_rd_Proj(dbgi, block, new_pred, mode_M, pn_ia32_vfdiv_M);
}
break;
case pn_Quot_res:
if (is_ia32_xDiv(new_pred)) {
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_xmm, pn_ia32_xDiv_res);
+ return new_rd_Proj(dbgi, block, new_pred, mode_xmm, pn_ia32_xDiv_res);
} else if (is_ia32_vfdiv(new_pred)) {
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_vfp, pn_ia32_vfdiv_res);
+ return new_rd_Proj(dbgi, block, new_pred, mode_vfp, pn_ia32_vfdiv_res);
}
break;
case pn_Quot_X_regular:
}
}
- mem = transform_AM_mem(irg, block, src_ptr, src_mem, addr->mem);
+ mem = transform_AM_mem(block, src_ptr, src_mem, addr->mem);
call = new_bd_ia32_Call(dbgi, block, addr->base, addr->index, mem,
am.new_op2, sp, fpcw, eax, ecx, edx, pop, call_tp);
set_am_attributes(call, &am);
}
SET_IA32_ORIG_NODE(load, node);
- return new_r_Proj(current_ir_graph, block, load, mode_Iu, pn_ia32_Load_res);
+ return new_r_Proj(block, load, mode_Iu, pn_ia32_Load_res);
}
/**
}
SET_IA32_ORIG_NODE(load, node);
- return new_r_Proj(current_ir_graph, block, load, mode_Iu, pn_ia32_Load_res);
+ return new_r_Proj(block, load, mode_Iu, pn_ia32_Load_res);
}
/**
SET_IA32_ORIG_NODE(new_node, node);
be_dep_on_frame(new_node);
- return new_r_Proj(current_ir_graph, block, new_node, mode_M, pn_ia32_Prefetch_M);
+ return new_r_Proj(block, new_node, mode_M, pn_ia32_Prefetch_M);
}
/**
/* bsf x */
if (get_irn_mode(real) != mode_T) {
set_irn_mode(real, mode_T);
- bsf = new_r_Proj(current_ir_graph, block, real, mode_Iu, pn_ia32_res);
+ bsf = new_r_Proj(block, real, mode_Iu, pn_ia32_res);
}
- flag = new_r_Proj(current_ir_graph, block, real, mode_b, pn_ia32_flags);
+ flag = new_r_Proj(block, real, mode_b, pn_ia32_flags);
/* sete */
set = new_bd_ia32_Set(dbgi, block, flag, pn_Cmp_Eq, 0);
in[0] = store;
in[1] = trampoline;
- return new_r_Tuple(current_ir_graph, new_block, 2, in);
+ return new_r_Tuple(new_block, 2, in);
}
/**
return new_node;
case ir_bk_inport:
if (get_Proj_proj(proj) == pn_Builtin_1_result) {
- return new_r_Proj(current_ir_graph, get_nodes_block(new_node),
+ return new_r_Proj(get_nodes_block(new_node),
new_node, get_irn_mode(proj), pn_ia32_Inport_res);
} else {
assert(get_Proj_proj(proj) == pn_Builtin_M);
- return new_r_Proj(current_ir_graph, get_nodes_block(new_node),
+ return new_r_Proj(get_nodes_block(new_node),
new_node, mode_M, pn_ia32_Inport_M);
}
case ir_bk_inner_trampoline:
ir_node *res;
if (proj == pn_be_Call_M_regular) {
- return new_rd_Proj(dbgi, irg, block, new_call, mode_M, n_ia32_Call_mem);
+ return new_rd_Proj(dbgi, block, new_call, mode_M, n_ia32_Call_mem);
}
/* transform call modes */
if (mode_is_data(mode)) {
assert(i < n_outs);
}
- res = new_rd_Proj(dbgi, irg, block, new_call, mode, proj);
+ res = new_rd_Proj(dbgi, block, new_call, mode, proj);
/* TODO arch_set_irn_register() only operates on Projs, need variant with index */
switch (proj) {
case pn_Bound_X_regular:
new_node = be_transform_node(pred);
block = get_nodes_block(new_node);
- return new_r_Proj(current_ir_graph, block, new_node, mode_X, pn_ia32_Jcc_true);
+ return new_r_Proj(block, new_node, mode_X, pn_ia32_Jcc_true);
case pn_Bound_X_except:
new_node = be_transform_node(pred);
block = get_nodes_block(new_node);
- return new_r_Proj(current_ir_graph, block, new_node, mode_X, pn_ia32_Jcc_false);
+ return new_r_Proj(block, new_node, mode_X, pn_ia32_Jcc_false);
case pn_Bound_res:
return be_transform_node(get_Bound_index(pred));
default:
panic("unexpected proj mode at ASM");
}
- return new_r_Proj(current_ir_graph, block, new_pred, mode, pos);
+ return new_r_Proj(block, new_pred, mode, pos);
}
/**
ir_node *new_block = be_transform_node(block);
dbg_info *dbgi = get_irn_dbg_info(node);
/* we exchange the ProjX with a jump */
- ir_node *jump = new_rd_Jmp(dbgi, current_ir_graph, new_block);
+ ir_node *jump = new_rd_Jmp(dbgi, new_block);
return jump;
}
if (ia32_mode_needs_gp_reg(mode)) {
ir_node *new_pred = be_transform_node(pred);
ir_node *block = be_transform_node(get_nodes_block(node));
- ir_node *new_proj = new_r_Proj(current_ir_graph, block, new_pred,
+ ir_node *new_proj = new_r_Proj(block, new_pred,
mode_Iu, get_Proj_proj(node));
new_proj->node_nr = node->node_nr;
return new_proj;
}
block = get_nodes_block(node);
- in[0] = new_r_Proj(current_ir_graph, block, node,
- arch_register_class_mode(cls), i);
+ in[0] = new_r_Proj(block, node, arch_register_class_mode(cls), i);
if (last_keep != NULL) {
be_Keep_add_node(last_keep, cls, in[0]);
} else {
- last_keep = be_new_Keep(cls, current_ir_graph, block, 1, in);
+ last_keep = be_new_Keep(cls, block, 1, in);
if (sched_is_scheduled(node)) {
sched_add_after(node, last_keep);
}
ir_node *block = get_nodes_block(call);
ir_node *frame = get_irg_frame(current_ir_graph);
ir_node *old_mem = be_get_Proj_for_pn(call, pn_ia32_Call_M);
- ir_node *call_mem = new_r_Proj(current_ir_graph, block, call, mode_M, pn_ia32_Call_M);
+ ir_node *call_mem = new_r_Proj(block, call, mode_M, pn_ia32_Call_M);
ir_node *vfst, *xld, *new_mem;
/* store st(0) on stack */
set_ia32_op_type(xld, ia32_AddrModeS);
set_ia32_use_frame(xld);
- new_res = new_r_Proj(current_ir_graph, block, xld, mode, pn_ia32_xLoad_res);
- new_mem = new_r_Proj(current_ir_graph, block, xld, mode_M, pn_ia32_xLoad_M);
+ new_res = new_r_Proj(block, xld, mode, pn_ia32_xLoad_res);
+ new_mem = new_r_Proj(block, xld, mode_M, pn_ia32_xLoad_M);
if (old_mem != NULL) {
edges_reroute(old_mem, new_mem, current_ir_graph);
set_ia32_am_sc(vfld, get_ia32_am_sc(n));
set_ia32_ls_mode(vfld, get_ia32_ls_mode(n));
- irg = get_irn_irg(n);
- rproj = new_r_Proj(irg, block, vfld, get_ia32_ls_mode(vfld), pn_ia32_vfld_res);
- mproj = new_r_Proj(irg, block, vfld, mode_M, pn_ia32_vfld_M);
+ rproj = new_r_Proj(block, vfld, get_ia32_ls_mode(vfld), pn_ia32_vfld_res);
+ mproj = new_r_Proj(block, vfld, mode_M, pn_ia32_vfld_M);
mem = get_irn_Proj_for_mode(n, mode_M);
assert(mem && "Store memory not found");
arch_set_irn_register(rproj, op2);
/* reroute all former users of the store memory to the load memory */
+ irg = get_irn_irg(n);
edges_reroute(mem, mproj, irg);
/* set the memory input of the load to the store memory */
set_irn_n(vfld, n_ia32_vfld_mem, mem);
*/
static void keep_float_node_alive(ir_node *node)
{
- ir_graph *irg = get_irn_irg(node);
ir_node *block = get_nodes_block(node);
const arch_register_class_t *cls = arch_get_irn_reg_class_out(node);
ir_node *keep;
- keep = be_new_Keep(cls, irg, block, 1, &node);
+ keep = be_new_Keep(cls, block, 1, &node);
assert(sched_is_scheduled(node));
sched_add_after(node, keep);
/* Note: ideally we would route these mem edges directly towards the
* epilogue, but this is currently not supported so we sync all mems
* together */
- sync = new_r_Sync(irg, block, 2, mm+4);
+ sync = new_r_Sync(block, 2, mm+4);
*mem = sync;
} else {
ir_node *reg, *store;
fp_save_offset - initial_frame_size);
panic("FIXME register requirement with ignore");
- fp = new_r_Proj(irg, block, load, mode_Iu, pn_mips_lw_res);
- *mem = new_r_Proj(irg, block, load, mode_Iu, pn_mips_lw_M);
+ fp = new_r_Proj(block, load, mode_Iu, pn_mips_lw_res);
+ *mem = new_r_Proj(block, load, mode_Iu, pn_mips_lw_M);
arch_set_irn_register(fp, &mips_gp_regs[REG_FP]);
be_abi_reg_map_set(reg_map, &mips_gp_regs[REG_FP], fp);
case iro_Div:
switch(pn) {
case pn_Div_M:
- return new_rd_Proj(dbgi, irg, block, new_div, mode_M,
- pn_mips_div_M);
+ return new_rd_Proj(dbgi, block, new_div, mode_M, pn_mips_div_M);
case pn_Div_res:
- proj = new_rd_Proj(dbgi, irg, block, new_div, mode_M,
- pn_mips_div_lohi);
+ proj = new_rd_Proj(dbgi, block, new_div, mode_M, pn_mips_div_lohi);
return new_bd_mips_mflo(dbgi, block, proj);
default:
break;
case iro_Mod:
switch(pn) {
case pn_Mod_M:
- return new_rd_Proj(dbgi, irg, block, new_div, mode_M,
- pn_mips_div_M);
+ return new_rd_Proj(dbgi, block, new_div, mode_M, pn_mips_div_M);
case pn_Mod_res:
- proj = new_rd_Proj(dbgi, irg, block, new_div, mode_M,
- pn_mips_div_lohi);
+ proj = new_rd_Proj(dbgi, block, new_div, mode_M, pn_mips_div_lohi);
return new_bd_mips_mfhi(dbgi, block, proj);
default:
break;
case iro_DivMod:
switch(pn) {
case pn_Div_M:
- return new_rd_Proj(dbgi, irg, block, new_div, mode_M,
- pn_mips_div_M);
+ return new_rd_Proj(dbgi, block, new_div, mode_M, pn_mips_div_M);
case pn_DivMod_res_div:
- proj = new_rd_Proj(dbgi, irg, block, new_div, mode_M,
- pn_mips_div_lohi);
+ proj = new_rd_Proj(dbgi, block, new_div, mode_M, pn_mips_div_lohi);
return new_bd_mips_mflo(dbgi, block, proj);
case pn_DivMod_res_mod:
- proj = new_rd_Proj(dbgi, irg, block, new_div, mode_M,
- pn_mips_div_lohi);
+ proj = new_rd_Proj(dbgi, block, new_div, mode_M, pn_mips_div_lohi);
return new_bd_mips_mfhi(dbgi, block, proj);
default:
break;
static ir_node *gen_Proj_Start(ir_node *node)
{
- ir_graph *irg = current_ir_graph;
dbg_info *dbgi = get_irn_dbg_info(node);
ir_node *block = be_transform_node(get_nodes_block(node));
long pn = get_Proj_proj(node);
+ ir_graph *irg;
if(pn == pn_Start_X_initial_exec) {
/* we exchange the projx with a jump */
- ir_node *jump = new_rd_Jmp(dbgi, irg, block);
+ ir_node *jump = new_rd_Jmp(dbgi, block);
return jump;
}
+ irg = get_irn_irg(node);
if(node == get_irg_anchor(irg, anchor_tls)) {
/* TODO... */
return be_duplicate_node(node);
static ir_node *gen_Proj(ir_node *node)
{
- ir_graph *irg = current_ir_graph;
dbg_info *dbgi = get_irn_dbg_info(node);
ir_node *pred = get_Proj_pred(node);
ir_node *block = be_transform_node(get_nodes_block(node));
long pn = get_Proj_proj(node);
- return new_rd_Proj(dbgi, irg, block, new_pred, mode_Iu, pn);
+ return new_rd_Proj(dbgi, block, new_pred, mode_Iu, pn);
}
break;
}
static ir_node *gen_Phi(ir_node *node)
{
- ir_graph *irg = current_ir_graph;
dbg_info *dbgi = get_irn_dbg_info(node);
ir_node *block = be_transform_node(get_nodes_block(node));
+ ir_graph *irg = get_Block_irg(block);
ir_mode *mode = get_irn_mode(node);
ir_node *phi;
// subtract minval from the switch value
if(minval != 0) {
- minval_const = new_rd_Const(dbg, irg, block, selector_mode, new_tarval_from_long(minval, selector_mode));
+ minval_const = new_rd_Const(dbg, irg, selector_mode, new_tarval_from_long(minval, selector_mode));
minval_const = gen_node_for_Const(env, dbg, irg, block, minval_const);
sub = new_bd_mips_sub(dbg, block, selector, minval_const);
} else {
get_mode_sort(selector_mode), get_mode_size_bits(selector_mode),
0, get_mode_arithmetic(selector_mode), get_mode_modulo_shift(selector_mode));
- max_const = new_rd_Const(dbg, irg, block, unsigned_mode, new_tarval_from_long(maxval - minval + 1, unsigned_mode));
+ max_const = new_rd_Const(dbg, irg, unsigned_mode, new_tarval_from_long(maxval - minval + 1, unsigned_mode));
max_const = gen_node_for_Const(env, dbg, irg, block, max_const);
sltu = new_bd_mips_slt(dbg, block, sub, max_const);
attr->modes.load_store_mode = mode_Iu;
attr->tv = new_tarval_from_long(0, mode_Iu);
- proj = new_rd_Proj(dbg, irg, block, load, mode_Iu, pn_Load_res);
+ proj = new_rd_Proj(dbg, block, load, mode_Iu, pn_Load_res);
switchjmp = new_bd_mips_SwitchJump(dbg, block, proj, mode_T);
attr = get_mips_attr(switchjmp);
load = new_bd_mips_lw(env->dbg, env->block, ptr, mem, ent, 0);
- proj = new_rd_Proj(env->dbg, env->irg, env->block, load, mode_Iu, pn_mips_lw_res);
+ proj = new_rd_Proj(env->dbg, env->block, load, mode_Iu, pn_mips_lw_res);
if (sched_point) {
sched_add_after(sched_point, load);
set_ppc32_frame_entity(store, be_get_frame_entity(node));
- proj = new_rd_Proj(dbg, current_ir_graph, block, store, mode_M, pn_Store_M);
+ proj = new_rd_Proj(dbg, block, store, mode_M, pn_Store_M);
if (sched_is_scheduled(node)) {
sched_add_after(sched_prev(node), store);
set_ppc32_frame_entity(load, be_get_frame_entity(node));
- proj = new_rd_Proj(dbg, current_ir_graph, block, load, mode, pn_Load_res);
+ proj = new_rd_Proj(dbg, block, load, mode, pn_Load_res);
if (sched_is_scheduled(node)) {
sched_add_after(sched_prev(node), load);
}
if (proj_div == NULL)
- proj_div = new_rd_Proj(env->dbg, env->irg, env->block, div_result, get_irn_mode(proj_mod), pn_DivMod_res_div);
+ proj_div = new_rd_Proj(env->dbg, env->block, div_result, get_irn_mode(proj_mod), pn_DivMod_res_div);
if (proj_mod!=NULL){
ir_node *mul_result;
}
- proj_div = new_rd_Proj(env->dbg, env->irg, env->block, div_result, res_mode, pn_DivMod_res_div);
+ proj_div = new_rd_Proj(env->dbg, env->block, div_result, res_mode, pn_DivMod_res_div);
mul_result = new_bd_ppc32_Mullw(env->dbg, env->block, proj_div, op2, res_mode);
mod_result = new_bd_ppc32_Sub(env->dbg, env->block, op1, mul_result, res_mode);
ir_node* in[1];
set_ppc32_offset_mode(andi, ppc32_ao_Lo16);
set_ppc32_constant_tarval(andi, new_tarval_from_long(mask, mode_Is));
- in[0] = new_rd_Proj(env->dbg, env->irg, env->block, andi, env->mode,1);
- be_new_Keep(&ppc32_reg_classes[CLASS_ppc32_condition], env->irg, env->block, 1, in);
- return new_rd_Proj(env->dbg, env->irg, env->block, andi, env->mode,0);
+ in[0] = new_rd_Proj(env->dbg, env->block, andi, env->mode,1);
+ be_new_Keep(&ppc32_reg_classes[CLASS_ppc32_condition], env->block, 1, in);
+ return new_rd_Proj(env->dbg, env->block, andi, env->mode,0);
}
/**
{
ir_node *proj_load, *extsb_node;
load = new_bd_ppc32_Lbz(env->dbg, env->block, loadptr, get_Load_mem(node));
- proj_load = new_rd_Proj(env->dbg, env->irg, env->block, load, mode, pn_Load_res);
+ proj_load = new_rd_Proj(env->dbg, env->block, load, mode, pn_Load_res);
extsb_node = new_bd_ppc32_Extsb(env->dbg, env->block, proj_load, mode);
exchange(get_succ_Proj(env->irn, pn_Load_res), extsb_node);
break;
load = new_bd_ppc32_Lwz(env->dbg, env->block, src, mem);
set_ppc32_constant_tarval(load, offset0);
set_ppc32_offset_mode(load, ppc32_ao_None);
- mem = new_rd_Proj(env->dbg, env->irg, env->block, load, mode_M, pn_Load_M);
- res = new_rd_Proj(env->dbg, env->irg, env->block, load, mode_Is, pn_Load_res);
+ mem = new_rd_Proj(env->dbg, env->block, load, mode_M, pn_Load_M);
+ res = new_rd_Proj(env->dbg, env->block, load, mode_Is, pn_Load_res);
store = new_bd_ppc32_Stw(env->dbg, env->block, dest, res, mem);
set_ppc32_constant_tarval(store, offset0);
set_ppc32_offset_mode(store, ppc32_ao_None);
- mem = new_rd_Proj(env->dbg, env->irg, env->block, store, mode_M, pn_Store_M);
+ mem = new_rd_Proj(env->dbg, env->block, store, mode_M, pn_Store_M);
if(size/4==2)
{
load = new_bd_ppc32_Lwz(env->dbg, env->block, src, mem);
set_ppc32_constant_tarval(load, offset4);
set_ppc32_offset_mode(load, ppc32_ao_None);
- mem = new_rd_Proj(env->dbg, env->irg, env->block, load, mode_M, pn_Load_M);
- res = new_rd_Proj(env->dbg, env->irg, env->block, load, mode_Is, pn_Load_res);
+ mem = new_rd_Proj(env->dbg, env->block, load, mode_M, pn_Load_M);
+ res = new_rd_Proj(env->dbg, env->block, load, mode_Is, pn_Load_res);
store = new_bd_ppc32_Stw(env->dbg, env->block, dest, res, mem);
set_ppc32_constant_tarval(store, offset4);
set_ppc32_offset_mode(store, ppc32_ao_None);
- mem = new_rd_Proj(env->dbg, env->irg, env->block, store, mode_M, pn_Store_M);
+ mem = new_rd_Proj(env->dbg, env->block, store, mode_M, pn_Store_M);
offset = 8;
}
mtctrnode = new_bd_ppc32_Mtctr(env->dbg, env->block, ornode, mode_Is);
store = new_bd_ppc32_LoopCopy(env->dbg, env->block, src, dest, mtctrnode, mem, mode_T);
- in[0] = new_rd_Proj(env->dbg, env->irg, env->block, store, mode_Is, 1); // src
- in[1] = new_rd_Proj(env->dbg, env->irg, env->block, store, mode_Is, 2); // dest
- in[2] = new_rd_Proj(env->dbg, env->irg, env->block, store, mode_Is, 4); // temp
- be_new_Keep(&ppc32_reg_classes[CLASS_ppc32_gp], env->irg, env->block, 3, in);
- in[0] = new_rd_Proj(env->dbg, env->irg, env->block, store, mode_Is, 3); // ctr
- be_new_Keep(&ppc32_reg_classes[CLASS_ppc32_count], env->irg, env->block, 1, in);
+ in[0] = new_rd_Proj(env->dbg, env->block, store, mode_Is, 1); // src
+ in[1] = new_rd_Proj(env->dbg, env->block, store, mode_Is, 2); // dest
+ in[2] = new_rd_Proj(env->dbg, env->block, store, mode_Is, 4); // temp
+ be_new_Keep(&ppc32_reg_classes[CLASS_ppc32_gp], env->block, 3, in);
+ in[0] = new_rd_Proj(env->dbg, env->block, store, mode_Is, 3); // ctr
+ be_new_Keep(&ppc32_reg_classes[CLASS_ppc32_count], env->block, 1, in);
- mem = new_rd_Proj(env->dbg, env->irg, env->block, store, mode_M, 0);
+ mem = new_rd_Proj(env->dbg, env->block, store, mode_M, 0);
offset = 4;
}
load = new_bd_ppc32_Lhz(env->dbg, env->block, src, mem);
set_ppc32_constant_tarval(load, offset_tarval);
set_ppc32_offset_mode(load, ppc32_ao_None);
- mem = new_rd_Proj(env->dbg, env->irg, env->block, load, mode_M, pn_Load_M);
- res = new_rd_Proj(env->dbg, env->irg, env->block, load, mode_Is, pn_Load_res);
+ mem = new_rd_Proj(env->dbg, env->block, load, mode_M, pn_Load_M);
+ res = new_rd_Proj(env->dbg, env->block, load, mode_Is, pn_Load_res);
store = new_bd_ppc32_Sth(env->dbg, env->block, dest, res, mem);
set_ppc32_constant_tarval(store, offset_tarval);
set_ppc32_offset_mode(store, ppc32_ao_None);
- mem = new_rd_Proj(env->dbg, env->irg, env->block, store, mode_M, pn_Store_M);
+ mem = new_rd_Proj(env->dbg, env->block, store, mode_M, pn_Store_M);
offset += 2;
}
load = new_bd_ppc32_Lbz(env->dbg, env->block, src, mem);
set_ppc32_constant_tarval(load, offset_tarval);
set_ppc32_offset_mode(load, ppc32_ao_None);
- mem = new_rd_Proj(env->dbg, env->irg, env->block, load, mode_M, pn_Load_M);
- res = new_rd_Proj(env->dbg, env->irg, env->block, load, mode_Is, pn_Load_res);
+ mem = new_rd_Proj(env->dbg, env->block, load, mode_M, pn_Load_M);
+ res = new_rd_Proj(env->dbg, env->block, load, mode_Is, pn_Load_res);
store = new_bd_ppc32_Stb(env->dbg, env->block, dest, res, mem);
set_ppc32_constant_tarval(store, offset_tarval);
else // mode_F
load = new_bd_ppc32_Lfs(env->dbg, env->block, addr, new_NoMem());
}
- return new_rd_Proj(env->dbg, env->irg, env->block, load, mode, pn_Load_res);
+ return new_rd_Proj(env->dbg, env->block, load, mode, pn_Load_res);
}
default:
node = new_bd_ppc32_Lwz(env->dbg, env->block, node_addis, new_NoMem());
set_ppc32_symconst_ident(node, id_symconst);
set_ppc32_offset_mode(node, ppc32_ao_Lo16);
- node = new_rd_Proj(env->dbg, env->irg, env->block, node, env->mode, pn_Load_res);
+ node = new_rd_Proj(env->dbg, env->block, node, env->mode, pn_Load_res);
}
break;
}
method_ent = new_entity(get_glob_type(), new_id_from_str(funcname), method_type);
callee = new_rd_SymConst_addr_ent(env->dbg, env->irg, mode_P_code, method_ent, method_type);
- call = new_rd_Call(env->dbg, env->irg, env->block, memory, callee, 1, in, method_type);
- call_results = new_rd_Proj(env->dbg, env->irg, env->block, call, mode_T, pn_Call_T_result);
- memory = new_rd_Proj(env->dbg, env->irg, env->block, call, mode_M, pn_Call_M_regular);
+ call = new_rd_Call(env->dbg, env->block, memory, callee, 1, in, method_type);
+ call_results = new_rd_Proj(env->dbg, env->block, call, mode_T, pn_Call_T_result);
+ memory = new_rd_Proj(env->dbg, env->block, call, mode_M, pn_Call_M_regular);
- return new_rd_Proj(env->dbg, env->irg, env->block, call_results, to_mode, 0);
+ return new_rd_Proj(env->dbg, env->block, call_results, to_mode, 0);
}
/**
switch(from_modecode){
case irm_F:
- op = new_rd_Conv(env->dbg, env->irg, env->block, op, mode_D);
+ op = new_rd_Conv(env->dbg, env->block, op, mode_D);
// fall through
case irm_D:
{
ir_node *fctiw = new_bd_ppc32_fCtiw(env->dbg, env->block, op, from_mode);
ir_node *stfd = new_bd_ppc32_Stfd(env->dbg, env->block, get_irg_frame(env->irg),
fctiw, memory);
- ir_node *storememproj = new_rd_Proj(env->dbg, env->irg, env->block, stfd, mode_M, pn_Store_M);
+ ir_node *storememproj = new_rd_Proj(env->dbg, env->block, stfd, mode_M, pn_Store_M);
ir_node *lwz = new_bd_ppc32_Lwz(env->dbg, env->block, get_irg_frame(env->irg),
storememproj);
set_ppc32_frame_entity(stfd, memslot);
set_ppc32_offset_mode(stfd, ppc32_ao_Lo16); // TODO: only allows a 16-bit offset on stack
set_ppc32_frame_entity(lwz, memslot);
set_ppc32_offset_mode(stfd, ppc32_ao_Lo16); // TODO: only allows a 16-bit offset on stack
- memory = new_rd_Proj(env->dbg, env->irg, env->block, lwz, mode_M, pn_Store_M);
- res = new_rd_Proj(env->dbg, env->irg, env->block, lwz, to_mode, pn_Load_res);
+ memory = new_rd_Proj(env->dbg, env->block, lwz, mode_M, pn_Store_M);
+ res = new_rd_Proj(env->dbg, env->block, lwz, to_mode, pn_Load_res);
}
else
case irm_Hs:
case irm_Bu:
case irm_Hu:
- return new_rd_Conv(env->dbg, env->irg, env->block, res, to_mode);
+ return new_rd_Conv(env->dbg, env->block, res, to_mode);
case irm_Is:
case irm_Iu:
return res;
}
case irm_Hs:
case irm_Bs:
- op = new_rd_Conv(env->dbg, env->irg, env->block, op, mode_Is);
+ op = new_rd_Conv(env->dbg, env->block, op, mode_Is);
case irm_Is:
return own_gen_convert_call(env, op, (to_mode == mode_D) ? "conv_int_to_double" : "conv_int_to_single", mode_Is, to_mode);
case irm_Hu:
case irm_Bu:
- op = new_rd_Conv(env->dbg, env->irg, env->block, op, mode_Iu);
+ op = new_rd_Conv(env->dbg, env->block, op, mode_Iu);
case irm_Iu:
return own_gen_convert_call(env, op, (to_mode == mode_D) ? "conv_unsigned_int_to_double": "conv_unsigned_int_to_single", mode_Iu, to_mode);
if (need_new_block) {
ir_node *blk = new_r_Block(irg, 1, &initial_exec);
- set_Block_cfgpred(first_block, idx, new_r_Jmp(irg, blk));
+ set_Block_cfgpred(first_block, idx, new_r_Jmp(blk));
first_block = blk;
}
/* place the call */
sym.entity_p = ent;
- adr = new_r_SymConst(irg, start_block, mode_P_code, sym, symconst_addr_ent);
+ adr = new_r_SymConst(irg, mode_P_code, sym, symconst_addr_ent);
- call = new_r_Call(irg, first_block, get_irg_no_mem(irg), adr, 0, NULL, get_entity_type(ent));
- new_mem = new_r_Proj(irg, first_block, call, mode_M, pn_Call_M_regular);
+ call = new_r_Call(first_block, get_irg_no_mem(irg), adr, 0, NULL, get_entity_type(ent));
+ new_mem = new_r_Proj(first_block, call, mode_M, pn_Call_M_regular);
initial_mem = get_irg_initial_mem(irg);
edges_reroute(initial_mem, new_mem, irg);
l = build_graph(env, inst->in[0]);
r = build_graph(env, inst->in[1]);
c = new_Const_long(env->shf_mode, inst->shift_count);
- r = new_rd_Shl(env->dbg, current_ir_graph, env->blk, r, c, env->mode);
- return inst->irn = new_rd_Add(env->dbg, current_ir_graph, env->blk, l, r, env->mode);
+ r = new_rd_Shl(env->dbg, env->blk, r, c, env->mode);
+ return inst->irn = new_rd_Add(env->dbg, env->blk, l, r, env->mode);
case SHIFT:
l = build_graph(env, inst->in[0]);
c = new_Const_long(env->shf_mode, inst->shift_count);
- return inst->irn = new_rd_Shl(env->dbg, current_ir_graph, env->blk, l, c, env->mode);
+ return inst->irn = new_rd_Shl(env->dbg, env->blk, l, c, env->mode);
case SUB:
l = build_graph(env, inst->in[0]);
r = build_graph(env, inst->in[1]);
- return inst->irn = new_rd_Sub(env->dbg, current_ir_graph, env->blk, l, r, env->mode);
+ return inst->irn = new_rd_Sub(env->dbg, env->blk, l, r, env->mode);
case ADD:
l = build_graph(env, inst->in[0]);
r = build_graph(env, inst->in[1]);
- return inst->irn = new_rd_Add(env->dbg, current_ir_graph, env->blk, l, r, env->mode);
+ return inst->irn = new_rd_Add(env->dbg, env->blk, l, r, env->mode);
case ZERO:
return inst->irn = new_Const(get_mode_null(env->mode));
default:
/* generate the Mulh instruction */
c = new_Const(mag.M);
- q = new_rd_Mulh(dbg, current_ir_graph, block, n, c, mode);
+ q = new_rd_Mulh(dbg, block, n, c, mode);
/* do we need an Add or Sub */
if (mag.need_add)
- q = new_rd_Add(dbg, current_ir_graph, block, q, n, mode);
+ q = new_rd_Add(dbg, block, q, n, mode);
else if (mag.need_sub)
- q = new_rd_Sub(dbg, current_ir_graph, block, q, n, mode);
+ q = new_rd_Sub(dbg, block, q, n, mode);
/* Do we need the shift */
if (mag.s > 0) {
c = new_Const_long(mode_Iu, mag.s);
- q = new_rd_Shrs(dbg, current_ir_graph, block, q, c, mode);
+ q = new_rd_Shrs(dbg, block, q, c, mode);
}
/* final */
c = new_Const_long(mode_Iu, bits - 1);
- t = new_rd_Shr(dbg, current_ir_graph, block, q, c, mode);
+ t = new_rd_Shr(dbg, block, q, c, mode);
- q = new_rd_Add(dbg, current_ir_graph, block, q, t, mode);
+ q = new_rd_Add(dbg, block, q, t, mode);
} else {
struct mu mag = magicu(tv);
ir_node *c;
/* generate the Mulh instruction */
c = new_Const(mag.M);
- q = new_rd_Mulh(dbg, current_ir_graph, block, n, c, mode);
+ q = new_rd_Mulh(dbg, block, n, c, mode);
if (mag.need_add) {
if (mag.s > 0) {
/* use the GM scheme */
- t = new_rd_Sub(dbg, current_ir_graph, block, n, q, mode);
+ t = new_rd_Sub(dbg, block, n, q, mode);
c = new_Const(get_mode_one(mode_Iu));
- t = new_rd_Shr(dbg, current_ir_graph, block, t, c, mode);
+ t = new_rd_Shr(dbg, block, t, c, mode);
- t = new_rd_Add(dbg, current_ir_graph, block, t, q, mode);
+ t = new_rd_Add(dbg, block, t, q, mode);
c = new_Const_long(mode_Iu, mag.s - 1);
- q = new_rd_Shr(dbg, current_ir_graph, block, t, c, mode);
+ q = new_rd_Shr(dbg, block, t, c, mode);
} else {
/* use the default scheme */
- q = new_rd_Add(dbg, current_ir_graph, block, q, n, mode);
+ q = new_rd_Add(dbg, block, q, n, mode);
}
} else if (mag.s > 0) { /* default scheme, shift needed */
c = new_Const_long(mode_Iu, mag.s);
- q = new_rd_Shr(dbg, current_ir_graph, block, q, c, mode);
+ q = new_rd_Shr(dbg, block, q, c, mode);
}
}
return q;
if (! get_Div_no_remainder(irn)) {
if (k != 1) {
k_node = new_Const_long(mode_Iu, k - 1);
- curr = new_rd_Shrs(dbg, current_ir_graph, block, left, k_node, mode);
+ curr = new_rd_Shrs(dbg, block, left, k_node, mode);
}
k_node = new_Const_long(mode_Iu, bits - k);
- curr = new_rd_Shr(dbg, current_ir_graph, block, curr, k_node, mode);
+ curr = new_rd_Shr(dbg, block, curr, k_node, mode);
- curr = new_rd_Add(dbg, current_ir_graph, block, left, curr, mode);
+ curr = new_rd_Add(dbg, block, left, curr, mode);
} else {
k_node = left;
}
k_node = new_Const_long(mode_Iu, k);
- res = new_rd_Shrs(dbg, current_ir_graph, block, curr, k_node, mode);
+ res = new_rd_Shrs(dbg, block, curr, k_node, mode);
if (n_flag) { /* negate the result */
ir_node *k_node;
k_node = new_Const(get_mode_null(mode));
- res = new_rd_Sub(dbg, current_ir_graph, block, k_node, res, mode);
+ res = new_rd_Sub(dbg, block, k_node, res, mode);
}
} else { /* unsigned case */
ir_node *k_node;
k_node = new_Const_long(mode_Iu, k);
- res = new_rd_Shr(dbg, current_ir_graph, block, left, k_node, mode);
+ res = new_rd_Shr(dbg, block, left, k_node, mode);
}
} else {
/* other constant */
if (k != 1) {
k_node = new_Const_long(mode_Iu, k - 1);
- curr = new_rd_Shrs(dbg, current_ir_graph, block, left, k_node, mode);
+ curr = new_rd_Shrs(dbg, block, left, k_node, mode);
}
k_node = new_Const_long(mode_Iu, bits - k);
- curr = new_rd_Shr(dbg, current_ir_graph, block, curr, k_node, mode);
+ curr = new_rd_Shr(dbg, block, curr, k_node, mode);
- curr = new_rd_Add(dbg, current_ir_graph, block, left, curr, mode);
+ curr = new_rd_Add(dbg, block, left, curr, mode);
k_node = new_Const_long(mode, (-1) << k);
- curr = new_rd_And(dbg, current_ir_graph, block, curr, k_node, mode);
+ curr = new_rd_And(dbg, block, curr, k_node, mode);
- res = new_rd_Sub(dbg, current_ir_graph, block, left, curr, mode);
+ res = new_rd_Sub(dbg, block, left, curr, mode);
} else { /* unsigned case */
ir_node *k_node;
k_node = new_Const_long(mode, (1 << k) - 1);
- res = new_rd_And(dbg, current_ir_graph, block, left, k_node, mode);
+ res = new_rd_And(dbg, block, left, k_node, mode);
}
} else {
/* other constant */
if (allow_Mulh(mode)) {
res = replace_div_by_mulh(irn, tv);
- res = new_rd_Mul(dbg, current_ir_graph, block, res, c, mode);
+ res = new_rd_Mul(dbg, block, res, c, mode);
/* res = arch_dep_mul_to_shift(res); */
- res = new_rd_Sub(dbg, current_ir_graph, block, left, res, mode);
+ res = new_rd_Sub(dbg, block, left, res, mode);
}
}
}
if (k != 1) {
k_node = new_Const_long(mode_Iu, k - 1);
- curr = new_rd_Shrs(dbg, current_ir_graph, block, left, k_node, mode);
+ curr = new_rd_Shrs(dbg, block, left, k_node, mode);
}
k_node = new_Const_long(mode_Iu, bits - k);
- curr = new_rd_Shr(dbg, current_ir_graph, block, curr, k_node, mode);
+ curr = new_rd_Shr(dbg, block, curr, k_node, mode);
- curr = new_rd_Add(dbg, current_ir_graph, block, left, curr, mode);
+ curr = new_rd_Add(dbg, block, left, curr, mode);
c_k = new_Const_long(mode_Iu, k);
- *div = new_rd_Shrs(dbg, current_ir_graph, block, curr, c_k, mode);
+ *div = new_rd_Shrs(dbg, block, curr, c_k, mode);
if (n_flag) { /* negate the div result */
ir_node *k_node;
k_node = new_Const(get_mode_null(mode));
- *div = new_rd_Sub(dbg, current_ir_graph, block, k_node, *div, mode);
+ *div = new_rd_Sub(dbg, block, k_node, *div, mode);
}
k_node = new_Const_long(mode, (-1) << k);
- curr = new_rd_And(dbg, current_ir_graph, block, curr, k_node, mode);
+ curr = new_rd_And(dbg, block, curr, k_node, mode);
- *mod = new_rd_Sub(dbg, current_ir_graph, block, left, curr, mode);
+ *mod = new_rd_Sub(dbg, block, left, curr, mode);
} else { /* unsigned case */
ir_node *k_node;
k_node = new_Const_long(mode_Iu, k);
- *div = new_rd_Shr(dbg, current_ir_graph, block, left, k_node, mode);
+ *div = new_rd_Shr(dbg, block, left, k_node, mode);
k_node = new_Const_long(mode, (1 << k) - 1);
- *mod = new_rd_And(dbg, current_ir_graph, block, left, k_node, mode);
+ *mod = new_rd_And(dbg, block, left, k_node, mode);
}
} else {
/* other constant */
*div = replace_div_by_mulh(irn, tv);
- t = new_rd_Mul(dbg, current_ir_graph, block, *div, c, mode);
+ t = new_rd_Mul(dbg, block, *div, c, mode);
/* t = arch_dep_mul_to_shift(t); */
- *mod = new_rd_Sub(dbg, current_ir_graph, block, left, t, mode);
+ *mod = new_rd_Sub(dbg, block, left, t, mode);
}
}
}
new_bd_Const(dbg_info *db, tarval *con) {
ir_graph *irg = current_ir_graph;
- return new_rd_Const_type (db, irg, con, firm_unknown_type);
+ return new_rd_Const_type(db, irg, con, firm_unknown_type);
} /* new_bd_Const */
static ir_node *
new_bd_defaultProj(dbg_info *db, ir_node *block, ir_node *arg,
long max_proj) {
ir_node *res;
- ir_graph *irg = current_ir_graph;
assert(arg->op == op_Cond);
arg->attr.cond.kind = fragmentary;
arg->attr.cond.default_proj = max_proj;
- res = new_rd_Proj (db, irg, block, arg, mode_X, max_proj);
+ res = new_rd_Proj(db, block, arg, mode_X, max_proj);
return res;
} /* new_bd_defaultProj */
/* Creates a Phi node with all predecessors. Calling this constructor
is only allowed if the corresponding block is mature. */
ir_node *
-new_rd_Phi(dbg_info *db, ir_graph *irg, ir_node *block, int arity, ir_node **in, ir_mode *mode) {
+new_rd_Phi(dbg_info *db, ir_node *block, int arity, ir_node **in, ir_mode *mode) {
ir_node *res;
ir_graph *rem = current_ir_graph;
- current_ir_graph = irg;
+ current_ir_graph = get_Block_irg(block);
res = new_bd_Phi(db, block,arity, in, mode);
current_ir_graph = rem;
} /* new_rd_Const_long */
ir_node *
-new_rd_defaultProj(dbg_info *db, ir_graph *irg, ir_node *block, ir_node *arg,
- long max_proj) {
+new_rd_defaultProj(dbg_info *db, ir_node *block, ir_node *arg, long max_proj) {
ir_node *res;
ir_graph *rem = current_ir_graph;
- current_ir_graph = irg;
+ current_ir_graph = get_Block_irg(block);
res = new_bd_defaultProj(db, block, arg, max_proj);
current_ir_graph = rem;
} /* new_rd_defaultProj */
ir_node *
-new_rd_simpleSel(dbg_info *db, ir_graph *irg, ir_node *block,
+new_rd_simpleSel(dbg_info *db, ir_node *block,
ir_node *store, ir_node *objptr, ir_entity *ent) {
ir_node *res;
ir_graph *rem = current_ir_graph;
- current_ir_graph = irg;
+ current_ir_graph = get_Block_irg(block);
res = new_bd_Sel(db, block, store, objptr, 0, NULL, ent);
current_ir_graph = rem;
} /* new_rd_simpleSel */
ir_node *
-new_rd_SymConst_type(dbg_info *db, ir_graph *irg, ir_node *block, ir_mode *mode,
+new_rd_SymConst_type(dbg_info *db, ir_graph *irg, ir_mode *mode,
symconst_symbol value, symconst_kind symkind, ir_type *tp) {
ir_node *res;
ir_graph *rem = current_ir_graph;
+ ir_node *block = get_irg_start_block(irg);
current_ir_graph = irg;
res = new_bd_SymConst_type(db, block, mode, value, symkind, tp);
} /* new_rd_SymConst_type */
ir_node *
-new_rd_SymConst(dbg_info *db, ir_graph *irg, ir_node *block, ir_mode *mode,
+new_rd_SymConst(dbg_info *db, ir_graph *irg, ir_mode *mode,
symconst_symbol value, symconst_kind symkind) {
- return new_rd_SymConst_type(db, irg, block, mode, value, symkind, firm_unknown_type);
+ return new_rd_SymConst_type(db, irg, mode, value, symkind, firm_unknown_type);
} /* new_rd_SymConst */
ir_node *new_rd_SymConst_addr_ent(dbg_info *db, ir_graph *irg, ir_mode *mode, ir_entity *symbol, ir_type *tp) {
symconst_symbol sym;
sym.entity_p = symbol;
- return new_rd_SymConst_type(db, irg, get_irg_start_block(irg), mode, sym, symconst_addr_ent, tp);
+ return new_rd_SymConst_type(db, irg, mode, sym, symconst_addr_ent, tp);
} /* new_rd_SymConst_addr_ent */
ir_node *new_rd_SymConst_ofs_ent(dbg_info *db, ir_graph *irg, ir_mode *mode, ir_entity *symbol, ir_type *tp) {
symconst_symbol sym;
sym.entity_p = symbol;
- return new_rd_SymConst_type(db, irg, get_irg_start_block(irg), mode, sym, symconst_ofs_ent, tp);
+ return new_rd_SymConst_type(db, irg, mode, sym, symconst_ofs_ent, tp);
} /* new_rd_SymConst_ofs_ent */
ir_node *new_rd_SymConst_addr_name(dbg_info *db, ir_graph *irg, ir_mode *mode, ident *symbol, ir_type *tp) {
symconst_symbol sym;
sym.ident_p = symbol;
- return new_rd_SymConst_type(db, irg, get_irg_start_block(irg), mode, sym, symconst_addr_name, tp);
+ return new_rd_SymConst_type(db, irg, mode, sym, symconst_addr_name, tp);
} /* new_rd_SymConst_addr_name */
ir_node *new_rd_SymConst_type_tag(dbg_info *db, ir_graph *irg, ir_mode *mode, ir_type *symbol, ir_type *tp) {
symconst_symbol sym;
sym.type_p = symbol;
- return new_rd_SymConst_type(db, irg, get_irg_start_block(irg), mode, sym, symconst_type_tag, tp);
+ return new_rd_SymConst_type(db, irg, mode, sym, symconst_type_tag, tp);
} /* new_rd_SymConst_type_tag */
ir_node *new_rd_SymConst_size(dbg_info *db, ir_graph *irg, ir_mode *mode, ir_type *symbol, ir_type *tp) {
symconst_symbol sym;
sym.type_p = symbol;
- return new_rd_SymConst_type(db, irg, get_irg_start_block(irg), mode, sym, symconst_type_size, tp);
+ return new_rd_SymConst_type(db, irg, mode, sym, symconst_type_size, tp);
} /* new_rd_SymConst_size */
ir_node *new_rd_SymConst_align(dbg_info *db, ir_graph *irg, ir_mode *mode, ir_type *symbol, ir_type *tp) {
symconst_symbol sym;
sym.type_p = symbol;
- return new_rd_SymConst_type(db, irg, get_irg_start_block(irg), mode, sym, symconst_type_align, tp);
+ return new_rd_SymConst_type(db, irg, mode, sym, symconst_type_align, tp);
} /* new_rd_SymConst_align */
ir_node *
-new_rd_Sync(dbg_info *db, ir_graph *irg, ir_node *block, int arity, ir_node *in[]) {
+new_rd_Sync(dbg_info *db, ir_node *block, int arity, ir_node *in[]) {
ir_node *res;
ir_graph *rem = current_ir_graph;
int i;
- current_ir_graph = irg;
+ current_ir_graph = get_Block_irg(block);
res = new_bd_Sync(db, block);
current_ir_graph = rem;
return res;
} /* new_rd_EndExcept */
-ir_node *new_rd_ASM(dbg_info *db, ir_graph *irg, ir_node *block,
+ir_node *new_rd_ASM(dbg_info *db, ir_node *block,
int arity, ir_node *in[], ir_asm_constraint *inputs,
int n_outs, ir_asm_constraint *outputs,
int n_clobber, ident *clobber[], ident *asm_text) {
ir_node *res;
ir_graph *rem = current_ir_graph;
- current_ir_graph = irg;
+ current_ir_graph = get_Block_irg(block);
res = new_bd_ASM(db, block, arity, in, inputs, n_outs, outputs, n_clobber, clobber, asm_text);
current_ir_graph = rem;
ir_node *new_r_Const_type(ir_graph *irg, tarval *con, ir_type *tp) {
return new_rd_Const_type(NULL, irg, con, tp);
}
-ir_node *new_r_SymConst(ir_graph *irg, ir_node *block, ir_mode *mode,
+ir_node *new_r_SymConst(ir_graph *irg, ir_mode *mode,
symconst_symbol value, symconst_kind symkind) {
- return new_rd_SymConst(NULL, irg, block, mode, value, symkind);
+ return new_rd_SymConst(NULL, irg, mode, value, symkind);
}
-ir_node *new_r_simpleSel(ir_graph *irg, ir_node *block, ir_node *store,
+ir_node *new_r_simpleSel(ir_node *block, ir_node *store,
ir_node *objptr, ir_entity *ent) {
- return new_rd_Sel(NULL, irg, block, store, objptr, 0, NULL, ent);
+ return new_rd_Sel(NULL, block, store, objptr, 0, NULL, ent);
}
-ir_node *new_r_Phi(ir_graph *irg, ir_node *block, int arity,
- ir_node **in, ir_mode *mode) {
- return new_rd_Phi(NULL, irg, block, arity, in, mode);
+ir_node *new_r_Phi(ir_node *block, int arity, ir_node **in, ir_mode *mode) {
+ return new_rd_Phi(NULL, block, arity, in, mode);
}
-ir_node *new_r_Sync(ir_graph *irg, ir_node *block, int arity, ir_node *in[]) {
- return new_rd_Sync(NULL, irg, block, arity, in);
+ir_node *new_r_Sync(ir_node *block, int arity, ir_node *in[]) {
+ return new_rd_Sync(NULL, block, arity, in);
}
-ir_node *new_r_defaultProj(ir_graph *irg, ir_node *block, ir_node *arg,
- long max_proj) {
- return new_rd_defaultProj(NULL, irg, block, arg, max_proj);
+ir_node *new_r_defaultProj(ir_node *block, ir_node *arg, long max_proj) {
+ return new_rd_defaultProj(NULL, block, arg, max_proj);
}
ir_node *new_r_Bad(ir_graph *irg) {
return get_irg_bad(irg);
ir_node *new_r_NoMem(ir_graph *irg) {
return get_irg_no_mem(irg);
}
-ir_node *new_r_ASM(ir_graph *irg, ir_node *block,
+ir_node *new_r_ASM(ir_node *block,
int arity, ir_node *in[], ir_asm_constraint *inputs,
int n_outs, ir_asm_constraint *outputs,
int n_clobber, ident *clobber[], ident *asm_text) {
- return new_rd_ASM(NULL, irg, block, arity, in, inputs, n_outs, outputs, n_clobber, clobber, asm_text);
+ return new_rd_ASM(NULL, block, arity, in, inputs, n_outs, outputs, n_clobber, clobber, asm_text);
}
/** ********************/
ir_node *
new_d_Sync(dbg_info *db, int arity, ir_node *in[]) {
- return new_rd_Sync(db, current_ir_graph, current_ir_graph->current_block, arity, in);
+ return new_rd_Sync(db, current_ir_graph->current_block, arity, in);
} /* new_d_Sync */
ir_node *
}
}
+/**
+ * Walker: exports every node.
+ */
static void export_node(ir_node *irn, void *ctx)
{
io_env_t *env = (io_env_t *) ctx;
if (env->ignoreblocks && opcode == iro_Block)
return;
- n = get_irn_arity(irn);
-
fprintf(env->file, "\t%s %ld [ ", get_irn_opname(irn), get_irn_node_nr(irn));
+ n = get_irn_arity(irn);
for (i = -1; i < n; i++) {
ir_node *pred = get_irn_n(irn, i);
if (pred == NULL) {
fprintf(env->file, "] { ");
- switch (opcode)
- {
+ switch (opcode) {
#include "gen_irio_export.inl"
}
fputs("}\n", env->file);
fputs("}\n\n", env->file);
}
-/** Exports the whole irp to the given file in a textual form. */
+/* Exports the whole irp to the given file in a textual form. */
void ir_export(const char *filename)
{
io_env_t env;
fclose(env.file);
}
-/** Exports the given irg to the given file. */
+/* Exports the given irg to the given file. */
void ir_export_irg(ir_graph *irg, const char *filename)
{
io_env_t env;
pred = get_irn_n(phi, i);
res[i] = new_r_Const_type(irg, res[i], get_Const_type(pred));
}
- return new_r_Phi(irg, get_nodes_block(phi), n, (ir_node **)res, mode);
+ return new_r_Phi(get_nodes_block(phi), n, (ir_node **)res, mode);
} /* apply_binop_on_phi */
/**
pred = get_irn_n(a, i);
res[i] = new_r_Const_type(irg, res[i], get_Const_type(pred));
}
- return new_r_Phi(irg, get_nodes_block(a), n, (ir_node **)res, mode);
+ return new_r_Phi(get_nodes_block(a), n, (ir_node **)res, mode);
} /* apply_binop_on_2_phis */
/**
pred = get_irn_n(phi, i);
res[i] = new_r_Const_type(irg, res[i], get_Const_type(pred));
}
- return new_r_Phi(irg, get_nodes_block(phi), n, (ir_node **)res, mode);
+ return new_r_Phi(get_nodes_block(phi), n, (ir_node **)res, mode);
} /* apply_unop_on_phi */
/**
pred = get_irn_n(phi, i);
res[i] = new_r_Const_type(irg, res[i], get_Const_type(pred));
}
- return new_r_Phi(irg, get_nodes_block(phi), n, (ir_node **)res, mode);
+ return new_r_Phi(get_nodes_block(phi), n, (ir_node **)res, mode);
} /* apply_conv_on_phi */
/**
/* convert a AddP(P, *s) into AddP(P, *u) */
ir_mode *nm = get_reference_mode_unsigned_eq(mode);
- ir_node *pre = new_r_Conv(current_ir_graph, get_nodes_block(n), right, nm);
+ ir_node *pre = new_r_Conv(get_nodes_block(n), right, nm);
set_binop_right(n, pre);
}
}
if (is_Const(b) && is_Const_null(b) && mode_is_int(lmode)) {
/* an Add(a, NULL) is a hidden Conv */
dbg_info *dbg = get_irn_dbg_info(n);
- return new_rd_Conv(dbg, current_ir_graph, get_nodes_block(n), a, mode);
+ return new_rd_Conv(dbg, get_nodes_block(n), a, mode);
}
}
n = new_rd_Mul(
get_irn_dbg_info(n),
- current_ir_graph,
block,
a,
new_Const_long(mode, 2),
if (is_Minus(a)) {
n = new_rd_Sub(
get_irn_dbg_info(n),
- current_ir_graph,
get_nodes_block(n),
b,
get_Minus_op(a),
if (is_Minus(b)) {
n = new_rd_Sub(
get_irn_dbg_info(n),
- current_ir_graph,
get_nodes_block(n),
a,
get_Minus_op(b),
if (is_Const(b) && is_Const_one(b)) {
/* ~x + 1 = -x */
ir_node *blk = get_nodes_block(n);
- n = new_rd_Minus(get_irn_dbg_info(n), current_ir_graph, blk, op, mode);
+ n = new_rd_Minus(get_irn_dbg_info(n), blk, op, mode);
DBG_OPT_ALGSIM0(oldn, n, FS_OPT_NOT_PLUS_1);
return n;
}
if (is_Const(b) && is_Const_null(b) && mode_is_reference(lmode)) {
/* a Sub(a, NULL) is a hidden Conv */
dbg_info *dbg = get_irn_dbg_info(n);
- n = new_rd_Conv(dbg, current_ir_graph, get_nodes_block(n), a, mode);
+ n = new_rd_Conv(dbg, get_nodes_block(n), a, mode);
DBG_OPT_ALGSIM0(oldn, n, FS_OPT_SUB_TO_CONV);
return n;
}
get_Const_tarval(a) == get_mode_minus_one(mode)) {
/* -1 - x -> ~x */
dbg_info *dbg = get_irn_dbg_info(n);
- n = new_rd_Not(dbg, current_ir_graph, get_nodes_block(n), b, mode);
+ n = new_rd_Not(dbg, get_nodes_block(n), b, mode);
DBG_OPT_ALGSIM0(oldn, n, FS_OPT_SUB_TO_NOT);
return n;
}
if (cnst != NULL) {
ir_node *block = get_nodes_block(n);
dbg_info *dbgi = get_irn_dbg_info(n);
- ir_graph *irg = get_irn_irg(n);
- n = new_rd_Add(dbgi, irg, block, a, cnst, mode);
+ n = new_rd_Add(dbgi, block, a, cnst, mode);
DBG_OPT_ALGSIM0(oldn, n, FS_OPT_SUB_TO_ADD);
return n;
}
}
if (is_Minus(a)) { /* (-a) - b -> -(a + b) */
- ir_graph *irg = current_ir_graph;
dbg_info *dbg = get_irn_dbg_info(n);
ir_node *block = get_nodes_block(n);
ir_node *left = get_Minus_op(a);
- ir_node *add = new_rd_Add(dbg, irg, block, left, b, mode);
+ ir_node *add = new_rd_Add(dbg, block, left, b, mode);
- n = new_rd_Minus(dbg, irg, block, add, mode);
+ n = new_rd_Minus(dbg, block, add, mode);
DBG_OPT_ALGSIM0(oldn, n, FS_OPT_SUB_TO_ADD);
return n;
} else if (is_Minus(b)) { /* a - (-b) -> a + b */
- ir_graph *irg = current_ir_graph;
dbg_info *dbg = get_irn_dbg_info(n);
ir_node *block = get_nodes_block(n);
ir_node *right = get_Minus_op(b);
- n = new_rd_Add(dbg, irg, block, a, right, mode);
+ n = new_rd_Add(dbg, block, a, right, mode);
DBG_OPT_ALGSIM0(oldn, n, FS_OPT_SUB_MINUS);
return n;
} else if (is_Sub(b)) {
/* a - (b - c) -> a + (c - b)
* -> (a - b) + c iff (b - c) is a pointer */
- ir_graph *irg = current_ir_graph;
dbg_info *s_dbg = get_irn_dbg_info(b);
ir_node *s_block = get_nodes_block(b);
ir_node *s_left = get_Sub_left(b);
ir_node *s_right = get_Sub_right(b);
ir_mode *s_mode = get_irn_mode(b);
if (mode_is_reference(s_mode)) {
- ir_node *sub = new_rd_Sub(s_dbg, irg, s_block, a, s_left, mode);
+ ir_node *sub = new_rd_Sub(s_dbg, s_block, a, s_left, mode);
dbg_info *a_dbg = get_irn_dbg_info(n);
ir_node *a_block = get_nodes_block(n);
if (s_mode != mode)
- s_right = new_r_Conv(irg, a_block, s_right, mode);
- n = new_rd_Add(a_dbg, irg, a_block, sub, s_right, mode);
+ s_right = new_r_Conv(a_block, s_right, mode);
+ n = new_rd_Add(a_dbg, a_block, sub, s_right, mode);
} else {
- ir_node *sub = new_rd_Sub(s_dbg, irg, s_block, s_right, s_left, s_mode);
+ ir_node *sub = new_rd_Sub(s_dbg, s_block, s_right, s_left, s_mode);
dbg_info *a_dbg = get_irn_dbg_info(n);
ir_node *a_block = get_nodes_block(n);
- n = new_rd_Add(a_dbg, irg, a_block, a, sub, mode);
+ n = new_rd_Add(a_dbg, a_block, a, sub, mode);
}
DBG_OPT_ALGSIM0(oldn, n, FS_OPT_SUB_TO_ADD);
return n;
if (is_Const(m_right)) {
ir_node *cnst2 = const_negate(m_right);
if (cnst2 != NULL) {
- ir_graph *irg = current_ir_graph;
dbg_info *m_dbg = get_irn_dbg_info(b);
ir_node *m_block = get_nodes_block(b);
ir_node *m_left = get_Mul_left(b);
ir_mode *m_mode = get_irn_mode(b);
- ir_node *mul = new_rd_Mul(m_dbg, irg, m_block, m_left, cnst2, m_mode);
+ ir_node *mul = new_rd_Mul(m_dbg, m_block, m_left, cnst2, m_mode);
dbg_info *a_dbg = get_irn_dbg_info(n);
ir_node *a_block = get_nodes_block(n);
- n = new_rd_Add(a_dbg, irg, a_block, a, mul, mode);
+ n = new_rd_Add(a_dbg, a_block, a, mul, mode);
DBG_OPT_ALGSIM0(oldn, n, FS_OPT_SUB_TO_ADD);
return n;
}
if (mode_is_num(mode) && mode == get_irn_mode(a) && is_Const(a) && is_Const_null(a)) {
n = new_rd_Minus(
get_irn_dbg_info(n),
- current_ir_graph,
get_nodes_block(n),
b,
mode);
if (left == b) {
if (mode != get_irn_mode(right)) {
/* This Sub is an effective Cast */
- right = new_r_Conv(get_irn_irg(n), get_nodes_block(n), right, mode);
+ right = new_r_Conv(get_nodes_block(n), right, mode);
}
n = right;
DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_ADD_SUB);
} else if (right == b) {
if (mode != get_irn_mode(left)) {
/* This Sub is an effective Cast */
- left = new_r_Conv(get_irn_irg(n), get_nodes_block(n), left, mode);
+ left = new_r_Conv(get_nodes_block(n), left, mode);
}
n = left;
DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_ADD_SUB);
if (left == a) {
ir_mode *r_mode = get_irn_mode(right);
- n = new_r_Minus(get_irn_irg(n), get_nodes_block(n), right, r_mode);
+ n = new_r_Minus(get_nodes_block(n), right, r_mode);
if (mode != r_mode) {
/* This Sub is an effective Cast */
- n = new_r_Conv(get_irn_irg(n), get_nodes_block(n), n, mode);
+ n = new_r_Conv(get_nodes_block(n), n, mode);
}
DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_ADD_SUB);
return n;
} else if (right == a) {
ir_mode *l_mode = get_irn_mode(left);
- n = new_r_Minus(get_irn_irg(n), get_nodes_block(n), left, l_mode);
+ n = new_r_Minus(get_nodes_block(n), left, l_mode);
if (mode != l_mode) {
/* This Sub is an effective Cast */
- n = new_r_Conv(get_irn_irg(n), get_nodes_block(n), n, mode);
+ n = new_r_Conv(get_nodes_block(n), n, mode);
}
DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_ADD_SUB);
return n;
ir_node *blk = get_nodes_block(n);
n = new_rd_Mul(
get_irn_dbg_info(n),
- current_ir_graph, blk,
+ blk,
ma,
new_rd_Sub(
get_irn_dbg_info(n),
- current_ir_graph, blk,
+ blk,
mb,
new_Const_long(mode, 1),
mode),
ir_node *blk = get_nodes_block(n);
n = new_rd_Mul(
get_irn_dbg_info(n),
- current_ir_graph, blk,
+ blk,
mb,
new_rd_Sub(
get_irn_dbg_info(n),
- current_ir_graph, blk,
+ blk,
ma,
new_Const_long(mode, 1),
mode),
}
}
if (is_Sub(a)) { /* (x - y) - b -> x - (y + b) */
- ir_node *x = get_Sub_left(a);
+ ir_node *x = get_Sub_left(a);
ir_node *y = get_Sub_right(a);
ir_node *blk = get_nodes_block(n);
ir_mode *m_b = get_irn_mode(b);
return n;
}
- add = new_r_Add(current_ir_graph, blk, y, b, add_mode);
+ add = new_r_Add(blk, y, b, add_mode);
- n = new_rd_Sub(get_irn_dbg_info(n), current_ir_graph, blk, x, add, mode);
+ n = new_rd_Sub(get_irn_dbg_info(n), blk, x, add, mode);
DBG_OPT_ALGSIM0(oldn, n, FS_OPT_SUB_SUB_X_Y_Z);
return n;
}
if (tv != tarval_bad) {
ir_node *blk = get_nodes_block(n);
ir_node *c = new_Const(tv);
- n = new_rd_Add(get_irn_dbg_info(n), current_ir_graph, blk, get_Not_op(b), c, mode);
+ n = new_rd_Add(get_irn_dbg_info(n), blk, get_Not_op(b), c, mode);
DBG_OPT_ALGSIM0(oldn, n, FS_OPT_SUB_C_NOT_X);
return n;
}
if (ta == get_mode_one(smode)) {
/* (L)1 * (L)b = (L)b */
ir_node *blk = get_nodes_block(n);
- n = new_rd_Conv(get_irn_dbg_info(n), current_ir_graph, blk, b, mode);
+ n = new_rd_Conv(get_irn_dbg_info(n), blk, b, mode);
DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_NEUTRAL_1);
return n;
}
else if (ta == get_mode_minus_one(smode)) {
/* (L)-1 * (L)b = (L)b */
ir_node *blk = get_nodes_block(n);
- n = new_rd_Minus(get_irn_dbg_info(n), current_ir_graph, blk, b, smode);
- n = new_rd_Conv(get_irn_dbg_info(n), current_ir_graph, blk, n, mode);
+ n = new_rd_Minus(get_irn_dbg_info(n), blk, b, smode);
+ n = new_rd_Conv(get_irn_dbg_info(n), blk, n, mode);
DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_MUL_MINUS_1);
return n;
}
if (tb == get_mode_one(smode)) {
/* (L)a * (L)1 = (L)a */
ir_node *blk = get_irn_n(a, -1);
- n = new_rd_Conv(get_irn_dbg_info(n), current_ir_graph, blk, a, mode);
+ n = new_rd_Conv(get_irn_dbg_info(n), blk, a, mode);
DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_NEUTRAL_1);
return n;
}
else if (tb == get_mode_minus_one(smode)) {
/* (L)a * (L)-1 = (L)-a */
ir_node *blk = get_nodes_block(n);
- n = new_rd_Minus(get_irn_dbg_info(n), current_ir_graph, blk, a, smode);
- n = new_rd_Conv(get_irn_dbg_info(n), current_ir_graph, blk, n, mode);
+ n = new_rd_Minus(get_irn_dbg_info(n), blk, a, smode);
+ n = new_rd_Conv(get_irn_dbg_info(n), blk, n, mode);
DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_MUL_MINUS_1);
return n;
}
else if (value_of(b) == get_mode_minus_one(mode))
r = a;
if (r) {
- n = new_rd_Minus(get_irn_dbg_info(n), current_ir_graph, get_nodes_block(n), r, mode);
+ n = new_rd_Minus(get_irn_dbg_info(n), get_nodes_block(n), r, mode);
DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_MUL_MINUS_1);
return n;
}
if (cnst != NULL) {
dbg_info *dbgi = get_irn_dbg_info(n);
ir_node *block = get_nodes_block(n);
- n = new_rd_Mul(dbgi, current_ir_graph, block, get_Minus_op(a), cnst, mode);
+ n = new_rd_Mul(dbgi, block, get_Minus_op(a), cnst, mode);
DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_MUL_MINUS_1);
return n;
}
} else if (is_Minus(b)) { /* (-a) * (-b) -> a * b */
dbg_info *dbgi = get_irn_dbg_info(n);
ir_node *block = get_nodes_block(n);
- n = new_rd_Mul(dbgi, current_ir_graph, block, get_Minus_op(a), get_Minus_op(b), mode);
+ n = new_rd_Mul(dbgi, block, get_Minus_op(a), get_Minus_op(b), mode);
DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_MUL_MINUS_MINUS);
return n;
} else if (is_Sub(b)) { /* (-a) * (b - c) -> a * (c - b) */
ir_node *sub_l = get_Sub_left(b);
ir_node *sub_r = get_Sub_right(b);
dbg_info *dbgi = get_irn_dbg_info(n);
- ir_graph *irg = current_ir_graph;
ir_node *block = get_nodes_block(n);
- ir_node *new_b = new_rd_Sub(dbgi, irg, block, sub_r, sub_l, mode);
- n = new_rd_Mul(dbgi, irg, block, get_Minus_op(a), new_b, mode);
+ ir_node *new_b = new_rd_Sub(dbgi, block, sub_r, sub_l, mode);
+ n = new_rd_Mul(dbgi, block, get_Minus_op(a), new_b, mode);
DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_MUL_MINUS);
return n;
}
ir_node *sub_l = get_Sub_left(a);
ir_node *sub_r = get_Sub_right(a);
dbg_info *dbgi = get_irn_dbg_info(n);
- ir_graph *irg = current_ir_graph;
ir_node *block = get_nodes_block(n);
- ir_node *new_a = new_rd_Sub(dbgi, irg, block, sub_r, sub_l, mode);
- n = new_rd_Mul(dbgi, irg, block, new_a, get_Minus_op(b), mode);
+ ir_node *new_a = new_rd_Sub(dbgi, block, sub_r, sub_l, mode);
+ n = new_rd_Mul(dbgi, block, new_a, get_Minus_op(b), mode);
DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_MUL_MINUS);
return n;
}
if (tarval_ieee754_get_exponent(tv) == 1 && tarval_ieee754_zero_mantissa(tv)
&& !tarval_is_negative(tv)) {
/* 2.0 * b = b + b */
- n = new_rd_Add(get_irn_dbg_info(n), current_ir_graph, get_nodes_block(n), b, b, mode);
+ n = new_rd_Add(get_irn_dbg_info(n), get_nodes_block(n), b, b, mode);
DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_ADD_A_A);
return n;
}
if (tarval_ieee754_get_exponent(tv) == 1 && tarval_ieee754_zero_mantissa(tv)
&& !tarval_is_negative(tv)) {
/* a * 2.0 = a + a */
- n = new_rd_Add(get_irn_dbg_info(n), current_ir_graph, get_nodes_block(n), a, a, mode);
+ n = new_rd_Add(get_irn_dbg_info(n), get_nodes_block(n), a, a, mode);
DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_ADD_A_A);
return n;
}
if (tv == get_mode_minus_one(mode)) {
/* a / -1 */
- value = new_rd_Minus(get_irn_dbg_info(n), current_ir_graph, get_nodes_block(n), a, mode);
+ value = new_rd_Minus(get_irn_dbg_info(n), get_nodes_block(n), a, mode);
DBG_OPT_CSTEVAL(n, value);
goto make_tuple;
}
mem = skip_Pin(mem);
turn_into_tuple(n, pn_Div_max);
set_Tuple_pred(n, pn_Div_M, mem);
- set_Tuple_pred(n, pn_Div_X_regular, new_r_Jmp(current_ir_graph, blk));
+ set_Tuple_pred(n, pn_Div_X_regular, new_r_Jmp(blk));
set_Tuple_pred(n, pn_Div_X_except, new_Bad());
set_Tuple_pred(n, pn_Div_res, value);
}
mem = skip_Pin(mem);
turn_into_tuple(n, pn_Mod_max);
set_Tuple_pred(n, pn_Mod_M, mem);
- set_Tuple_pred(n, pn_Mod_X_regular, new_r_Jmp(current_ir_graph, blk));
+ set_Tuple_pred(n, pn_Mod_X_regular, new_r_Jmp(blk));
set_Tuple_pred(n, pn_Mod_X_except, new_Bad());
set_Tuple_pred(n, pn_Mod_res, value);
}
DBG_OPT_CSTEVAL(n, vb);
goto make_tuple;
} else if (mode_is_signed(mode) && tb == get_mode_minus_one(mode)) {
- va = new_rd_Minus(get_irn_dbg_info(n), current_ir_graph, get_nodes_block(n), a, mode);
+ va = new_rd_Minus(get_irn_dbg_info(n), get_nodes_block(n), a, mode);
vb = new_Const(get_mode_null(mode));
DBG_OPT_CSTEVAL(n, va);
DBG_OPT_CSTEVAL(n, vb);
blk = get_nodes_block(n);
turn_into_tuple(n, pn_DivMod_max);
set_Tuple_pred(n, pn_DivMod_M, mem);
- set_Tuple_pred(n, pn_DivMod_X_regular, new_r_Jmp(current_ir_graph, blk));
+ set_Tuple_pred(n, pn_DivMod_X_regular, new_r_Jmp(blk));
set_Tuple_pred(n, pn_DivMod_X_except, new_Bad()); /* no exception */
set_Tuple_pred(n, pn_DivMod_res_div, va);
set_Tuple_pred(n, pn_DivMod_res_mod, vb);
ir_node *blk = get_nodes_block(n);
ir_node *c = new_Const(tv);
ir_node *a = get_Quot_left(n);
- ir_node *m = new_rd_Mul(get_irn_dbg_info(n), current_ir_graph, blk, a, c, mode);
+ ir_node *m = new_rd_Mul(get_irn_dbg_info(n), blk, a, c, mode);
ir_node *mem = get_Quot_mem(n);
/* skip a potential Pin */
mem = skip_Pin(mem);
turn_into_tuple(n, pn_Quot_max);
set_Tuple_pred(n, pn_Quot_M, mem);
- set_Tuple_pred(n, pn_Quot_X_regular, new_r_Jmp(current_ir_graph, blk));
- set_Tuple_pred(n, pn_Quot_X_except, new_r_Bad(current_ir_graph));
+ set_Tuple_pred(n, pn_Quot_X_regular, new_r_Jmp(blk));
+ set_Tuple_pred(n, pn_Quot_X_except, new_Bad());
set_Tuple_pred(n, pn_Quot_res, m);
DBG_OPT_ALGSIM1(oldn, a, b, m, FS_OPT_FP_INV_MUL);
}
* Note that -x would create a new node, so we could
* not run it in the equivalent_node() context.
*/
- n = new_rd_Minus(get_irn_dbg_info(n), current_ir_graph,
- get_nodes_block(n), a, mode);
+ n = new_rd_Minus(get_irn_dbg_info(n), get_nodes_block(n), a, mode);
DBG_OPT_CONFIRM(oldn, n);
return n;
if (is_Minus(a)) {
/* Abs(-x) = Abs(x) */
mode = get_irn_mode(n);
- n = new_rd_Abs(get_irn_dbg_info(n), current_ir_graph,
- get_nodes_block(n), get_Minus_op(a), mode);
+ n = new_rd_Abs(get_irn_dbg_info(n), get_nodes_block(n), get_Minus_op(a), mode);
DBG_OPT_ALGSIM0(oldn, n, FS_OPT_ABS_MINUS_X);
return n;
}
!mode_overflow_on_unary_Minus(get_irn_mode(left))) {
ir_node *const new_left = get_Minus_op(right);
ir_node *const new_right = get_Minus_op(left);
- n = new_rd_Cmp(get_irn_dbg_info(n), current_ir_graph,
- get_nodes_block(n), new_left, new_right);
+ n = new_rd_Cmp(get_irn_dbg_info(n), get_nodes_block(n), new_left, new_right);
DBG_OPT_ALGSIM0(oldn, n, FS_OPT_CMP_OP_OP);
}
return n;
/* It's a boolean Cond, branching on a boolean constant.
Replace it by a tuple (Bad, Jmp) or (Jmp, Bad) */
ir_node *blk = get_nodes_block(n);
- jmp = new_r_Jmp(current_ir_graph, blk);
+ jmp = new_r_Jmp(blk);
turn_into_tuple(n, pn_Cond_max);
if (ta == tarval_b_true) {
set_Tuple_pred(n, pn_Cond_false, new_Bad());
set_binop_right(n, b_op);
set_irn_mode(n, a_mode);
n = trans_func(n);
- n = new_r_Conv(current_ir_graph, blk, n, get_irn_mode(oldn));
+ n = new_r_Conv(blk, n, get_irn_mode(oldn));
DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_SHIFT_AND);
return n;
if(op_root == op_Eor && op == op_Or) {
dbg_info *dbgi = get_irn_dbg_info(n);
- ir_graph *irg = current_ir_graph;
ir_mode *mode = get_irn_mode(c);
- c = new_rd_Not(dbgi, irg, blk, c, mode);
- n = new_rd_And(dbgi, irg, blk, new_n, c, mode);
+ c = new_rd_Not(dbgi, blk, c, mode);
+ n = new_rd_And(dbgi, blk, new_n, c, mode);
} else {
n = exact_copy(a);
set_nodes_block(n, blk);
/* yes, we can simply calculate with pncs */
pn_Cmp new_pnc = pn_a & pn_b;
- return new_rd_Proj(dbgi, current_ir_graph, block, pred_a, mode_b, new_pnc);
+ return new_rd_Proj(dbgi, block, pred_a, mode_b, new_pnc);
}
}
if (is_Or(a)) {
/* (a|b) & ~(a&b) = a^b */
ir_node *block = get_nodes_block(n);
- n = new_rd_Eor(get_irn_dbg_info(n), current_ir_graph, block, ba, bb, mode);
+ n = new_rd_Eor(get_irn_dbg_info(n), block, ba, bb, mode);
DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_TO_EOR);
return n;
}
/* (a|b) & ~(a&b) = a^b */
ir_node *block = get_nodes_block(n);
- n = new_rd_Eor(get_irn_dbg_info(n), current_ir_graph, block, aa, ab, mode);
+ n = new_rd_Eor(get_irn_dbg_info(n), block, aa, ab, mode);
DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_TO_EOR);
return n;
}
dbg_info *dbg = get_irn_dbg_info(n);
ir_node *block = get_nodes_block(n);
- ar = new_rd_Not(dbg, current_ir_graph, block, ar, mode);
- n = new_rd_And(dbg, current_ir_graph, block, ar, b, mode);
+ ar = new_rd_Not(dbg, block, ar, mode);
+ n = new_rd_And(dbg, block, ar, b, mode);
DBG_OPT_ALGSIM0(oldn, n, FS_OPT_EOR_TO_NOT);
return n;
}
dbg_info *dbg = get_irn_dbg_info(n);
ir_node *block = get_nodes_block(n);
- al = new_rd_Not(dbg, current_ir_graph, block, al, mode);
- n = new_rd_And(dbg, current_ir_graph, block, al, b, mode);
+ al = new_rd_Not(dbg, block, al, mode);
+ n = new_rd_And(dbg, block, al, b, mode);
DBG_OPT_ALGSIM0(oldn, n, FS_OPT_EOR_TO_NOT);
return n;
}
dbg_info *dbg = get_irn_dbg_info(n);
ir_node *block = get_nodes_block(n);
- br = new_rd_Not(dbg, current_ir_graph, block, br, mode);
- n = new_rd_And(dbg, current_ir_graph, block, br, a, mode);
+ br = new_rd_Not(dbg, block, br, mode);
+ n = new_rd_And(dbg, block, br, a, mode);
DBG_OPT_ALGSIM0(oldn, n, FS_OPT_EOR_TO_NOT);
return n;
}
dbg_info *dbg = get_irn_dbg_info(n);
ir_node *block = get_nodes_block(n);
- bl = new_rd_Not(dbg, current_ir_graph, block, bl, mode);
- n = new_rd_And(dbg, current_ir_graph, block, bl, a, mode);
+ bl = new_rd_Not(dbg, block, bl, mode);
+ n = new_rd_And(dbg, block, bl, a, mode);
DBG_OPT_ALGSIM0(oldn, n, FS_OPT_EOR_TO_NOT);
return n;
}
a = get_Not_op(a);
b = get_Not_op(b);
- n = new_rd_Or(get_irn_dbg_info(n), current_ir_graph, block, a, b, mode);
- n = new_rd_Not(get_irn_dbg_info(n), current_ir_graph, block, n, mode);
+ n = new_rd_Or(get_irn_dbg_info(n), block, a, b, mode);
+ n = new_rd_Not(get_irn_dbg_info(n), block, n, mode);
DBG_OPT_ALGSIM0(oldn, n, FS_OPT_DEMORGAN);
return n;
}
/* yes, we can simply calculate with pncs */
pn_Cmp new_pnc = pn_a ^ pn_b;
- return new_rd_Proj(dbgi, current_ir_graph, block, pred_a, mode_b,
- new_pnc);
+ return new_rd_Proj(dbgi, block, pred_a, mode_b, new_pnc);
}
}
is_Const(b) && is_Const_one(b) &&
is_Cmp(get_Proj_pred(a))) {
/* The Eor negates a Cmp. The Cmp has the negated result anyways! */
- n = new_r_Proj(current_ir_graph, get_nodes_block(n), get_Proj_pred(a),
+ n = new_r_Proj(get_nodes_block(n), get_Proj_pred(a),
mode_b, get_negated_pnc(get_Proj_proj(a), mode));
DBG_OPT_ALGSIM0(oldn, n, FS_OPT_EOR_TO_NOT_BOOL);
ir_node *cnst = new_Const(tarval_not(get_Const_tarval(b)));
ir_node *not_op = get_Not_op(a);
dbg_info *dbg = get_irn_dbg_info(n);
- ir_graph *irg = current_ir_graph;
ir_node *block = get_nodes_block(n);
ir_mode *mode = get_irn_mode(n);
- n = new_rd_Eor(dbg, irg, block, not_op, cnst, mode);
+ n = new_rd_Eor(dbg, block, not_op, cnst, mode);
return n;
} else if (is_Const_all_one(b)) { /* x ^ 1...1 -> ~1 */
- n = new_r_Not(current_ir_graph, get_nodes_block(n), a, mode);
+ n = new_r_Not(get_nodes_block(n), a, mode);
DBG_OPT_ALGSIM0(oldn, n, FS_OPT_EOR_TO_NOT);
}
} else {
if (is_Cmp(a_pred)) {
ir_node *cmp_block = get_nodes_block(a_pred);
/* We negate a Cmp. The Cmp has the negated result anyways! */
- n = new_r_Proj(current_ir_graph, cmp_block, get_Proj_pred(a),
+ n = new_r_Proj(cmp_block, get_Proj_pred(a),
mode_b, get_negated_pnc(get_Proj_proj(a), mode_b));
DBG_OPT_ALGSIM0(oldn, n, FS_OPT_NOT_CMP);
return n;
ir_node *cnst = new_Const(tarval_not(get_Const_tarval(eor_b)));
ir_node *eor_a = get_Eor_left(a);
dbg_info *dbg = get_irn_dbg_info(n);
- ir_graph *irg = current_ir_graph;
ir_node *block = get_nodes_block(n);
ir_mode *mode = get_irn_mode(n);
- n = new_rd_Eor(dbg, irg, block, eor_a, cnst, mode);
+ n = new_rd_Eor(dbg, block, eor_a, cnst, mode);
return n;
}
}
ir_node *block = get_nodes_block(n);
ir_node *add_l = get_Minus_op(a);
ir_node *add_r = new_rd_Const(dbg, irg, get_mode_minus_one(mode));
- n = new_rd_Add(dbg, irg, block, add_l, add_r, mode);
+ n = new_rd_Add(dbg, block, add_l, add_r, mode);
} else if (is_Add(a)) {
ir_node *add_r = get_Add_right(a);
if (is_Const(add_r) && is_Const_all_one(add_r)) {
/* ~(x + -1) = -x */
ir_node *op = get_Add_left(a);
ir_node *blk = get_nodes_block(n);
- n = new_rd_Minus(get_irn_dbg_info(n), current_ir_graph, blk, op, get_irn_mode(n));
+ n = new_rd_Minus(get_irn_dbg_info(n), blk, op, get_irn_mode(n));
DBG_OPT_ALGSIM0(oldn, n, FS_OPT_NOT_MINUS_1);
}
}
tarval *tv = get_mode_one(mode);
ir_node *blk = get_nodes_block(n);
ir_node *c = new_Const(tv);
- n = new_rd_Add(get_irn_dbg_info(n), current_ir_graph, blk, op, c, mode);
+ n = new_rd_Add(get_irn_dbg_info(n), blk, op, c, mode);
DBG_OPT_ALGSIM2(oldn, a, n, FS_OPT_MINUS_NOT);
return n;
}
/* -(a >>u (size-1)) = a >>s (size-1) */
ir_node *v = get_Shr_left(a);
- n = new_rd_Shrs(get_irn_dbg_info(n), current_ir_graph, get_nodes_block(n), v, c, mode);
+ n = new_rd_Shrs(get_irn_dbg_info(n), get_nodes_block(n), v, c, mode);
DBG_OPT_ALGSIM2(oldn, a, n, FS_OPT_PREDICATE);
return n;
}
/* -(a >>s (size-1)) = a >>u (size-1) */
ir_node *v = get_Shrs_left(a);
- n = new_rd_Shr(get_irn_dbg_info(n), current_ir_graph, get_nodes_block(n), v, c, mode);
+ n = new_rd_Shr(get_irn_dbg_info(n), get_nodes_block(n), v, c, mode);
DBG_OPT_ALGSIM2(oldn, a, n, FS_OPT_PREDICATE);
return n;
}
ir_node *ra = get_Sub_right(a);
ir_node *blk = get_nodes_block(n);
- n = new_rd_Sub(get_irn_dbg_info(n), current_ir_graph, blk, ra, la, mode);
+ n = new_rd_Sub(get_irn_dbg_info(n), blk, ra, la, mode);
DBG_OPT_ALGSIM2(oldn, a, n, FS_OPT_MINUS_SUB);
return n;
}
if (tv != tarval_bad) {
ir_node *cnst = new_Const(tv);
dbg_info *dbg = get_irn_dbg_info(a);
- ir_graph *irg = current_ir_graph;
ir_node *block = get_nodes_block(a);
- n = new_rd_Mul(dbg, irg, block, mul_l, cnst, mode);
+ n = new_rd_Mul(dbg, block, mul_l, cnst, mode);
DBG_OPT_ALGSIM2(oldn, a, n, FS_OPT_MINUS_MUL_C);
return n;
}
n = new_rd_Const_type(NULL, current_ir_graph, get_Const_tarval(pred), tp);
DBG_OPT_CSTEVAL(oldn, n);
} else if (is_SymConst(pred) && get_SymConst_value_type(pred) != tp) {
- n = new_rd_SymConst_type(NULL, current_ir_graph, get_irn_n(pred, -1), get_irn_mode(pred),
+ n = new_rd_SymConst_type(NULL, current_ir_graph, get_irn_mode(pred),
get_SymConst_symbol(pred), get_SymConst_kind(pred), tp);
DBG_OPT_CSTEVAL(oldn, n);
}
return get_irg_bad(current_ir_graph);
} else {
ir_node *blk = get_nodes_block(load);
- return new_r_Jmp(current_ir_graph, blk);
+ return new_r_Jmp(blk);
}
}
}
return get_irg_bad(current_ir_graph);
} else {
ir_node *blk = get_nodes_block(store);
- return new_r_Jmp(current_ir_graph, blk);
+ return new_r_Jmp(blk);
}
}
}
proj_nr = get_Proj_proj(proj);
switch (proj_nr) {
case pn_Div_X_regular:
- return new_r_Jmp(current_ir_graph, get_irn_n(div, -1));
+ return new_r_Jmp(get_nodes_block(div));
case pn_Div_X_except:
/* we found an exception handler, remove it */
if (confirm) {
/* This node can only float up to the Confirm block */
- new_mem = new_r_Pin(current_ir_graph, get_nodes_block(confirm), new_mem);
+ new_mem = new_r_Pin(get_nodes_block(confirm), new_mem);
}
set_irn_pinned(div, op_pin_state_floats);
/* this is a Div without exception, we can remove the memory edge */
switch (proj_nr) {
case pn_Mod_X_regular:
- return new_r_Jmp(current_ir_graph, get_irn_n(mod, -1));
+ return new_r_Jmp(get_irn_n(mod, -1));
case pn_Mod_X_except:
/* we found an exception handler, remove it */
if (confirm) {
/* This node can only float up to the Confirm block */
- new_mem = new_r_Pin(current_ir_graph, get_nodes_block(confirm), new_mem);
+ new_mem = new_r_Pin(get_nodes_block(confirm), new_mem);
}
/* this is a Mod without exception, we can remove the memory edge */
set_Mod_mem(mod, new_mem);
switch (proj_nr) {
case pn_DivMod_X_regular:
- return new_r_Jmp(current_ir_graph, get_irn_n(divmod, -1));
+ return new_r_Jmp(get_nodes_block(divmod));
case pn_DivMod_X_except:
/* we found an exception handler, remove it */
if (confirm) {
/* This node can only float up to the Confirm block */
- new_mem = new_r_Pin(current_ir_graph, get_nodes_block(confirm), new_mem);
+ new_mem = new_r_Pin(get_nodes_block(confirm), new_mem);
}
/* this is a DivMod without exception, we can remove the memory edge */
set_DivMod_mem(divmod, new_mem);
if (smaller_mode(mode_left, mode) && smaller_mode(mode_right, mode)
&& mode_left != mode_b && mode_right != mode_b) {
- ir_graph *irg = current_ir_graph;
ir_node *block = get_nodes_block(n);
if (mode_left == mode_right) {
changed |= 1;
DBG_OPT_ALGSIM0(n, n, FS_OPT_CMP_CONV_CONV);
} else if (smaller_mode(mode_left, mode_right)) {
- left = new_r_Conv(irg, block, op_left, mode_right);
+ left = new_r_Conv(block, op_left, mode_right);
right = op_right;
changed |= 1;
DBG_OPT_ALGSIM0(n, n, FS_OPT_CMP_CONV);
} else if (smaller_mode(mode_right, mode_left)) {
left = op_left;
- right = new_r_Conv(irg, block, op_right, mode_left);
+ right = new_r_Conv(block, op_right, mode_left);
changed |= 1;
DBG_OPT_ALGSIM0(n, n, FS_OPT_CMP_CONV);
}
ir_node *llr = get_Shr_right(ll);
if (is_Const(llr)) {
- ir_graph *irg = current_ir_graph;
dbg_info *dbg = get_irn_dbg_info(left);
tarval *c1 = get_Const_tarval(llr);
tarval *mask = tarval_shl(c2, c1);
tarval *value = tarval_shl(c3, c1);
- left = new_rd_And(dbg, irg, block, get_Shr_left(ll), new_Const(mask), mode);
+ left = new_rd_And(dbg, block, get_Shr_left(ll), new_Const(mask), mode);
right = new_Const(value);
changed |= 1;
}
/* replace mode_b compares with ands/ors */
if (get_irn_mode(left) == mode_b) {
- ir_graph *irg = current_ir_graph;
ir_node *block = get_nodes_block(n);
ir_node *bres;
switch (proj_nr) {
- case pn_Cmp_Le: bres = new_r_Or( irg, block, new_r_Not(irg, block, left, mode_b), right, mode_b); break;
- case pn_Cmp_Lt: bres = new_r_And(irg, block, new_r_Not(irg, block, left, mode_b), right, mode_b); break;
- case pn_Cmp_Ge: bres = new_r_Or( irg, block, left, new_r_Not(irg, block, right, mode_b), mode_b); break;
- case pn_Cmp_Gt: bres = new_r_And(irg, block, left, new_r_Not(irg, block, right, mode_b), mode_b); break;
- case pn_Cmp_Lg: bres = new_r_Eor(irg, block, left, right, mode_b); break;
- case pn_Cmp_Eq: bres = new_r_Not(irg, block, new_r_Eor(irg, block, left, right, mode_b), mode_b); break;
+ case pn_Cmp_Le: bres = new_r_Or( block, new_r_Not(block, left, mode_b), right, mode_b); break;
+ case pn_Cmp_Lt: bres = new_r_And(block, new_r_Not(block, left, mode_b), right, mode_b); break;
+ case pn_Cmp_Ge: bres = new_r_Or( block, left, new_r_Not(block, right, mode_b), mode_b); break;
+ case pn_Cmp_Gt: bres = new_r_And(block, left, new_r_Not(block, right, mode_b), mode_b); break;
+ case pn_Cmp_Lg: bres = new_r_Eor(block, left, right, mode_b); break;
+ case pn_Cmp_Eq: bres = new_r_Not(block, new_r_Eor(block, left, right, mode_b), mode_b); break;
default: bres = NULL;
}
if (bres) {
}
sl = get_Shl_left(left);
blk = get_nodes_block(n);
- left = new_rd_And(get_irn_dbg_info(left), current_ir_graph, blk, sl, new_Const(amask), mode);
+ left = new_rd_And(get_irn_dbg_info(left), blk, sl, new_Const(amask), mode);
tv = tarval_shr(tv, tv1);
changed |= 2;
DBG_OPT_ALGSIM0(n, n, FS_OPT_CMP_SHF_TO_AND);
}
sl = get_Shr_left(left);
blk = get_nodes_block(n);
- left = new_rd_And(get_irn_dbg_info(left), current_ir_graph, blk, sl, new_Const(amask), mode);
+ left = new_rd_And(get_irn_dbg_info(left), blk, sl, new_Const(amask), mode);
tv = tarval_shl(tv, tv1);
changed |= 2;
DBG_OPT_ALGSIM0(n, n, FS_OPT_CMP_SHF_TO_AND);
}
sl = get_Shrs_left(left);
blk = get_nodes_block(n);
- left = new_rd_And(get_irn_dbg_info(left), current_ir_graph, blk, sl, new_Const(amask), mode);
+ left = new_rd_And(get_irn_dbg_info(left), blk, sl, new_Const(amask), mode);
tv = tarval_shl(tv, tv1);
changed |= 2;
DBG_OPT_ALGSIM0(n, n, FS_OPT_CMP_SHF_TO_AND);
ir_mode *mode = get_irn_mode(v);
tv = tarval_sub(tv, get_mode_one(mode), NULL);
- left = new_rd_And(get_irn_dbg_info(op), current_ir_graph, blk, v, new_Const(tv), mode);
+ left = new_rd_And(get_irn_dbg_info(op), blk, v, new_Const(tv), mode);
changed |= 1;
DBG_OPT_ALGSIM0(n, n, FS_OPT_CMP_MOD_TO_AND);
}
ir_node *block = get_nodes_block(n);
/* create a new compare */
- n = new_rd_Cmp(get_irn_dbg_info(n), current_ir_graph, block, left, right);
- proj = new_rd_Proj(get_irn_dbg_info(proj), current_ir_graph, block, n, get_irn_mode(proj), proj_nr);
+ n = new_rd_Cmp(get_irn_dbg_info(n), block, left, right);
+ proj = new_rd_Proj(get_irn_dbg_info(proj), block, n, get_irn_mode(proj), proj_nr);
}
return proj;
case pn_CopyB_X_regular:
/* Turn CopyB into a tuple (mem, jmp, bad, bad) */
DBG_OPT_EXC_REM(proj);
- proj = new_r_Jmp(current_ir_graph, get_nodes_block(copyb));
+ proj = new_r_Jmp(get_nodes_block(copyb));
break;
case pn_CopyB_M_except:
case pn_CopyB_X_except:
DBG_OPT_EXC_REM(proj);
- proj = get_irg_bad(current_ir_graph);
+ proj = get_irg_bad(get_irn_irg(proj));
break;
default:
break;
break;
case pn_Bound_X_except:
DBG_OPT_EXC_REM(proj);
- proj = get_irg_bad(current_ir_graph);
+ proj = get_irg_bad(get_irn_irg(proj));
break;
case pn_Bound_res:
proj = idx;
break;
case pn_Bound_X_regular:
DBG_OPT_EXC_REM(proj);
- proj = new_r_Jmp(current_ir_graph, get_nodes_block(bound));
+ proj = new_r_Jmp(get_nodes_block(bound));
break;
default:
break;
}
/* move the Confirm nodes "behind" the Phi */
block = get_irn_n(phi, -1);
- new_Phi = new_r_Phi(current_ir_graph, block, n, in, get_irn_mode(phi));
- return new_r_Confirm(current_ir_graph, block, new_Phi, bound, pnc);
+ new_Phi = new_r_Phi(block, n, in, get_irn_mode(phi));
+ return new_r_Confirm(block, new_Phi, bound, pnc);
}
}
return phi;
/* ok, all conditions met */
block = get_irn_n(or, -1);
- new_and = new_r_And(current_ir_graph, block,
- value, new_Const(tarval_and(tv4, tv2)), mode);
+ new_and = new_r_And(block, value, new_Const(tarval_and(tv4, tv2)), mode);
new_const = new_Const(tarval_or(tv3, tv1));
/* yet, condition met */
block = get_nodes_block(or);
- n = new_r_Rotl(current_ir_graph, block, x, c1, mode);
+ n = new_r_Rotl(block, x, c1, mode);
DBG_OPT_ALGSIM1(or, shl, shr, n, FS_OPT_OR_SHFT_TO_ROTL);
return n;
/* yet, condition met */
block = get_nodes_block(or);
- n = new_r_Rotl(current_ir_graph, block, x, rotval, mode);
+ n = new_r_Rotl(block, x, rotval, mode);
DBG_OPT_ALGSIM0(or, n, FS_OPT_OR_SHFT_TO_ROTL);
return n;
mode = get_irn_mode(n);
a = get_Not_op(a);
b = get_Not_op(b);
- n = new_rd_And(get_irn_dbg_info(n), current_ir_graph, block, a, b, mode);
- n = new_rd_Not(get_irn_dbg_info(n), current_ir_graph, block, n, mode);
+ n = new_rd_And(get_irn_dbg_info(n), block, a, b, mode);
+ n = new_rd_Not(get_irn_dbg_info(n), block, n, mode);
DBG_OPT_ALGSIM0(oldn, n, FS_OPT_DEMORGAN);
return n;
}
/* yes, we can simply calculate with pncs */
pn_Cmp new_pnc = pn_a | pn_b;
- return new_rd_Proj(dbgi, current_ir_graph, block, pred_a, mode_b,
- new_pnc);
+ return new_rd_Proj(dbgi, block, pred_a, mode_b, new_pnc);
}
}
dbg_info *dbgi = get_irn_dbg_info(n);
ir_mode *smode = get_irn_mode(right);
ir_node *cnst = new_Const_long(smode, get_mode_size_bits(mode) - 1);
- return new_rd_Shrs(dbgi, irg, block, get_binop_left(left),
- cnst, mode);
+ return new_rd_Shrs(dbgi, block, get_binop_left(left), cnst, mode);
}
return new_Const(get_mode_null(mode));
in[0] = get_binop_left(left);
in[1] = new_Const(res);
- irn = new_ir_node(NULL, current_ir_graph, block, get_irn_op(n), mode, 2, in);
+ irn = new_ir_node(NULL, get_Block_irg(block), block, get_irn_op(n), mode, 2, in);
DBG_OPT_ALGSIM0(n, irn, FS_OPT_REASSOC_SHIFT);
ir_node *bitop_left;
ir_node *bitop_right;
ir_op *op_left;
- ir_graph *irg;
ir_node *block;
dbg_info *dbgi;
ir_node *new_shift;
bitop_left = get_binop_left(left);
- irg = get_irn_irg(n);
block = get_nodes_block(n);
dbgi = get_irn_dbg_info(n);
tv1 = get_Const_tarval(bitop_right);
assert(get_tarval_mode(tv1) == mode);
if (is_Shl(n)) {
- new_shift = new_rd_Shl(dbgi, irg, block, bitop_left, right, mode);
+ new_shift = new_rd_Shl(dbgi, block, bitop_left, right, mode);
tv_shift = tarval_shl(tv1, tv2);
} else if(is_Shr(n)) {
- new_shift = new_rd_Shr(dbgi, irg, block, bitop_left, right, mode);
+ new_shift = new_rd_Shr(dbgi, block, bitop_left, right, mode);
tv_shift = tarval_shr(tv1, tv2);
} else if(is_Shrs(n)) {
- new_shift = new_rd_Shrs(dbgi, irg, block, bitop_left, right, mode);
+ new_shift = new_rd_Shrs(dbgi, block, bitop_left, right, mode);
tv_shift = tarval_shrs(tv1, tv2);
} else {
assert(is_Rotl(n));
- new_shift = new_rd_Rotl(dbgi, irg, block, bitop_left, right, mode);
+ new_shift = new_rd_Rotl(dbgi, block, bitop_left, right, mode);
tv_shift = tarval_rotl(tv1, tv2);
}
new_const = new_Const(tv_shift);
if (op_left == op_And) {
- new_bitop = new_rd_And(dbgi, irg, block, new_shift, new_const, mode);
+ new_bitop = new_rd_And(dbgi, block, new_shift, new_const, mode);
} else if(op_left == op_Or) {
- new_bitop = new_rd_Or(dbgi, irg, block, new_shift, new_const, mode);
+ new_bitop = new_rd_Or(dbgi, block, new_shift, new_const, mode);
} else {
assert(op_left == op_Eor);
- new_bitop = new_rd_Eor(dbgi, irg, block, new_shift, new_const, mode);
+ new_bitop = new_rd_Eor(dbgi, block, new_shift, new_const, mode);
}
return new_bitop;
tv_shift = tarval_sub(tv_shr, tv_shl, NULL);
new_const = new_Const(tv_shift);
if (need_shrs) {
- new_shift = new_rd_Shrs(dbgi, irg, block, x, new_const, mode);
+ new_shift = new_rd_Shrs(dbgi, block, x, new_const, mode);
} else {
- new_shift = new_rd_Shr(dbgi, irg, block, x, new_const, mode);
+ new_shift = new_rd_Shr(dbgi, block, x, new_const, mode);
}
} else {
assert(pnc == pn_Cmp_Gt);
tv_shift = tarval_sub(tv_shl, tv_shr, NULL);
new_const = new_Const(tv_shift);
- new_shift = new_rd_Shl(dbgi, irg, block, x, new_const, mode);
+ new_shift = new_rd_Shl(dbgi, block, x, new_const, mode);
}
new_const = new_Const(tv_mask);
- new_and = new_rd_And(dbgi, irg, block, new_shift, new_const, mode);
+ new_and = new_rd_And(dbgi, block, new_shift, new_const, mode);
return new_and;
}
ir_node *lop = get_Conv_op(l);
if(get_irn_mode(lop) == mode) {
/* ConvP(AddI(ConvI(P), x)) -> AddP(P, x) */
- n = new_rd_Add(dbgi, current_ir_graph, block, lop, r, mode);
+ n = new_rd_Add(dbgi, block, lop, r, mode);
return n;
}
}
ir_node *rop = get_Conv_op(r);
if(get_irn_mode(rop) == mode) {
/* ConvP(AddI(x, ConvI(P))) -> AddP(x, P) */
- n = new_rd_Add(dbgi, current_ir_graph, block, l, rop, mode);
+ n = new_rd_Add(dbgi, block, l, rop, mode);
return n;
}
}
ir_node* f1 = get_Mux_false(t);
if (f == f1) {
/* Mux(cond0, Mux(cond1, x, y), y) -> typical if (cond0 && cond1) x else y */
- ir_node* and_ = new_r_And(irg, block, c0, c1, mode_b);
- ir_node* new_mux = new_r_Mux(irg, block, and_, f1, t1, mode);
+ ir_node* and_ = new_r_And(block, c0, c1, mode_b);
+ ir_node* new_mux = new_r_Mux(block, and_, f1, t1, mode);
n = new_mux;
sel = and_;
f = f1;
DBG_OPT_ALGSIM0(oldn, t, FS_OPT_MUX_COMBINE);
} else if (f == t1) {
/* Mux(cond0, Mux(cond1, x, y), x) */
- ir_node* not_c1 = new_r_Not(irg, block, c1, mode_b);
- ir_node* and_ = new_r_And(irg, block, c0, not_c1, mode_b);
- ir_node* new_mux = new_r_Mux(irg, block, and_, t1, f1, mode);
+ ir_node* not_c1 = new_r_Not(block, c1, mode_b);
+ ir_node* and_ = new_r_And(block, c0, not_c1, mode_b);
+ ir_node* new_mux = new_r_Mux(block, and_, t1, f1, mode);
n = new_mux;
sel = and_;
f = t1;
ir_node* f1 = get_Mux_false(f);
if (t == t1) {
/* Mux(cond0, x, Mux(cond1, x, y)) -> typical if (cond0 || cond1) x else y */
- ir_node* or_ = new_r_Or(irg, block, c0, c1, mode_b);
- ir_node* new_mux = new_r_Mux(irg, block, or_, f1, t1, mode);
+ ir_node* or_ = new_r_Or(block, c0, c1, mode_b);
+ ir_node* new_mux = new_r_Mux(block, or_, f1, t1, mode);
n = new_mux;
sel = or_;
f = f1;
DBG_OPT_ALGSIM0(oldn, f, FS_OPT_MUX_COMBINE);
} else if (t == f1) {
/* Mux(cond0, x, Mux(cond1, y, x)) */
- ir_node* not_c1 = new_r_Not(irg, block, c1, mode_b);
- ir_node* or_ = new_r_Or(irg, block, c0, not_c1, mode_b);
- ir_node* new_mux = new_r_Mux(irg, block, or_, t1, f1, mode);
+ ir_node* not_c1 = new_r_Not(block, c1, mode_b);
+ ir_node* or_ = new_r_Or(block, c0, not_c1, mode_b);
+ ir_node* new_mux = new_r_Mux(block, or_, t1, f1, mode);
n = new_mux;
sel = or_;
f = t1;
/* Mux(x, 0, y) => Mux(x, y, 0) */
pn_Cmp pnc = get_Proj_proj(sel);
- sel = new_r_Proj(irg, get_nodes_block(cmp), cmp, mode_b,
+ sel = new_r_Proj(get_nodes_block(cmp), cmp, mode_b,
get_negated_pnc(pnc, get_irn_mode(get_Cmp_left(cmp))));
- n = new_rd_Mux(get_irn_dbg_info(n), irg, get_nodes_block(n), sel, t, f, mode);
+ n = new_rd_Mux(get_irn_dbg_info(n), get_nodes_block(n), sel, t, f, mode);
tmp = t;
t = f;
f = tmp;
if (mode == mode_b) {
dbg_info *dbg = get_irn_dbg_info(n);
ir_node *block = get_nodes_block(n);
- ir_graph *irg = current_ir_graph;
if (is_Const(t)) {
tarval *tv_t = get_Const_tarval(t);
return sel;
} else {
/* Muxb(sel, true, x) = Or(sel, x) */
- n = new_rd_Or(dbg, irg, block, sel, f, mode_b);
+ n = new_rd_Or(dbg, block, sel, f, mode_b);
DBG_OPT_ALGSIM0(oldn, n, FS_OPT_MUX_OR_BOOL);
return n;
}
tarval *tv_f = get_Const_tarval(f);
if (tv_f == tarval_b_true) {
/* Muxb(sel, x, true) = Or(Not(sel), x) */
- ir_node* not_sel = new_rd_Not(dbg, irg, block, sel, mode_b);
+ ir_node* not_sel = new_rd_Not(dbg, block, sel, mode_b);
DBG_OPT_ALGSIM0(oldn, n, FS_OPT_MUX_ORNOT_BOOL);
- n = new_rd_Or(dbg, irg, block, not_sel, t, mode_b);
+ n = new_rd_Or(dbg, block, not_sel, t, mode_b);
return n;
} else {
/* Muxb(sel, x, false) = And(sel, x) */
assert(tv_f == tarval_b_false);
- n = new_rd_And(dbg, irg, block, sel, t, mode_b);
+ n = new_rd_And(dbg, block, sel, t, mode_b);
DBG_OPT_ALGSIM0(oldn, n, FS_OPT_MUX_AND_BOOL);
return n;
}
if (tarval_is_one(a) && tarval_is_null(b)) {
ir_node *block = get_nodes_block(n);
- ir_node *conv = new_r_Conv(current_ir_graph, block, sel, mode);
+ ir_node *conv = new_r_Conv(block, sel, mode);
n = conv;
DBG_OPT_ALGSIM0(oldn, n, FS_OPT_MUX_CONV);
return n;
} else if (tarval_is_null(a) && tarval_is_one(b)) {
ir_node *block = get_nodes_block(n);
- ir_node *not_ = new_r_Not(current_ir_graph, block, sel, mode_b);
- ir_node *conv = new_r_Conv(current_ir_graph, block, not_, mode);
+ ir_node *not_ = new_r_Not(block, sel, mode_b);
+ ir_node *conv = new_r_Conv(block, not_, mode);
n = conv;
DBG_OPT_ALGSIM0(oldn, n, FS_OPT_MUX_CONV);
return n;
ir_node *block = get_nodes_block(n);
ir_node *t = new_Const(tarval_sub(a, min, NULL));
ir_node *f = new_Const(tarval_sub(b, min, NULL));
- n = new_rd_Mux(dbg, irg, block, sel, f, t, mode);
- n = new_rd_Add(dbg, irg, block, n, new_Const(min), mode);
+ n = new_rd_Mux(dbg, block, sel, f, t, mode);
+ n = new_rd_Add(dbg, block, n, new_Const(min), mode);
return n;
}
}
|| (cmp_l == f && (pn == pn_Cmp_Le || pn == pn_Cmp_Lt)))
{
/* Mux(a >/>= 0, a, -a) = Mux(a </<= 0, -a, a) ==> Abs(a) */
- n = new_rd_Abs(get_irn_dbg_info(n), current_ir_graph, block,
- cmp_l, mode);
+ n = new_rd_Abs(get_irn_dbg_info(n), block, cmp_l, mode);
DBG_OPT_ALGSIM1(oldn, cmp, sel, n, FS_OPT_MUX_TO_ABS);
return n;
} else if ((cmp_l == t && (pn == pn_Cmp_Le || pn == pn_Cmp_Lt))
|| (cmp_l == f && (pn == pn_Cmp_Ge || pn == pn_Cmp_Gt)))
{
/* Mux(a </<= 0, a, -a) = Mux(a >/>= 0, -a, a) ==> -Abs(a) */
- n = new_rd_Abs(get_irn_dbg_info(n), current_ir_graph, block,
- cmp_l, mode);
- n = new_rd_Minus(get_irn_dbg_info(n), current_ir_graph,
- block, n, mode);
+ n = new_rd_Abs(get_irn_dbg_info(n), block, cmp_l, mode);
+ n = new_rd_Minus(get_irn_dbg_info(n), block, n, mode);
DBG_OPT_ALGSIM1(oldn, cmp, sel, n, FS_OPT_MUX_TO_ABS);
return n;
}
DBG_OPT_ALGSIM1(oldn, cmp, sel, n, FS_OPT_MUX_TO_BITOP);
} else {
/* Mux((a & 2^C) == 0, 2^C, 0) */
- n = new_rd_Eor(get_irn_dbg_info(n), current_ir_graph,
+ n = new_rd_Eor(get_irn_dbg_info(n),
block, cmp_l, t, mode);
DBG_OPT_ALGSIM1(oldn, cmp, sel, n, FS_OPT_MUX_TO_BITOP);
}
DBG_OPT_ALGSIM1(oldn, cmp, sel, n, FS_OPT_MUX_TO_BITOP);
} else {
/* (a & (1 << n)) == 0, (1 << n), 0) */
- n = new_rd_Eor(get_irn_dbg_info(n), current_ir_graph,
+ n = new_rd_Eor(get_irn_dbg_info(n),
block, cmp_l, t, mode);
DBG_OPT_ALGSIM1(oldn, cmp, sel, n, FS_OPT_MUX_TO_BITOP);
}
DBG_OPT_ALGSIM1(oldn, cmp, sel, n, FS_OPT_MUX_TO_BITOP);
} else {
/* ((1 << n) & a) == 0, (1 << n), 0) */
- n = new_rd_Eor(get_irn_dbg_info(n), current_ir_graph,
+ n = new_rd_Eor(get_irn_dbg_info(n),
block, cmp_l, t, mode);
DBG_OPT_ALGSIM1(oldn, cmp, sel, n, FS_OPT_MUX_TO_BITOP);
}
db = get_irn_dbg_info(call);
bl = get_nodes_block(call);
- res = new_rd_Call(db, current_ir_graph, bl, mem, adr, n_param + 1, in, ctp);
+ res = new_rd_Call(db, bl, mem, adr, n_param + 1, in, ctp);
if (get_irn_pinned(call) == op_pin_state_floats)
set_irn_pinned(res, op_pin_state_floats);
return res;
unknown = new_r_Unknown(irg, mode_M);
cnst = new_r_Const_long(irg, mode_Iu, get_mode_size_bytes(mode_Iu) * id);
- offset = new_r_Add(irg, bb, address, cnst, get_modeP_data());
- load = new_r_Load(irg, bb, unknown, offset, mode_Iu, 0);
- projm = new_r_Proj(irg, bb, load, mode_M, pn_Load_M);
- proji = new_r_Proj(irg, bb, load, mode_Iu, pn_Load_res);
+ offset = new_r_Add(bb, address, cnst, get_modeP_data());
+ load = new_r_Load(bb, unknown, offset, mode_Iu, 0);
+ projm = new_r_Proj(bb, load, mode_M, pn_Load_M);
+ proji = new_r_Proj(bb, load, mode_Iu, pn_Load_res);
cnst = new_r_Const_long(irg, mode_Iu, 1);
- add = new_r_Add(irg, bb, proji, cnst, mode_Iu);
- store = new_r_Store(irg, bb, projm, offset, add, 0);
- projm = new_r_Proj(irg, bb, store, mode_M, pn_Store_M);
+ add = new_r_Add(bb, proji, cnst, mode_Iu);
+ store = new_r_Store(bb, projm, offset, add, 0);
+ projm = new_r_Proj(bb, store, mode_M, pn_Store_M);
set_irn_link(bb, projm);
set_irn_link(projm, load);
}
} else {
int n;
ir_node **ins;
- ir_graph *irg = current_ir_graph;
NEW_ARR_A(ir_node*, ins, arity);
for (n = arity - 1; n >= 0; --n) {
ins[n] = get_irn_link(get_Block_cfgpred_block(bb, n));
}
- mem = new_r_Phi(irg, bb, arity, ins, mode_M);
+ mem = new_r_Phi(bb, arity, ins, mode_M);
}
set_Load_mem(get_irn_link(get_irn_link(bb)), mem);
}
* void __firmprof_initializer(void) { __init_firmprof(ent_filename, bblock_id, bblock_counts, n_blocks); }
*/
static ir_graph *
-gen_initializer_irg(ir_entity * ent_filename, ir_entity * bblock_id, ir_entity * bblock_counts, int n_blocks)
+gen_initializer_irg(ir_entity *ent_filename, ir_entity *bblock_id, ir_entity *bblock_counts, int n_blocks)
{
- ir_node *start_block;
-
ir_node *ins[4];
ident *name = new_id_from_str("__firmprof_initializer");
ir_entity *ent = new_entity(get_glob_type(), name, new_type_method(name, 0, 0));
bb = get_cur_block();
- start_block = get_irg_start_block(irg);
-
sym.entity_p = init_ent;
- symconst = new_r_SymConst(irg, start_block, mode_P_data, sym, symconst_addr_ent);
+ symconst = new_r_SymConst(irg, mode_P_data, sym, symconst_addr_ent);
sym.entity_p = ent_filename;
- ins[0] = new_r_SymConst(irg, start_block, mode_P_data, sym, symconst_addr_ent);
+ ins[0] = new_r_SymConst(irg, mode_P_data, sym, symconst_addr_ent);
sym.entity_p = bblock_id;
- ins[1] = new_r_SymConst(irg, start_block, mode_P_data, sym, symconst_addr_ent);
+ ins[1] = new_r_SymConst(irg, mode_P_data, sym, symconst_addr_ent);
sym.entity_p = bblock_counts;
- ins[2] = new_r_SymConst(irg, start_block, mode_P_data, sym, symconst_addr_ent);
+ ins[2] = new_r_SymConst(irg, mode_P_data, sym, symconst_addr_ent);
ins[3] = new_r_Const_long(irg, mode_Iu, n_blocks);
- call = new_r_Call(irg, bb, get_irg_initial_mem(irg), symconst, 4, ins, init_type);
- ret = new_r_Return(irg, bb, new_r_Proj(irg, bb, call, mode_M, pn_Call_M_regular), 0, NULL);
+ call = new_r_Call(bb, get_irg_initial_mem(irg), symconst, 4, ins, init_type);
+ ret = new_r_Return(bb, new_r_Proj(bb, call, mode_M, pn_Call_M_regular), 0, NULL);
mature_immBlock(bb);
add_immBlock_pred(get_irg_end_block(irg), ret);
/* generate a symbolic constant pointing to the count array */
sym.entity_p = bblock_counts;
- wd.symconst = new_r_SymConst(irg, get_irg_start_block(irg), mode_P_data, sym, symconst_addr_ent);
+ wd.symconst = new_r_SymConst(irg, mode_P_data, sym, symconst_addr_ent);
irg_block_walk_graph(irg, block_id_walker, NULL, &wd);
start_block = get_irg_start_block(irg);
case iro_Return:
ins[0] = get_irn_link(bb);
ins[1] = get_Return_mem(node);
- sync = new_r_Sync(irg, bb, 2, ins);
+ sync = new_r_Sync(bb, 2, ins);
set_Return_mem(node, sync);
break;
case iro_Raise:
ins[0] = get_irn_link(bb);
ins[1] = get_Raise_mem(node);
- sync = new_r_Sync(irg, bb, 2, ins);
+ sync = new_r_Sync(bb, 2, ins);
set_Raise_mem(node, sync);
break;
default:
}
}
return new_r_simpleSel(
- irg,
block,
get_irg_no_mem(irg),
get_irg_frame(irg),
turn_into_tuple(p, pn_CopyB_max);
set_Tuple_pred(p, pn_CopyB_M_regular, mem);
set_Tuple_pred(p, pn_CopyB_M_except, get_irg_bad(irg));
- set_Tuple_pred(p, pn_CopyB_X_regular, new_r_Jmp(irg, blk));
+ set_Tuple_pred(p, pn_CopyB_X_regular, new_r_Jmp(blk));
set_Tuple_pred(p, pn_CopyB_X_except, get_irg_bad(irg));
++n_args;
}
if (is_compound_type(tp)) {
ir_node *arg = get_irg_args(irg);
- arg = new_r_Proj(irg, get_nodes_block(arg), arg, mode_P_data, env.first_hidden + k);
+ arg = new_r_Proj(get_nodes_block(arg), arg, mode_P_data, env.first_hidden + k);
++k;
if (is_Unknown(pred)) {
++n_cr_opt;
} else { /* copy-return optimization is impossible, do the copy. */
copy = new_r_CopyB(
- irg, bl,
+ bl,
mem,
arg,
pred,
tp
);
- mem = new_r_Proj(irg, bl, copy, mode_M, pn_CopyB_M_regular);
+ mem = new_r_Proj(bl, copy, mode_M, pn_CopyB_M_regular);
}
}
if (lp->flags & LF_RETURN_HIDDEN) {
ir_node *store_mem;
addr_const = new_r_Const_long(irg, mode_Iu, offset);
- add = new_r_Add(irg, block, addr_src, addr_const, addr_mode);
+ add = new_r_Add(block, addr_src, addr_const, addr_mode);
- load = new_r_Load(irg, block, mem, add, mode, 0);
- load_res = new_r_Proj(irg, block, load, mode, pn_Load_res);
- load_mem = new_r_Proj(irg, block, load, mode_M, pn_Load_M);
+ load = new_r_Load(block, mem, add, mode, 0);
+ load_res = new_r_Proj(block, load, mode, pn_Load_res);
+ load_mem = new_r_Proj(block, load, mode_M, pn_Load_M);
addr_const = new_r_Const_long(irg, mode_Iu, offset);
- add = new_r_Add(irg, block, addr_dst, addr_const, addr_mode);
+ add = new_r_Add(block, addr_dst, addr_const, addr_mode);
- store = new_r_Store(irg, block, load_mem, add, load_res, 0);
- store_mem = new_r_Proj(irg, block, store, mode_M, pn_Store_M);
+ store = new_r_Store(block, load_mem, add, load_res, 0);
+ store_mem = new_r_Proj(block, store, mode_M, pn_Store_M);
mem = store_mem;
}
if (env->params->little_endian) {
low = adr;
- high = new_r_Add(irg, block, adr,
- new_r_Const(irg, env->tv_mode_bytes),
- get_irn_mode(adr));
+ high = new_r_Add(block, adr, new_r_Const(irg, env->tv_mode_bytes), get_irn_mode(adr));
} else {
- low = new_r_Add(irg, block, adr,
- new_r_Const(irg, env->tv_mode_bytes),
- get_irn_mode(adr));
+ low = new_r_Add(block, adr, new_r_Const(irg, env->tv_mode_bytes), get_irn_mode(adr));
high = adr;
} /* if */
/* create two loads */
dbg = get_irn_dbg_info(node);
- low = new_rd_Load(dbg, irg, block, mem, low, low_mode, volatility);
- proj = new_r_Proj(irg, block, low, mode_M, pn_Load_M);
- high = new_rd_Load(dbg, irg, block, proj, high, mode, volatility);
+ low = new_rd_Load(dbg, block, mem, low, low_mode, volatility);
+ proj = new_r_Proj(block, low, mode_M, pn_Load_M);
+ high = new_rd_Load(dbg, block, proj, high, mode, volatility);
idx = get_irn_idx(node);
assert(idx < env->n_entries);
break;
case pn_Load_res: /* Result of load operation. */
assert(idx < env->n_entries);
- env->entries[idx]->low_word = new_r_Proj(irg, block, low, low_mode, pn_Load_res);
- env->entries[idx]->high_word = new_r_Proj(irg, block, high, mode, pn_Load_res);
+ env->entries[idx]->low_word = new_r_Proj(block, low, low_mode, pn_Load_res);
+ env->entries[idx]->high_word = new_r_Proj(block, high, mode, pn_Load_res);
break;
default:
assert(0 && "unexpected Proj number");
if (env->params->little_endian) {
low = adr;
- high = new_r_Add(irg, block, adr,
- new_r_Const(irg, env->tv_mode_bytes),
- get_irn_mode(adr));
+ high = new_r_Add(block, adr, new_r_Const(irg, env->tv_mode_bytes), get_irn_mode(adr));
} else {
- low = new_r_Add(irg, block, adr,
- new_r_Const(irg, env->tv_mode_bytes),
- get_irn_mode(adr));
+ low = new_r_Add(block, adr, new_r_Const(irg, env->tv_mode_bytes), get_irn_mode(adr));
high = adr;
} /* if */
/* create two Stores */
dbg = get_irn_dbg_info(node);
- low = new_rd_Store(dbg, irg, block, mem, low, entry->low_word, volatility);
- proj = new_r_Proj(irg, block, low, mode_M, pn_Store_M);
- high = new_rd_Store(dbg, irg, block, proj, high, entry->high_word, volatility);
+ low = new_rd_Store(dbg, block, mem, low, entry->low_word, volatility);
+ proj = new_r_Proj(block, low, mode_M, pn_Store_M);
+ high = new_rd_Store(dbg, block, proj, high, entry->high_word, volatility);
idx = get_irn_idx(node);
assert(idx < env->n_entries);
ent = entry->ent;
} /* if */
sym.entity_p = ent;
- return new_r_SymConst(current_ir_graph, block, mode_P_code, sym, symconst_addr_ent);
+ return new_r_SymConst(current_ir_graph, mode_P_code, sym, symconst_addr_ent);
} /* get_intrinsic_address */
/**
dbg_info *dbg;
ir_type *mtp;
int idx;
- ir_graph *irg;
node_entry_t *entry;
irn = get_Div_left(node);
dbg = get_irn_dbg_info(node);
block = get_nodes_block(node);
- irg = current_ir_graph;
mtp = mode_is_signed(mode) ? binop_tp_s : binop_tp_u;
opmode = get_irn_op_mode(node);
irn = get_intrinsic_address(mtp, get_irn_op(node), opmode, opmode, block, env);
- call = new_rd_Call(dbg, irg, block, get_Div_mem(node),
- irn, 4, in, mtp);
+ call = new_rd_Call(dbg, block, get_Div_mem(node), irn, 4, in, mtp);
set_irn_pinned(call, get_irn_pinned(node));
- irn = new_r_Proj(irg, block, call, mode_T, pn_Call_T_result);
+ irn = new_r_Proj(block, call, mode_T, pn_Call_T_result);
for (proj = get_irn_link(node); proj; proj = get_irn_link(proj)) {
switch (get_Proj_proj(proj)) {
case pn_Div_res: /* Result of computation. */
idx = get_irn_idx(proj);
assert(idx < env->n_entries);
- env->entries[idx]->low_word = new_r_Proj(current_ir_graph, block, irn, env->params->low_unsigned, 0);
- env->entries[idx]->high_word = new_r_Proj(current_ir_graph, block, irn, mode, 1);
+ env->entries[idx]->low_word = new_r_Proj(block, irn, env->params->low_unsigned, 0);
+ env->entries[idx]->high_word = new_r_Proj(block, irn, mode, 1);
break;
default:
assert(0 && "unexpected Proj number");
dbg_info *dbg;
ir_type *mtp;
int idx;
- ir_graph *irg;
node_entry_t *entry;
irn = get_Mod_left(node);
dbg = get_irn_dbg_info(node);
block = get_nodes_block(node);
- irg = current_ir_graph;
mtp = mode_is_signed(mode) ? binop_tp_s : binop_tp_u;
opmode = get_irn_op_mode(node);
irn = get_intrinsic_address(mtp, get_irn_op(node), opmode, opmode, block, env);
- call = new_rd_Call(dbg, irg, block, get_Mod_mem(node),
- irn, 4, in, mtp);
+ call = new_rd_Call(dbg, block, get_Mod_mem(node), irn, 4, in, mtp);
set_irn_pinned(call, get_irn_pinned(node));
- irn = new_r_Proj(irg, block, call, mode_T, pn_Call_T_result);
+ irn = new_r_Proj(block, call, mode_T, pn_Call_T_result);
for (proj = get_irn_link(node); proj; proj = get_irn_link(proj)) {
switch (get_Proj_proj(proj)) {
case pn_Mod_res: /* Result of computation. */
idx = get_irn_idx(proj);
assert(idx < env->n_entries);
- env->entries[idx]->low_word = new_r_Proj(irg, block, irn, env->params->low_unsigned, 0);
- env->entries[idx]->high_word = new_r_Proj(irg, block, irn, mode, 1);
+ env->entries[idx]->low_word = new_r_Proj(block, irn, env->params->low_unsigned, 0);
+ env->entries[idx]->high_word = new_r_Proj(block, irn, mode, 1);
break;
default:
assert(0 && "unexpected Proj number");
int idx;
node_entry_t *entry;
unsigned flags = 0;
- ir_graph *irg;
/* check if both results are needed */
for (proj = get_irn_link(node); proj; proj = get_irn_link(proj)) {
dbg = get_irn_dbg_info(node);
block = get_nodes_block(node);
- irg = current_ir_graph;
mem = get_DivMod_mem(node);
if (flags & 1) {
opmode = get_irn_op_mode(node);
irn = get_intrinsic_address(mtp, op_Div, opmode, opmode, block, env);
- callDiv = new_rd_Call(dbg, irg, block, mem,
- irn, 4, in, mtp);
+ callDiv = new_rd_Call(dbg, block, mem, irn, 4, in, mtp);
set_irn_pinned(callDiv, get_irn_pinned(node));
- resDiv = new_r_Proj(irg, block, callDiv, mode_T, pn_Call_T_result);
+ resDiv = new_r_Proj(block, callDiv, mode_T, pn_Call_T_result);
} /* if */
if (flags & 2) {
if (flags & 1)
- mem = new_r_Proj(irg, block, callDiv, mode_M, pn_Call_M);
+ mem = new_r_Proj(block, callDiv, mode_M, pn_Call_M);
opmode = get_irn_op_mode(node);
irn = get_intrinsic_address(mtp, op_Mod, opmode, opmode, block, env);
- callMod = new_rd_Call(dbg, irg, block, mem,
- irn, 4, in, mtp);
+ callMod = new_rd_Call(dbg, block, mem, irn, 4, in, mtp);
set_irn_pinned(callMod, get_irn_pinned(node));
- resMod = new_r_Proj(irg, block, callMod, mode_T, pn_Call_T_result);
+ resMod = new_r_Proj(block, callMod, mode_T, pn_Call_T_result);
} /* if */
for (proj = get_irn_link(node); proj; proj = get_irn_link(proj)) {
case pn_DivMod_res_div: /* Result of Div. */
idx = get_irn_idx(proj);
assert(idx < env->n_entries);
- env->entries[idx]->low_word = new_r_Proj(irg, block, resDiv, env->params->low_unsigned, 0);
- env->entries[idx]->high_word = new_r_Proj(irg, block, resDiv, mode, 1);
+ env->entries[idx]->low_word = new_r_Proj(block, resDiv, env->params->low_unsigned, 0);
+ env->entries[idx]->high_word = new_r_Proj(block, resDiv, mode, 1);
break;
case pn_DivMod_res_mod: /* Result of Mod. */
idx = get_irn_idx(proj);
- env->entries[idx]->low_word = new_r_Proj(irg, block, resMod, env->params->low_unsigned, 0);
- env->entries[idx]->high_word = new_r_Proj(irg, block, resMod, mode, 1);
+ env->entries[idx]->low_word = new_r_Proj(block, resMod, env->params->low_unsigned, 0);
+ env->entries[idx]->high_word = new_r_Proj(block, resMod, mode, 1);
break;
default:
assert(0 && "unexpected Proj number");
mtp = mode_is_signed(mode) ? binop_tp_s : binop_tp_u;
irn = get_intrinsic_address(mtp, get_irn_op(node), mode, mode, block, env);
- irn = new_rd_Call(dbg, irg, block, get_irg_no_mem(current_ir_graph),
+ irn = new_rd_Call(dbg, block, get_irg_no_mem(current_ir_graph),
irn, 4, in, mtp);
set_irn_pinned(irn, get_irn_pinned(node));
- irn = new_r_Proj(irg, block, irn, mode_T, pn_Call_T_result);
+ irn = new_r_Proj(block, irn, mode_T, pn_Call_T_result);
idx = get_irn_idx(node);
assert(idx < env->n_entries);
- env->entries[idx]->low_word = new_r_Proj(irg, block, irn, env->params->low_unsigned, 0);
- env->entries[idx]->high_word = new_r_Proj(irg, block, irn, mode, 1);
+ env->entries[idx]->low_word = new_r_Proj(block, irn, env->params->low_unsigned, 0);
+ env->entries[idx]->high_word = new_r_Proj(block, irn, mode, 1);
} /* lower_Binop */
/**
mtp = mode_is_signed(mode) ? shiftop_tp_s : shiftop_tp_u;
irn = get_intrinsic_address(mtp, get_irn_op(node), mode, mode, block, env);
- irn = new_rd_Call(dbg, irg, block, get_irg_no_mem(current_ir_graph),
+ irn = new_rd_Call(dbg, block, get_irg_no_mem(current_ir_graph),
irn, 3, in, mtp);
set_irn_pinned(irn, get_irn_pinned(node));
- irn = new_r_Proj(irg, block, irn, mode_T, pn_Call_T_result);
+ irn = new_r_Proj(block, irn, mode_T, pn_Call_T_result);
idx = get_irn_idx(node);
assert(idx < env->n_entries);
- env->entries[idx]->low_word = new_r_Proj(irg, block, irn, env->params->low_unsigned, 0);
- env->entries[idx]->high_word = new_r_Proj(irg, block, irn, mode, 1);
+ env->entries[idx]->low_word = new_r_Proj(block, irn, env->params->low_unsigned, 0);
+ env->entries[idx]->high_word = new_r_Proj(block, irn, mode, 1);
} /* lower_Shiftop */
/**
if (shf_cnt > 0) {
c = new_r_Const_long(irg, env->params->low_unsigned, shf_cnt);
- env->entries[idx]->low_word = new_r_Shr(irg, block, left, c, mode);
+ env->entries[idx]->low_word = new_r_Shr(block, left, c, mode);
} else {
env->entries[idx]->low_word = left;
} /* if */
long shf_cnt = get_tarval_long(tv) - get_mode_size_bits(mode);
int idx = get_irn_idx(left);
- left = new_r_Conv(irg, block, env->entries[idx]->low_word, mode);
+ left = new_r_Conv(block, env->entries[idx]->low_word, mode);
idx = get_irn_idx(node);
mode_l = env->params->low_unsigned;
if (shf_cnt > 0) {
c = new_r_Const_long(irg, mode_l, shf_cnt);
- env->entries[idx]->high_word = new_r_Shl(irg, block, left, c, mode);
+ env->entries[idx]->high_word = new_r_Shl(block, left, c, mode);
} else {
env->entries[idx]->high_word = left;
} /* if */
mode_l = env->params->low_unsigned;
if (shf_cnt > 0) {
c = new_r_Const_long(irg, mode_l, shf_cnt);
- low = new_r_Shrs(irg, block, left, c, mode);
+ low = new_r_Shrs(block, left, c, mode);
} else {
low = left;
} /* if */
/* low word is expected to have mode_l */
- env->entries[idx]->low_word = new_r_Conv(irg, block, low, mode_l);
+ env->entries[idx]->low_word = new_r_Conv(block, low, mode_l);
c = new_r_Const_long(irg, mode_l, get_mode_size_bits(mode) - 1);
- env->entries[idx]->high_word = new_r_Shrs(irg, block, left, c, mode);
+ env->entries[idx]->high_word = new_r_Shrs(block, left, c, mode);
return;
} /* if */
ir_node *right = get_Rotl_right(node);
ir_node *left, *shl, *shr, *or, *block, *sub, *c;
ir_mode *omode, *rmode;
- ir_graph *irg;
dbg_info *dbg;
optimization_state_t state;
dbg = get_irn_dbg_info(node);
omode = get_irn_mode(node);
left = get_Rotl_left(node);
- irg = current_ir_graph;
block = get_nodes_block(node);
- shl = new_rd_Shl(dbg, irg, block, left, right, omode);
+ shl = new_rd_Shl(dbg, block, left, right, omode);
rmode = get_irn_mode(right);
c = new_Const_long(rmode, get_mode_size_bits(omode));
- sub = new_rd_Sub(dbg, irg, block, c, right, rmode);
- shr = new_rd_Shr(dbg, irg, block, left, sub, omode);
+ sub = new_rd_Sub(dbg, block, c, right, rmode);
+ shr = new_rd_Shr(dbg, block, left, sub, omode);
/* optimization must be switched off here, or we will get the Rotl back */
save_optimization_state(&state);
set_opt_algebraic_simplification(0);
- or = new_rd_Or(dbg, irg, block, shl, shr, omode);
+ or = new_rd_Or(dbg, block, shl, shr, omode);
restore_optimization_state(&state);
exchange(node, or);
dbg_info *dbg;
ir_type *mtp;
int idx;
- ir_graph *irg;
node_entry_t *entry;
irn = get_unop_op(node);
dbg = get_irn_dbg_info(node);
block = get_nodes_block(node);
- irg = current_ir_graph;
mtp = mode_is_signed(mode) ? unop_tp_s : unop_tp_u;
irn = get_intrinsic_address(mtp, get_irn_op(node), mode, mode, block, env);
- irn = new_rd_Call(dbg, irg, block, get_irg_no_mem(current_ir_graph),
+ irn = new_rd_Call(dbg, block, get_irg_no_mem(current_ir_graph),
irn, 2, in, mtp);
set_irn_pinned(irn, get_irn_pinned(node));
- irn = new_r_Proj(irg, block, irn, mode_T, pn_Call_T_result);
+ irn = new_r_Proj(block, irn, mode_T, pn_Call_T_result);
idx = get_irn_idx(node);
assert(idx < env->n_entries);
- env->entries[idx]->low_word = new_r_Proj(irg, block, irn, env->params->low_unsigned, 0);
- env->entries[idx]->high_word = new_r_Proj(irg, block, irn, mode, 1);
+ env->entries[idx]->low_word = new_r_Proj(block, irn, env->params->low_unsigned, 0);
+ env->entries[idx]->high_word = new_r_Proj(block, irn, mode, 1);
} /* lower_Unop */
/**
* Create two logical Binops.
*/
static void lower_Binop_logical(ir_node *node, ir_mode *mode, lower_env_t *env,
- ir_node *(*constr_rd)(dbg_info *db, ir_graph *irg, ir_node *block, ir_node *op1, ir_node *op2, ir_mode *mode) ) {
+ ir_node *(*constr_rd)(dbg_info *db, ir_node *block, ir_node *op1, ir_node *op2, ir_mode *mode) ) {
ir_node *block, *irn;
ir_node *lop_l, *lop_h, *rop_l, *rop_h;
dbg_info *dbg;
idx = get_irn_idx(node);
assert(idx < env->n_entries);
irg = current_ir_graph;
- env->entries[idx]->low_word = constr_rd(dbg, irg, block, lop_l, rop_l, env->params->low_unsigned);
- env->entries[idx]->high_word = constr_rd(dbg, irg, block, lop_h, rop_h, mode);
+ env->entries[idx]->low_word = constr_rd(dbg, block, lop_l, rop_l, env->params->low_unsigned);
+ env->entries[idx]->high_word = constr_rd(dbg, block, lop_h, rop_h, mode);
} /* lower_Binop_logical */
/** create a logical operation transformation */
ir_node *op_l, *op_h;
dbg_info *dbg;
int idx;
- ir_graph *irg;
node_entry_t *entry;
irn = get_Not_op(node);
dbg = get_irn_dbg_info(node);
block = get_nodes_block(node);
- irg = current_ir_graph;
idx = get_irn_idx(node);
assert(idx < env->n_entries);
- env->entries[idx]->low_word = new_rd_Not(dbg, current_ir_graph, block, op_l, env->params->low_unsigned);
- env->entries[idx]->high_word = new_rd_Not(dbg, current_ir_graph, block, op_h, mode);
+ env->entries[idx]->low_word = new_rd_Not(dbg, block, op_l, env->params->low_unsigned);
+ env->entries[idx]->high_word = new_rd_Not(dbg, block, op_h, mode);
} /* lower_Not */
/**
ir_node *new_bl, *cmpH, *cmpL, *irn;
ir_node *projHF, *projHT;
ir_node *dst_blk;
- ir_graph *irg;
pn_Cmp pnc;
+ ir_graph *irg;
dbg_info *dbg;
if(!is_Proj(sel))
/* create a new high compare */
block = get_nodes_block(node);
+ irg = get_Block_irg(block);
dbg = get_irn_dbg_info(cmp);
- irg = current_ir_graph;
pnc = get_Proj_proj(sel);
if (is_Const(right) && is_Const_null(right)) {
if (pnc == pn_Cmp_Eq || pnc == pn_Cmp_Lg) {
/* x ==/!= 0 ==> or(low,high) ==/!= 0 */
ir_mode *mode = env->params->low_unsigned;
- ir_node *low = new_r_Conv(irg, block, lentry->low_word, mode);
- ir_node *high = new_r_Conv(irg, block, lentry->high_word, mode);
- ir_node *or = new_rd_Or(dbg, irg, block, low, high, mode);
- ir_node *cmp = new_rd_Cmp(dbg, irg, block, or, new_Const_long(mode, 0));
+ ir_node *low = new_r_Conv(block, lentry->low_word, mode);
+ ir_node *high = new_r_Conv(block, lentry->high_word, mode);
+ ir_node *or = new_rd_Or(dbg, block, low, high, mode);
+ ir_node *cmp = new_rd_Cmp(dbg, block, or, new_Const_long(mode, 0));
- ir_node *proj = new_r_Proj(irg, block, cmp, mode_b, pnc);
+ ir_node *proj = new_r_Proj(block, cmp, mode_b, pnc);
set_Cond_selector(node, proj);
return;
}
}
- cmpH = new_rd_Cmp(dbg, irg, block, lentry->high_word, rentry->high_word);
+ cmpH = new_rd_Cmp(dbg, block, lentry->high_word, rentry->high_word);
if (pnc == pn_Cmp_Eq) {
/* simple case:a == b <==> a_h == b_h && a_l == b_l */
assert(entry);
dst_blk = entry->value;
- irn = new_r_Proj(irg, block, cmpH, mode_b, pn_Cmp_Eq);
+ irn = new_r_Proj(block, cmpH, mode_b, pn_Cmp_Eq);
dbg = get_irn_dbg_info(node);
- irn = new_rd_Cond(dbg, irg, block, irn);
+ irn = new_rd_Cond(dbg, block, irn);
- projHF = new_r_Proj(irg, block, irn, mode_X, pn_Cond_false);
+ projHF = new_r_Proj(block, irn, mode_X, pn_Cond_false);
mark_irn_visited(projHF);
exchange(projF, projHF);
- projHT = new_r_Proj(irg, block, irn, mode_X, pn_Cond_true);
+ projHT = new_r_Proj(block, irn, mode_X, pn_Cond_true);
mark_irn_visited(projHT);
new_bl = new_r_Block(irg, 1, &projHT);
dbg = get_irn_dbg_info(cmp);
- cmpL = new_rd_Cmp(dbg, irg, new_bl, lentry->low_word, rentry->low_word);
- irn = new_r_Proj(irg, new_bl, cmpL, mode_b, pn_Cmp_Eq);
+ cmpL = new_rd_Cmp(dbg, new_bl, lentry->low_word, rentry->low_word);
+ irn = new_r_Proj(new_bl, cmpL, mode_b, pn_Cmp_Eq);
dbg = get_irn_dbg_info(node);
- irn = new_rd_Cond(dbg, irg, new_bl, irn);
+ irn = new_rd_Cond(dbg, new_bl, irn);
- proj = new_r_Proj(irg, new_bl, irn, mode_X, pn_Cond_false);
+ proj = new_r_Proj(new_bl, irn, mode_X, pn_Cond_false);
mark_irn_visited(proj);
add_block_cf_input(dst_blk, projHF, proj);
- proj = new_r_Proj(irg, new_bl, irn, mode_X, pn_Cond_true);
+ proj = new_r_Proj(new_bl, irn, mode_X, pn_Cond_true);
mark_irn_visited(proj);
exchange(projT, proj);
} else if (pnc == pn_Cmp_Lg) {
assert(entry);
dst_blk = entry->value;
- irn = new_r_Proj(irg, block, cmpH, mode_b, pn_Cmp_Lg);
+ irn = new_r_Proj(block, cmpH, mode_b, pn_Cmp_Lg);
dbg = get_irn_dbg_info(node);
- irn = new_rd_Cond(dbg, irg, block, irn);
+ irn = new_rd_Cond(dbg, block, irn);
- projHT = new_r_Proj(irg, block, irn, mode_X, pn_Cond_true);
+ projHT = new_r_Proj(block, irn, mode_X, pn_Cond_true);
mark_irn_visited(projHT);
exchange(projT, projHT);
- projHF = new_r_Proj(irg, block, irn, mode_X, pn_Cond_false);
+ projHF = new_r_Proj(block, irn, mode_X, pn_Cond_false);
mark_irn_visited(projHF);
new_bl = new_r_Block(irg, 1, &projHF);
dbg = get_irn_dbg_info(cmp);
- cmpL = new_rd_Cmp(dbg, irg, new_bl, lentry->low_word, rentry->low_word);
- irn = new_r_Proj(irg, new_bl, cmpL, mode_b, pn_Cmp_Lg);
+ cmpL = new_rd_Cmp(dbg, new_bl, lentry->low_word, rentry->low_word);
+ irn = new_r_Proj(new_bl, cmpL, mode_b, pn_Cmp_Lg);
dbg = get_irn_dbg_info(node);
- irn = new_rd_Cond(dbg, irg, new_bl, irn);
+ irn = new_rd_Cond(dbg, new_bl, irn);
- proj = new_r_Proj(irg, new_bl, irn, mode_X, pn_Cond_true);
+ proj = new_r_Proj(new_bl, irn, mode_X, pn_Cond_true);
mark_irn_visited(proj);
add_block_cf_input(dst_blk, projHT, proj);
- proj = new_r_Proj(irg, new_bl, irn, mode_X, pn_Cond_false);
+ proj = new_r_Proj(new_bl, irn, mode_X, pn_Cond_false);
mark_irn_visited(proj);
exchange(projF, proj);
} else {
assert(entry);
dstF = entry->value;
- irn = new_r_Proj(irg, block, cmpH, mode_b, pnc & ~pn_Cmp_Eq);
+ irn = new_r_Proj(block, cmpH, mode_b, pnc & ~pn_Cmp_Eq);
dbg = get_irn_dbg_info(node);
- irn = new_rd_Cond(dbg, irg, block, irn);
+ irn = new_rd_Cond(dbg, block, irn);
- projHT = new_r_Proj(irg, block, irn, mode_X, pn_Cond_true);
+ projHT = new_r_Proj(block, irn, mode_X, pn_Cond_true);
mark_irn_visited(projHT);
exchange(projT, projHT);
projT = projHT;
- projHF = new_r_Proj(irg, block, irn, mode_X, pn_Cond_false);
+ projHF = new_r_Proj(block, irn, mode_X, pn_Cond_false);
mark_irn_visited(projHF);
newbl_eq = new_r_Block(irg, 1, &projHF);
- irn = new_r_Proj(irg, block, cmpH, mode_b, pn_Cmp_Eq);
- irn = new_rd_Cond(dbg, irg, newbl_eq, irn);
+ irn = new_r_Proj(block, cmpH, mode_b, pn_Cmp_Eq);
+ irn = new_rd_Cond(dbg, newbl_eq, irn);
- proj = new_r_Proj(irg, newbl_eq, irn, mode_X, pn_Cond_false);
+ proj = new_r_Proj(newbl_eq, irn, mode_X, pn_Cond_false);
mark_irn_visited(proj);
exchange(projF, proj);
projF = proj;
- proj = new_r_Proj(irg, newbl_eq, irn, mode_X, pn_Cond_true);
+ proj = new_r_Proj(newbl_eq, irn, mode_X, pn_Cond_true);
mark_irn_visited(proj);
newbl_l = new_r_Block(irg, 1, &proj);
dbg = get_irn_dbg_info(cmp);
- cmpL = new_rd_Cmp(dbg, irg, newbl_l, lentry->low_word, rentry->low_word);
- irn = new_r_Proj(irg, newbl_l, cmpL, mode_b, pnc);
+ cmpL = new_rd_Cmp(dbg, newbl_l, lentry->low_word, rentry->low_word);
+ irn = new_r_Proj(newbl_l, cmpL, mode_b, pnc);
dbg = get_irn_dbg_info(node);
- irn = new_rd_Cond(dbg, irg, newbl_l, irn);
+ irn = new_rd_Cond(dbg, newbl_l, irn);
- proj = new_r_Proj(irg, newbl_l, irn, mode_X, pn_Cond_true);
+ proj = new_r_Proj(newbl_l, irn, mode_X, pn_Cond_true);
mark_irn_visited(proj);
add_block_cf_input(dstT, projT, proj);
- proj = new_r_Proj(irg, newbl_l, irn, mode_X, pn_Cond_false);
+ proj = new_r_Proj(newbl_l, irn, mode_X, pn_Cond_false);
mark_irn_visited(proj);
add_block_cf_input(dstF, projF, proj);
} /* if */
pdeq_putr(env->waitq, node);
return;
} /* if */
- env->entries[idx]->low_word = new_rd_Conv(dbg, irg, block, env->entries[op_idx]->low_word, dst_mode_l);
- env->entries[idx]->high_word = new_rd_Conv(dbg, irg, block, env->entries[op_idx]->high_word, dst_mode_h);
+ env->entries[idx]->low_word = new_rd_Conv(dbg, block, env->entries[op_idx]->low_word, dst_mode_l);
+ env->entries[idx]->high_word = new_rd_Conv(dbg, block, env->entries[op_idx]->high_word, dst_mode_h);
} else {
/* simple case: create a high word */
if (imode != dst_mode_l)
- op = new_rd_Conv(dbg, irg, block, op, dst_mode_l);
+ op = new_rd_Conv(dbg, block, op, dst_mode_l);
env->entries[idx]->low_word = op;
if (mode_is_signed(imode)) {
- ir_node *op_conv = new_rd_Conv(dbg, irg, block, op, dst_mode_h);
- env->entries[idx]->high_word = new_rd_Shrs(dbg, irg, block, op_conv,
+ ir_node *op_conv = new_rd_Conv(dbg, block, op, dst_mode_h);
+ env->entries[idx]->high_word = new_rd_Shrs(dbg, block, op_conv,
new_Const_long(dst_mode_l, get_mode_size_bits(dst_mode_h) - 1), dst_mode_h);
} else {
env->entries[idx]->high_word = new_Const(get_mode_null(dst_mode_h));
ir_type *mtp = get_conv_type(imode, omode, env);
irn = get_intrinsic_address(mtp, get_irn_op(node), imode, omode, block, env);
- call = new_rd_Call(dbg, irg, block, get_irg_no_mem(irg), irn, 1, &op, mtp);
+ call = new_rd_Call(dbg, block, get_irg_no_mem(irg), irn, 1, &op, mtp);
set_irn_pinned(call, get_irn_pinned(node));
- irn = new_r_Proj(irg, block, call, mode_T, pn_Call_T_result);
+ irn = new_r_Proj(block, call, mode_T, pn_Call_T_result);
- env->entries[idx]->low_word = new_r_Proj(irg, block, irn, dst_mode_l, 0);
- env->entries[idx]->high_word = new_r_Proj(irg, block, irn, dst_mode_h, 1);
+ env->entries[idx]->low_word = new_r_Proj(block, irn, dst_mode_l, 0);
+ env->entries[idx]->high_word = new_r_Proj(block, irn, dst_mode_h, 1);
} /* if */
} /* lower_Conv_to_Ls */
pdeq_putr(env->waitq, node);
return;
} /* if */
- env->entries[idx]->low_word = new_rd_Conv(dbg, irg, block, env->entries[op_idx]->low_word, dst_mode);
- env->entries[idx]->high_word = new_rd_Conv(dbg, irg, block, env->entries[op_idx]->high_word, dst_mode);
+ env->entries[idx]->low_word = new_rd_Conv(dbg, block, env->entries[op_idx]->low_word, dst_mode);
+ env->entries[idx]->high_word = new_rd_Conv(dbg, block, env->entries[op_idx]->high_word, dst_mode);
} else {
/* simple case: create a high word */
if (imode != dst_mode)
- op = new_rd_Conv(dbg, irg, block, op, dst_mode);
+ op = new_rd_Conv(dbg, block, op, dst_mode);
env->entries[idx]->low_word = op;
if (mode_is_signed(imode)) {
- env->entries[idx]->high_word = new_rd_Shrs(dbg, irg, block, op,
+ env->entries[idx]->high_word = new_rd_Shrs(dbg, block, op,
new_Const_long(dst_mode, get_mode_size_bits(dst_mode) - 1), dst_mode);
} else {
env->entries[idx]->high_word = new_Const(get_mode_null(dst_mode));
/* do an intrinsic call */
irn = get_intrinsic_address(mtp, get_irn_op(node), imode, omode, block, env);
- call = new_rd_Call(dbg, irg, block, get_irg_no_mem(irg), irn, 1, &op, mtp);
+ call = new_rd_Call(dbg, block, get_irg_no_mem(irg), irn, 1, &op, mtp);
set_irn_pinned(call, get_irn_pinned(node));
- irn = new_r_Proj(irg, block, call, mode_T, pn_Call_T_result);
+ irn = new_r_Proj(block, call, mode_T, pn_Call_T_result);
- env->entries[idx]->low_word = new_r_Proj(irg, block, irn, dst_mode, 0);
- env->entries[idx]->high_word = new_r_Proj(irg, block, irn, dst_mode, 1);
+ env->entries[idx]->low_word = new_r_Proj(block, irn, dst_mode, 0);
+ env->entries[idx]->high_word = new_r_Proj(block, irn, dst_mode, 1);
} /* if */
} /* lower_Conv_to_Lu */
/* simple case: create a high word */
if (omode != env->params->low_signed)
- op = new_rd_Conv(dbg, irg, block, op, omode);
+ op = new_rd_Conv(dbg, block, op, omode);
set_Conv_op(node, op);
} else {
in[0] = env->entries[idx]->low_word;
in[1] = env->entries[idx]->high_word;
- call = new_rd_Call(dbg, irg, block, get_irg_no_mem(irg), irn, 2, in, mtp);
+ call = new_rd_Call(dbg, block, get_irg_no_mem(irg), irn, 2, in, mtp);
set_irn_pinned(call, get_irn_pinned(node));
- irn = new_r_Proj(irg, block, call, mode_T, pn_Call_T_result);
+ irn = new_r_Proj(block, call, mode_T, pn_Call_T_result);
- exchange(node, new_r_Proj(irg, block, irn, omode, 0));
+ exchange(node, new_r_Proj(block, irn, omode, 0));
} /* if */
} /* lower_Conv_from_Ls */
/* simple case: create a high word */
if (omode != env->params->low_unsigned)
- op = new_rd_Conv(dbg, irg, block, op, omode);
+ op = new_rd_Conv(dbg, block, op, omode);
set_Conv_op(node, op);
} else {
in[0] = env->entries[idx]->low_word;
in[1] = env->entries[idx]->high_word;
- call = new_rd_Call(dbg, irg, block, get_irg_no_mem(irg), irn, 2, in, mtp);
+ call = new_rd_Call(dbg, block, get_irg_no_mem(irg), irn, 2, in, mtp);
set_irn_pinned(call, get_irn_pinned(node));
- irn = new_r_Proj(irg, block, call, mode_T, pn_Call_T_result);
+ irn = new_r_Proj(block, call, mode_T, pn_Call_T_result);
- exchange(node, new_r_Proj(irg, block, irn, omode, 0));
+ exchange(node, new_r_Proj(block, irn, omode, 0));
} /* if */
} /* lower_Conv_from_Lu */
* Translate the parameters.
*/
static void lower_Start(ir_node *node, ir_mode *mode, lower_env_t *env) {
- ir_graph *irg = current_ir_graph;
+ ir_graph *irg = get_irn_irg(node);
ir_entity *ent = get_irg_entity(irg);
ir_type *tp = get_entity_type(ent);
ir_type *mtp;
dbg = get_irn_dbg_info(proj);
env->entries[idx]->low_word =
- new_rd_Proj(dbg, irg, get_nodes_block(proj), args, low_mode, new_projs[proj_nr]);
+ new_rd_Proj(dbg, get_nodes_block(proj), args, low_mode, new_projs[proj_nr]);
env->entries[idx]->high_word =
- new_rd_Proj(dbg, irg, get_nodes_block(proj), args, mode, new_projs[proj_nr] + 1);
+ new_rd_Proj(dbg, get_nodes_block(proj), args, mode, new_projs[proj_nr] + 1);
} /* if */
} /* for */
set_optimize(rem);
dbg = get_irn_dbg_info(proj);
env->entries[idx]->low_word =
- new_rd_Proj(dbg, irg, get_nodes_block(proj), results, low_mode, res_numbers[proj_nr]);
+ new_rd_Proj(dbg, get_nodes_block(proj), results, low_mode, res_numbers[proj_nr]);
env->entries[idx]->high_word =
- new_rd_Proj(dbg, irg, get_nodes_block(proj), results, mode, res_numbers[proj_nr] + 1);
+ new_rd_Proj(dbg, get_nodes_block(proj), results, mode, res_numbers[proj_nr] + 1);
} /* if */
mark_irn_visited(proj);
} /* if */
*/
static void lower_Unknown(ir_node *node, ir_mode *mode, lower_env_t *env) {
int idx = get_irn_idx(node);
- ir_graph *irg = current_ir_graph;
+ ir_graph *irg = get_irn_irg(node);
ir_mode *low_mode = env->params->low_unsigned;
env->entries[idx]->low_word = new_r_Unknown(irg, low_mode);
*/
static void lower_Phi(ir_node *phi, ir_mode *mode, lower_env_t *env) {
ir_mode *mode_l = env->params->low_unsigned;
- ir_graph *irg = current_ir_graph;
+ ir_graph *irg = get_irn_irg(phi);
ir_node *block, *unk_l, *unk_h, *phi_l, *phi_h;
ir_node **inl, **inh;
dbg_info *dbg;
idx = get_irn_idx(phi);
assert(idx < env->n_entries);
- env->entries[idx]->low_word = phi_l = new_rd_Phi(dbg, irg, block, arity, inl, mode_l);
- env->entries[idx]->high_word = phi_h = new_rd_Phi(dbg, irg, block, arity, inh, mode);
+ env->entries[idx]->low_word = phi_l = new_rd_Phi(dbg, block, arity, inl, mode_l);
+ env->entries[idx]->high_word = phi_h = new_rd_Phi(dbg, block, arity, inh, mode);
/* Don't forget to link the new Phi nodes into the block.
* Beware that some Phis might be optimized away. */
* Translate a Mux.
*/
static void lower_Mux(ir_node *mux, ir_mode *mode, lower_env_t *env) {
- ir_graph *irg = current_ir_graph;
ir_node *block, *val;
ir_node *true_l, *true_h, *false_l, *false_h, *sel;
dbg_info *dbg;
idx = get_irn_idx(mux);
assert(idx < env->n_entries);
- env->entries[idx]->low_word = new_rd_Mux(dbg, irg, block, sel, false_l, true_l, mode);
- env->entries[idx]->high_word = new_rd_Mux(dbg, irg, block, sel, false_h, true_h, mode);
+ env->entries[idx]->low_word = new_rd_Mux(dbg, block, sel, false_l, true_l, mode);
+ env->entries[idx]->high_word = new_rd_Mux(dbg, block, sel, false_h, true_h, mode);
} /* lower_Mux */
/**
ir_node *l, *r, *low, *high, *t, *res;
pn_Cmp pnc;
ir_node *blk;
- ir_graph *irg = current_ir_graph;
dbg_info *db;
l = get_Cmp_left(cmp);
pnc = get_Proj_proj(proj);
blk = get_nodes_block(cmp);
db = get_irn_dbg_info(cmp);
- low = new_rd_Cmp(db, irg, blk, env->entries[lidx]->low_word, env->entries[ridx]->low_word);
- high = new_rd_Cmp(db, irg, blk, env->entries[lidx]->high_word, env->entries[ridx]->high_word);
+ low = new_rd_Cmp(db, blk, env->entries[lidx]->low_word, env->entries[ridx]->low_word);
+ high = new_rd_Cmp(db, blk, env->entries[lidx]->high_word, env->entries[ridx]->high_word);
if (pnc == pn_Cmp_Eq) {
/* simple case:a == b <==> a_h == b_h && a_l == b_l */
- res = new_rd_And(db, irg, blk,
- new_r_Proj(irg, blk, low, mode_b, pnc),
- new_r_Proj(irg, blk, high, mode_b, pnc),
+ res = new_rd_And(db, blk,
+ new_r_Proj(blk, low, mode_b, pnc),
+ new_r_Proj(blk, high, mode_b, pnc),
mode_b);
} else if (pnc == pn_Cmp_Lg) {
/* simple case:a != b <==> a_h != b_h || a_l != b_l */
- res = new_rd_Or(db, irg, blk,
- new_r_Proj(irg, blk, low, mode_b, pnc),
- new_r_Proj(irg, blk, high, mode_b, pnc),
+ res = new_rd_Or(db, blk,
+ new_r_Proj(blk, low, mode_b, pnc),
+ new_r_Proj(blk, high, mode_b, pnc),
mode_b);
} else {
/* a rel b <==> a_h REL b_h || (a_h == b_h && a_l rel b_l) */
- t = new_rd_And(db, irg, blk,
- new_r_Proj(irg, blk, low, mode_b, pnc),
- new_r_Proj(irg, blk, high, mode_b, pn_Cmp_Eq),
+ t = new_rd_And(db, blk,
+ new_r_Proj(blk, low, mode_b, pnc),
+ new_r_Proj(blk, high, mode_b, pn_Cmp_Eq),
mode_b);
- res = new_rd_Or(db, irg, blk,
- new_r_Proj(irg, blk, high, mode_b, pnc & ~pn_Cmp_Eq),
+ res = new_rd_Or(db, blk,
+ new_r_Proj(blk, high, mode_b, pnc & ~pn_Cmp_Eq),
t,
mode_b);
} /* if */
sym.entity_p = ent;
bl = get_nodes_block(sel);
- cnst = new_rd_SymConst(dbg, irg, bl, mode, sym, symconst_addr_ent);
- newn = new_rd_Add(dbg, irg, bl, ptr, cnst, mode);
+ cnst = new_rd_SymConst(dbg, irg, mode, sym, symconst_addr_ent);
+ newn = new_rd_Add(dbg, bl, ptr, cnst, mode);
} else {
/* not TLS */
assert(irg == current_ir_graph);
if (! is_Unknown(lb))
- lb = new_rd_Conv(dbg, irg, bl, copy_const_value(get_irn_dbg_info(sel), lb), mode_Int);
+ lb = new_rd_Conv(dbg, bl, copy_const_value(get_irn_dbg_info(sel), lb), mode_Int);
else
lb = NULL;
if (! is_Unknown(ub))
- ub = new_rd_Conv(dbg, irg, bl, copy_const_value(get_irn_dbg_info(sel), ub), mode_Int);
+ ub = new_rd_Conv(dbg, bl, copy_const_value(get_irn_dbg_info(sel), ub), mode_Int);
else
ub = NULL;
assert(ub != NULL && "upper bound has to be set in multi-dim array");
/* Elements in one Dimension */
- elms = new_rd_Sub(dbg, irg, bl, ub, lb, mode_Int);
+ elms = new_rd_Sub(dbg, bl, ub, lb, mode_Int);
}
- ind = new_rd_Conv(dbg, irg, bl, get_Sel_index(sel, dim), mode_Int);
+ ind = new_rd_Conv(dbg, bl, get_Sel_index(sel, dim), mode_Int);
/*
* Normalize index, id lower bound is set, also assume
* lower bound == 0
*/
if (lb != NULL)
- ind = new_rd_Sub(dbg, irg, bl, ind, lb, mode_Int);
+ ind = new_rd_Sub(dbg, bl, ind, lb, mode_Int);
- n = new_rd_Mul(dbg, irg, bl, ind, last_size, mode_Int);
+ n = new_rd_Mul(dbg, bl, ind, last_size, mode_Int);
/*
* see comment above.
*/
if (i > 0)
- last_size = new_rd_Mul(dbg, irg, bl, last_size, elms, mode_Int);
+ last_size = new_rd_Mul(dbg, bl, last_size, elms, mode_Int);
- newn = new_rd_Add(dbg, irg, bl, newn, n, mode);
+ newn = new_rd_Add(dbg, bl, newn, n, mode);
}
} else {
/* no array type */
ir_mode *idx_mode = get_irn_mode(index);
tarval *tv = new_tarval_from_long(get_mode_size_bytes(basemode), idx_mode);
- newn = new_rd_Add(dbg, irg, bl, get_Sel_ptr(sel),
- new_rd_Mul(dbg, irg, bl, index,
+ newn = new_rd_Add(dbg, bl, get_Sel_ptr(sel),
+ new_rd_Mul(dbg, bl, index,
new_r_Const(irg, tv),
idx_mode),
mode);
/* We need an additional load when accessing methods from a dispatch table. */
tv = new_tarval_from_long(get_entity_offset(ent), mode_Int);
cnst = new_rd_Const(dbg, irg, tv);
- add = new_rd_Add(dbg, irg, bl, get_Sel_ptr(sel), cnst, mode);
+ add = new_rd_Add(dbg, bl, get_Sel_ptr(sel), cnst, mode);
#ifdef DO_CACHEOPT /* cacheopt version */
- newn = new_rd_Load(dbg, irg, bl, get_Sel_mem(sel), sel, ent_mode, 0);
+ newn = new_rd_Load(dbg, bl, get_Sel_mem(sel), sel, ent_mode, 0);
cacheopt_map_addrs_register_node(newn);
set_Load_ptr(newn, add);
#else /* normal code */
- newn = new_rd_Load(dbg, irg, bl, get_Sel_mem(sel), add, ent_mode, 0);
+ newn = new_rd_Load(dbg, bl, get_Sel_mem(sel), add, ent_mode, 0);
#endif
- newn = new_r_Proj(irg, bl, newn, ent_mode, pn_Load_res);
+ newn = new_r_Proj(bl, newn, ent_mode, pn_Load_res);
} else if (get_entity_owner(ent) != get_glob_type()) {
int offset;
tv = new_tarval_from_long(offset, mode_UInt);
cnst = new_r_Const(irg, tv);
- newn = new_rd_Add(dbg, irg, bl, newn, cnst, mode);
+ newn = new_rd_Add(dbg, bl, newn, cnst, mode);
}
} else {
/* global_type */
- newn = new_rd_SymConst_addr_ent(NULL, current_ir_graph, mode, ent, firm_unknown_type);
+ newn = new_rd_SymConst_addr_ent(NULL, irg, mode, ent, firm_unknown_type);
}
}
/* run the hooks */
/* abandon bitfield sel */
ptr = get_Sel_ptr(sel);
db = get_irn_dbg_info(sel);
- ptr = new_rd_Add(db, current_ir_graph, block, ptr, new_Const_long(mode_Is, offset), get_irn_mode(ptr));
+ ptr = new_rd_Add(db, block, ptr, new_Const_long(mode_Is, offset), get_irn_mode(ptr));
set_Load_ptr(load, ptr);
set_Load_mode(load, mode);
/* create new proj, switch off CSE or we may get the old one back */
old_cse = get_opt_cse();
set_opt_cse(0);
- res = n_proj = new_r_Proj(current_ir_graph, block, load, mode, pn_Load_res);
+ res = n_proj = new_r_Proj(block, load, mode, pn_Load_res);
set_opt_cse(old_cse);
if (mode_is_signed(mode)) { /* signed */
int shift_count_down = bits - bf_bits;
if (shift_count_up) {
- res = new_r_Shl(current_ir_graph, block, res,
- new_Const_long(mode_Iu, shift_count_up), mode);
+ res = new_r_Shl(block, res, new_Const_long(mode_Iu, shift_count_up), mode);
}
if (shift_count_down) {
- res = new_r_Shrs(current_ir_graph, block, res,
- new_Const_long(mode_Iu, shift_count_down), mode);
+ res = new_r_Shrs(block, res, new_Const_long(mode_Iu, shift_count_down), mode);
}
} else { /* unsigned */
int shift_count_down = bit_offset;
unsigned mask = ((unsigned)-1) >> (bits - bf_bits);
if (shift_count_down) {
- res = new_r_Shr(current_ir_graph, block, res,
- new_Const_long(mode_Iu, shift_count_down), mode);
+ res = new_r_Shr(block, res, new_Const_long(mode_Iu, shift_count_down), mode);
}
if (bits != bf_bits) {
- res = new_r_And(current_ir_graph, block, res,
- new_Const_long(mode, mask), mode);
+ res = new_r_And(block, res, new_Const_long(mode, mask), mode);
}
}
/* abandon bitfield sel */
ptr = get_Sel_ptr(sel);
db = get_irn_dbg_info(sel);
- ptr = new_rd_Add(db, current_ir_graph, block, ptr, new_Const_long(mode_Is, offset), get_irn_mode(ptr));
+ ptr = new_rd_Add(db, block, ptr, new_Const_long(mode_Is, offset), get_irn_mode(ptr));
if (neg_mask) {
/* there are some bits, normal case */
- irn = new_r_Load(current_ir_graph, block, mem, ptr, mode, 0);
- mem = new_r_Proj(current_ir_graph, block, irn, mode_M, pn_Load_M);
- irn = new_r_Proj(current_ir_graph, block, irn, mode, pn_Load_res);
+ irn = new_r_Load( block, mem, ptr, mode, 0);
+ mem = new_r_Proj( block, irn, mode_M, pn_Load_M);
+ irn = new_r_Proj( block, irn, mode, pn_Load_res);
- irn = new_r_And(current_ir_graph, block, irn,
- new_Const_long(mode, neg_mask), mode);
+ irn = new_r_And(block, irn, new_Const_long(mode, neg_mask), mode);
if (bit_offset > 0) {
- value = new_r_Shl(current_ir_graph, block, value,
- new_Const_long(mode_Iu, bit_offset), mode);
+ value = new_r_Shl(block, value, new_Const_long(mode_Iu, bit_offset), mode);
}
- value = new_r_And(current_ir_graph, block, value,
- new_Const_long(mode, mask), mode);
+ value = new_r_And(block, value, new_Const_long(mode, mask), mode);
- value = new_r_Or(current_ir_graph, block, value, irn, mode);
+ value = new_r_Or(block, value, irn, mode);
}
set_Store_mem(store, mem);
/* Beware: do we need here a protection against CSE? Better we do it. */
int old_cse = get_opt_cse();
set_opt_cse(0);
- reg_jmp = new_r_Jmp(current_ir_graph, block);
+ reg_jmp = new_r_Jmp(block);
set_opt_cse(old_cse);
exc_jmp = new_Bad();
}
- irn = new_r_Tuple(current_ir_graph, block, 1, &irn);
+ irn = new_r_Tuple(block, 1, &irn);
turn_into_tuple(call, pn_Call_max);
set_Tuple_pred(call, pn_Call_M_regular, mem);
dbg_info *dbg = get_irn_dbg_info(call);
(void) ctx;
- irn = new_rd_Abs(dbg, current_ir_graph, block, op, get_irn_mode(op));
+ irn = new_rd_Abs(dbg, block, op, get_irn_mode(op));
DBG_OPT_ALGSIM0(call, irn, FS_OPT_RTS_ABS);
replace_call(irn, call, mem, NULL, NULL);
return 1;
ir_node *irn;
(void) ctx;
- irn = new_rd_Builtin(dbg, current_ir_graph, block, get_irg_no_mem(current_ir_graph), 1, &op, ir_bk_bswap, tp);
+ irn = new_rd_Builtin(dbg, block, get_irg_no_mem(current_ir_graph), 1, &op, ir_bk_bswap, tp);
set_irn_pinned(irn, op_pin_state_floats);
DBG_OPT_ALGSIM0(call, irn, FS_OPT_RTS_ABS);
- irn = new_r_Proj(current_ir_graph, block, irn, get_irn_mode(op), pn_Builtin_1_result);
+ irn = new_r_Proj(block, irn, get_irn_mode(op), pn_Builtin_1_result);
replace_call(irn, call, mem, NULL, NULL);
return 1;
} /* i_mapper_bswap */
if (mode == NULL) {
panic("Cannot find unsigned mode for %M", mode);
}
- op = new_rd_Conv(dbg, current_ir_graph, block, op, mode);
+ op = new_rd_Conv(dbg, block, op, mode);
}
- irn = new_rd_Alloc(dbg, current_ir_graph, block, mem, op, firm_unknown_type, stack_alloc);
- mem = new_rd_Proj(dbg, current_ir_graph, block, irn, mode_M, pn_Alloc_M);
- no_exc = new_rd_Proj(dbg, current_ir_graph, block, irn, mode_X, pn_Alloc_X_regular);
- exc = new_rd_Proj(dbg, current_ir_graph, block, irn, mode_X, pn_Alloc_X_except);
- irn = new_rd_Proj(dbg, current_ir_graph, block, irn, get_modeP_data(), pn_Alloc_res);
+ irn = new_rd_Alloc(dbg, block, mem, op, firm_unknown_type, stack_alloc);
+ mem = new_rd_Proj(dbg, block, irn, mode_M, pn_Alloc_M);
+ no_exc = new_rd_Proj(dbg, block, irn, mode_X, pn_Alloc_X_regular);
+ exc = new_rd_Proj(dbg, block, irn, mode_X, pn_Alloc_X_except);
+ irn = new_rd_Proj(dbg, block, irn, get_modeP_data(), pn_Alloc_res);
DBG_OPT_ALGSIM0(call, irn, FS_OPT_RTS_ALLOCA);
replace_call(irn, call, mem, no_exc, exc);
ir_node *quot;
irn = new_Const(get_mode_one(mode));
- quot = new_rd_Quot(dbg, current_ir_graph, block, mem, irn, left, mode, op_pin_state_pinned);
- mem = new_r_Proj(current_ir_graph, block, quot, mode_M, pn_Quot_M);
- irn = new_r_Proj(current_ir_graph, block, quot, mode, pn_Quot_res);
- reg_jmp = new_r_Proj(current_ir_graph, block, quot, mode_X, pn_Quot_X_regular);
- exc_jmp = new_r_Proj(current_ir_graph, block, quot, mode_X, pn_Quot_X_except);
+ quot = new_rd_Quot(dbg, block, mem, irn, left, mode, op_pin_state_pinned);
+ mem = new_r_Proj(block, quot, mode_M, pn_Quot_M);
+ irn = new_r_Proj(block, quot, mode, pn_Quot_res);
+ reg_jmp = new_r_Proj(block, quot, mode_X, pn_Quot_X_regular);
+ exc_jmp = new_r_Proj(block, quot, mode_X, pn_Quot_X_except);
}
DBG_OPT_ALGSIM0(call, irn, FS_OPT_RTS_POW);
replace_call(irn, call, mem, reg_jmp, exc_jmp);
dbg_info *dbg = get_irn_dbg_info(val);
op = get_Minus_op(op);
- val = new_rd_Conv(dbg, current_ir_graph, block, op, mode);
+ val = new_rd_Conv(dbg, block, op, mode);
if (is_Conv(val)) {
/* still a Conv ? */
set_Conv_strict(val, 1);
mode = get_type_mode(char_tp);
/* replace the strcmp by (*x) */
- irn = new_rd_Load(dbg, current_ir_graph, block, mem, v, mode, 0);
- mem = new_r_Proj(current_ir_graph, block, irn, mode_M, pn_Load_M);
- exc = new_r_Proj(current_ir_graph, block, irn, mode_X, pn_Load_X_except);
- reg = new_r_Proj(current_ir_graph, block, irn, mode_X, pn_Load_X_regular);
- irn = new_r_Proj(current_ir_graph, block, irn, mode, pn_Load_res);
+ irn = new_rd_Load(dbg, block, mem, v, mode, 0);
+ mem = new_r_Proj(block, irn, mode_M, pn_Load_M);
+ exc = new_r_Proj(block, irn, mode_X, pn_Load_X_except);
+ reg = new_r_Proj(block, irn, mode_X, pn_Load_X_regular);
+ irn = new_r_Proj(block, irn, mode, pn_Load_res);
/* conv to the result mode */
mode = get_type_mode(res_tp);
- irn = new_rd_Conv(dbg, current_ir_graph, block, irn, mode);
+ irn = new_rd_Conv(dbg, block, irn, mode);
if (v == right) {
/* negate in the ("", s) case */
- irn = new_rd_Minus(dbg, current_ir_graph, block, irn, mode);
+ irn = new_rd_Minus(dbg, block, irn, mode);
}
}
}
ir_node *mem = get_Call_mem(call);
ir_node *blk = get_nodes_block(call);
ir_mode *mode = get_irn_mode(dst);
- ir_node *res = new_rd_Add(dbg, get_irn_irg(blk), blk, dst, len, mode);
+ ir_node *res = new_rd_Add(dbg, blk, dst, len, mode);
DBG_OPT_ALGSIM0(call, res, FS_OPT_RTS_MEMPCPY);
replace_call(res, call, mem, NULL, NULL);
/* step 1: create the call */
sym.entity_p = rt->ent;
- addr = new_r_SymConst(irg, bl, mode_P_code, sym, symconst_addr_ent);
- call = new_rd_Call(get_irn_dbg_info(node), irg, bl, mem, addr, n_param, in, mtp);
+ addr = new_r_SymConst(irg, mode_P_code, sym, symconst_addr_ent);
+ call = new_rd_Call(get_irn_dbg_info(node), bl, mem, addr, n_param, in, mtp);
set_irn_pinned(call, get_irn_pinned(node));
if (n_res > 0)
- res_proj = new_r_Proj(irg, bl, call, mode_T, pn_Call_T_result);
+ res_proj = new_r_Proj(bl, call, mode_T, pn_Call_T_result);
else
res_proj = NULL;
for (i = 0; i < n_proj; ++i)
set_Tuple_pred(node, i, new_r_Bad(irg));
if (rt->mem_proj_nr >= 0)
- set_Tuple_pred(node, rt->mem_proj_nr, new_r_Proj(irg, bl, call, mode_M, pn_Call_M_regular));
+ set_Tuple_pred(node, rt->mem_proj_nr, new_r_Proj(bl, call, mode_M, pn_Call_M_regular));
if (!is_NoMem(mem)) {
/* Exceptions can only be handled with real memory */
if (rt->regular_proj_nr >= 0)
- set_Tuple_pred(node, rt->regular_proj_nr, new_r_Proj(irg, bl, call, mode_X, pn_Call_X_regular));
+ set_Tuple_pred(node, rt->regular_proj_nr, new_r_Proj(bl, call, mode_X, pn_Call_X_regular));
if (rt->exc_proj_nr >= 0)
- set_Tuple_pred(node, rt->exc_proj_nr, new_r_Proj(irg, bl, call, mode_X, pn_Call_X_except));
+ set_Tuple_pred(node, rt->exc_proj_nr, new_r_Proj(bl, call, mode_X, pn_Call_X_except));
if (rt->exc_mem_proj_nr >= 0)
- set_Tuple_pred(node, rt->mem_proj_nr, new_r_Proj(irg, bl, call, mode_M, pn_Call_M_except));
+ set_Tuple_pred(node, rt->mem_proj_nr, new_r_Proj(bl, call, mode_M, pn_Call_M_except));
}
if (rt->res_proj_nr >= 0)
for (i = 0; i < n_res; ++i)
set_Tuple_pred(node, rt->res_proj_nr + i,
- new_r_Proj(irg, bl, res_proj, get_type_mode(get_method_res_type(mtp, i)), i));
+ new_r_Proj(bl, res_proj, get_type_mode(get_method_res_type(mtp, i)), i));
return 1;
} else {
/* only one return value supported */
if (n_res > 0) {
ir_mode *mode = get_type_mode(get_method_res_type(mtp, 0));
- res_proj = new_r_Proj(irg, bl, call, mode_T, pn_Call_T_result);
- res_proj = new_r_Proj(irg, bl, res_proj, mode, 0);
+ res_proj = new_r_Proj(bl, call, mode_T, pn_Call_T_result);
+ res_proj = new_r_Proj(bl, res_proj, mode, 0);
exchange(node, res_proj);
return 1;
static ir_node *create_not(dbg_info *dbgi, ir_node *node)
{
- ir_graph *irg = current_ir_graph;
ir_node *block = get_nodes_block(node);
ir_mode *mode = config.lowered_mode;
tarval *tv_one = get_tarval_one(mode);
ir_node *one = new_d_Const(dbgi, tv_one);
- return new_rd_Eor(dbgi, irg, block, node, one, mode);
+ return new_rd_Eor(dbgi, block, node, one, mode);
}
static ir_node *create_convb(ir_node *node)
{
- ir_graph *irg = current_ir_graph;
ir_node *block = get_nodes_block(node);
- ir_node *conv = new_rd_Conv(NULL, irg, block, node, mode_b);
+ ir_node *conv = new_rd_Conv(NULL, block, node, mode_b);
return conv;
}
*/
static ir_node *create_set(ir_node *node)
{
- ir_graph *irg = current_ir_graph;
dbg_info *dbgi = get_irn_dbg_info(node);
ir_mode *mode = config.lowered_set_mode;
tarval *tv_one = get_tarval_one(mode);
tarval *tv_zero = get_tarval_null(mode);
ir_node *zero = new_d_Const(dbgi, tv_zero);
- ir_node *set = new_rd_Mux(dbgi, irg, block, node, zero, one, mode);
+ ir_node *set = new_rd_Mux(dbgi, block, node, zero, one, mode);
if (mode != config.lowered_mode) {
- set = new_r_Conv(irg, block, set, config.lowered_mode);
+ set = new_r_Conv(block, set, config.lowered_mode);
}
return set;
static ir_node *lower_node(ir_node *node)
{
- ir_graph *irg = current_ir_graph;
dbg_info *dbgi = get_irn_dbg_info(node);
ir_node *block = get_nodes_block(node);
ir_mode *mode = config.lowered_mode;
for(i = 0; i < arity; ++i) {
in[i] = unknown;
}
- new_phi = new_r_Phi(irg, block, arity, in, config.lowered_mode);
+ new_phi = new_r_Phi(block, arity, in, config.lowered_mode);
set_irn_link(node, new_phi);
pdeq_putr(lowered_nodes, node);
ir_node *v_false = get_Mux_false(node);
ir_node *low_v_false = lower_node(v_false);
- ir_node *and0 = new_rd_And(dbgi, irg, block, low_cond, low_v_true, mode);
+ ir_node *and0 = new_rd_And(dbgi, block, low_cond, low_v_true, mode);
ir_node *not_cond = create_not(dbgi, low_cond);
- ir_node *and1 = new_rd_And(dbgi, irg, block, not_cond, low_v_false, mode);
- ir_node *or = new_rd_Or(dbgi, irg, block, and0, and1, mode);
+ ir_node *and1 = new_rd_And(dbgi, block, not_cond, low_v_false, mode);
+ ir_node *or = new_rd_Or(dbgi, block, and0, and1, mode);
set_irn_link(node, or);
pdeq_putr(lowered_nodes, node);
ir_node *zero_cmp = new_d_Const(dbgi, tv_zeroc);
ir_node *set;
- ir_node *cmp = new_rd_Cmp(dbgi, irg, block, pred, zero_cmp);
- ir_node *proj = new_rd_Proj(dbgi, irg, block, cmp, mode_b,
- pn_Cmp_Lg);
+ ir_node *cmp = new_rd_Cmp(dbgi, block, pred, zero_cmp);
+ ir_node *proj = new_rd_Proj(dbgi, block, cmp, mode_b, pn_Cmp_Lg);
set = create_set(proj);
set_irn_link(node, set);
ir_node *shift_cnt = new_d_Const(dbgi, tv);
if(cmp_mode != mode) {
- a = new_rd_Conv(dbgi, irg, block, a, mode);
- b = new_rd_Conv(dbgi, irg, block, b, mode);
+ a = new_rd_Conv(dbgi, block, a, mode);
+ b = new_rd_Conv(dbgi, block, b, mode);
}
- res = new_rd_Sub(dbgi, irg, block, a, b, mode);
+ res = new_rd_Sub(dbgi, block, a, b, mode);
if(need_not) {
- res = new_rd_Not(dbgi, irg, block, res, mode);
+ res = new_rd_Not(dbgi, block, res, mode);
}
- res = new_rd_Shr(dbgi, irg, block, res, shift_cnt, mode);
+ res = new_rd_Shr(dbgi, block, res, shift_cnt, mode);
set_irn_link(node, res);
pdeq_putr(lowered_nodes, node);
set_irn_mode(node, mode);
return node;
} else if(is_Proj(pred) && is_Start(get_Proj_pred(pred))) {
- ir_entity *entity = get_irg_entity(irg);
+ ir_entity *entity = get_irg_entity(current_ir_graph);
ir_type *type = get_entity_type(entity);
adjust_method_type(type);
set_irn_mode(node, mode);
} else if (tarval_is_one(tarval_sub(tv_hi, tv_lo, NULL))) { /* lo + 1 == hi */
if (pnc_lo == pn_Cmp_Ge && pnc_hi == pn_Cmp_Lt) {
/* x >= c || x < c + 1 -> x == c */
- ir_graph *const irg = current_ir_graph;
ir_node *const block = get_nodes_block(cmp_lo);
- ir_node *const p = new_r_Proj(irg, block, cmp_lo, mode_b, pn_Cmp_Eq);
+ ir_node *const p = new_r_Proj(block, cmp_lo, mode_b, pn_Cmp_Eq);
return p;
} else if (pnc_lo == pn_Cmp_Gt) {
if (pnc_hi == pn_Cmp_Lg) {
/* x > c || x != c + 1 -> x > c + 1 */
- ir_graph *const irg = current_ir_graph;
ir_node *const block = get_nodes_block(cmp_hi);
- ir_node *const p = new_r_Proj(irg, block, cmp_hi, mode_b, pn_Cmp_Gt);
+ ir_node *const p = new_r_Proj(block, cmp_hi, mode_b, pn_Cmp_Gt);
return p;
} else if (pnc_hi == pn_Cmp_Lt) {
/* x > c || x < c + 1 -> false */
return t;
} else if (pnc_hi == pn_Cmp_Le) {
/* x > c || x <= c + 1 -> x != c + 1 */
- ir_graph *const irg = current_ir_graph;
ir_node *const block = get_nodes_block(cmp_hi);
- ir_node *const p = new_r_Proj(irg, block, cmp_hi, mode_b, pn_Cmp_Eq);
+ ir_node *const p = new_r_Proj(block, cmp_hi, mode_b, pn_Cmp_Eq);
return p;
}
} else if (pnc_lo == pn_Cmp_Lg && pnc_hi == pn_Cmp_Lt) {
/* x != c || c < c + 1 -> x < c */
- ir_graph *const irg = current_ir_graph;
ir_node *const block = get_nodes_block(cmp_lo);
- ir_node *const p = new_r_Proj(irg, block, cmp_lo, mode_b, pn_Cmp_Lt);
+ ir_node *const p = new_r_Proj(block, cmp_lo, mode_b, pn_Cmp_Lt);
return p;
}
}
} else if (tarval_is_one(tarval_sub(tv_hi, tv_lo, NULL))) { /* lo + 1 == hi */
if (pnc_lo == pn_Cmp_Lt && pnc_hi == pn_Cmp_Ge) {
/* x < c || x >= c + 1 -> x != c */
- ir_graph *const irg = current_ir_graph;
ir_node *const block = get_nodes_block(cmp_lo);
- ir_node *const p = new_r_Proj(irg, block, cmp_lo, mode_b, pn_Cmp_Lg);
+ ir_node *const p = new_r_Proj(block, cmp_lo, mode_b, pn_Cmp_Lg);
return p;
} else if (pnc_lo == pn_Cmp_Le) {
if (pnc_hi == pn_Cmp_Eq) {
/* x <= c || x == c + 1 -> x <= c + 1 */
- ir_graph *const irg = current_ir_graph;
ir_node *const block = get_nodes_block(cmp_hi);
- ir_node *const p = new_r_Proj(irg, block, cmp_hi, mode_b, pn_Cmp_Le);
+ ir_node *const p = new_r_Proj(block, cmp_hi, mode_b, pn_Cmp_Le);
return p;
} else if (pnc_hi == pn_Cmp_Ge) {
/* x <= c || x >= c + 1 -> true */
return t;
} else if (pnc_hi == pn_Cmp_Gt) {
/* x <= c || x > c + 1 -> x != c + 1 */
- ir_graph *const irg = current_ir_graph;
ir_node *const block = get_nodes_block(cmp_hi);
- ir_node *const p = new_r_Proj(irg, block, cmp_hi, mode_b, pn_Cmp_Lg);
+ ir_node *const p = new_r_Proj(block, cmp_hi, mode_b, pn_Cmp_Lg);
return p;
}
} else if (pnc_lo == pn_Cmp_Eq && pnc_hi == pn_Cmp_Ge) {
/* x == c || x >= c + 1 -> x >= c */
- ir_graph *const irg = current_ir_graph;
ir_node *const block = get_nodes_block(cmp_lo);
- ir_node *const p = new_r_Proj(irg, block, cmp_lo, mode_b, pn_Cmp_Ge);
+ ir_node *const p = new_r_Proj(block, cmp_lo, mode_b, pn_Cmp_Ge);
return p;
}
}
ir_node *upper_cond;
ir_node *upper_cond_selector;
ir_node *replacement;
- ir_graph *irg;
cond_pair cpair;
upper_cf = get_Block_cfgpred(block, i2);
/* normalize pncs: we need the true case to jump into the
* common block (ie. conjunctive normal form) */
- irg = current_ir_graph;
if(get_Proj_proj(lower_cf) == pn_Cond_false) {
if(cpair.proj_lo == cond_selector) {
ir_mode *mode = get_tarval_mode(cpair.tv_lo);
cpair.pnc_lo = get_negated_pnc(cpair.pnc_lo, mode);
- cpair.proj_lo = new_r_Proj(irg, lower_block,
+ cpair.proj_lo = new_r_Proj(lower_block,
get_Proj_pred(cpair.proj_lo), mode_b, cpair.pnc_lo);
} else {
ir_mode *mode = get_tarval_mode(cpair.tv_hi);
assert(cpair.proj_hi == cond_selector);
cpair.pnc_hi = get_negated_pnc(cpair.pnc_hi, mode);
- cpair.proj_hi = new_r_Proj(irg, lower_block,
+ cpair.proj_hi = new_r_Proj(lower_block,
get_Proj_pred(cpair.proj_hi), mode_b, cpair.pnc_hi);
}
}
if(cpair.proj_lo == upper_cond_selector) {
ir_mode *mode = get_tarval_mode(cpair.tv_lo);
cpair.pnc_lo = get_negated_pnc(cpair.pnc_lo, mode);
- cpair.proj_lo = new_r_Proj(irg, upper_block,
+ cpair.proj_lo = new_r_Proj(upper_block,
get_Proj_pred(cpair.proj_lo), mode_b, cpair.pnc_lo);
} else {
ir_mode *mode = get_tarval_mode(cpair.tv_hi);
assert(cpair.proj_hi == upper_cond_selector);
cpair.pnc_hi = get_negated_pnc(cpair.pnc_hi, mode);
- cpair.proj_hi = new_r_Proj(irg, upper_block,
+ cpair.proj_hi = new_r_Proj(upper_block,
get_Proj_pred(cpair.proj_hi), mode_b, cpair.pnc_hi);
}
}
/* the optimisations expected the true case to jump */
if(get_Proj_proj(lower_cf) == pn_Cond_false) {
ir_node *block = get_nodes_block(replacement);
- replacement = new_rd_Not(NULL, current_ir_graph, block,
- replacement, mode_b);
+ replacement = new_rd_Not(NULL, block, replacement, mode_b);
}
set_Cond_selector(cond, replacement);
ir_node *cond_j = skip_Proj(pred_j);
if (cond_j == cond_i) {
- ir_node *jmp = new_r_Jmp(current_ir_graph, get_nodes_block(cond_i));
+ ir_node *jmp = new_r_Jmp(get_nodes_block(cond_i));
set_irn_n(bl, i, jmp);
set_irn_n(bl, j, new_Bad());
/* this Cond has only one Proj: must be the defProj */
assert(get_Cond_default_proj(cond) == get_Proj_proj(proj1));
/* convert it into a Jmp */
- jmp = new_r_Jmp(current_ir_graph, blk);
+ jmp = new_r_Jmp(blk);
exchange(proj1, jmp);
return 1;
} else if (get_irn_link(proj2) == NULL) {
if (def_num == get_Proj_proj(proj1)) {
/* first one is the defProj */
if (num == get_Proj_proj(proj2)) {
- jmp = new_r_Jmp(current_ir_graph, blk);
+ jmp = new_r_Jmp(blk);
exchange(proj2, jmp);
exchange(proj1, new_Bad());
return 1;
} else if (def_num == get_Proj_proj(proj2)) {
/* second one is the defProj */
if (num == get_Proj_proj(proj1)) {
- jmp = new_r_Jmp(current_ir_graph, blk);
+ jmp = new_r_Jmp(blk);
exchange(proj1, jmp);
exchange(proj2, new_Bad());
return 1;
} else {
/* neither: strange, Cond was not optimized so far */
if (num == get_Proj_proj(proj1)) {
- jmp = new_r_Jmp(current_ir_graph, blk);
+ jmp = new_r_Jmp(blk);
exchange(proj1, jmp);
exchange(proj2, new_Bad());
return 1;
} else if (num == get_Proj_proj(proj2)) {
- jmp = new_r_Jmp(current_ir_graph, blk);
+ jmp = new_r_Jmp(blk);
exchange(proj2, jmp);
exchange(proj1, new_Bad());
return 1;
ir_node *block = get_nodes_block(leader);
dbg_info *dbg = get_irn_dbg_info(irn);
- leader = new_rd_Conv(dbg, current_ir_graph, block, leader, mode);
+ leader = new_rd_Conv(dbg, block, leader, mode);
}
exchange(irn, leader);
} /* exchange_leader */
if (is_Cond(cond)) {
if (only_one_reachable_proj(cond)) {
- ir_node *jmp = new_r_Jmp(current_ir_graph, block->node);
+ ir_node *jmp = new_r_Jmp(block->node);
set_irn_node(jmp, node);
node->node = jmp;
DB((dbg, LEVEL_1, "%+F is replaced by %+F\n", irn, jmp));
} else if (is_entity(node->type.sym.entity_p)) {
if (! is_SymConst(irn)) {
/* can be replaced by a SymConst */
- ir_node *symc = new_r_SymConst(current_ir_graph, block->node, get_irn_mode(irn), node->type.sym, symconst_addr_ent);
+ ir_node *symc = new_r_SymConst(current_ir_graph, get_irn_mode(irn), node->type.sym, symconst_addr_ent);
set_irn_node(symc, node);
node->node = symc;
for(i = 0; i < n_cfgpreds; ++i)
in[i] = new_Unknown(mode);
- phi = new_r_Phi(irg, block, n_cfgpreds, in, mode);
+ phi = new_r_Phi(block, n_cfgpreds, in, mode);
set_irn_link(block, phi);
mark_irn_visited(block);
in[0] = get_Block_cfgpred(block, pos);
new_block = new_r_Block(irg, 1, in);
- new_jmp = new_r_Jmp(irg, new_block);
+ new_jmp = new_r_Jmp(new_block);
set_Block_cfgpred(block, pos, new_jmp);
}
return;
} else if (selector_evaluated == 1) {
dbg_info *dbgi = get_irn_dbg_info(selector);
- ir_node *jmp = new_rd_Jmp(dbgi, current_ir_graph, get_nodes_block(projx));
+ ir_node *jmp = new_rd_Jmp(dbgi, get_nodes_block(projx));
DBG_OPT_COND_EVAL(projx, jmp);
exchange(projx, jmp);
*changed = 1;
static ir_node *place_conv(ir_node *node, ir_mode *dest_mode)
{
ir_node *block = get_nodes_block(node);
- ir_node *conv = new_r_Conv(current_ir_graph, block, node, dest_mode);
+ ir_node *conv = new_r_Conv(block, node, dest_mode);
return conv;
}
/* set predecessor of new block */
block = new_r_Block(irg, 1, &pre);
/* insert new jmp node to new block */
- jmp = new_r_Jmp(irg, block);
+ jmp = new_r_Jmp(block);
/* set successor of new block */
set_irn_n(n, i, jmp);
cenv->changed = 1;
blk = get_nodes_block(alloc);
turn_into_tuple(alloc, pn_Alloc_max);
set_Tuple_pred(alloc, pn_Alloc_M, mem);
- set_Tuple_pred(alloc, pn_Alloc_X_regular, new_r_Jmp(irg, blk));
+ set_Tuple_pred(alloc, pn_Alloc_X_regular, new_r_Jmp(blk));
set_Tuple_pred(alloc, pn_Alloc_X_except, new_r_Bad(irg));
++env->nr_deads;
name[sizeof(name) - 1] = '\0';
ent = new_d_entity(ftp, new_id_from_str(name), get_Alloc_type(alloc), dbg);
- sel = new_rd_simpleSel(dbg, irg, get_nodes_block(alloc),
- get_irg_no_mem(irg), get_irg_frame(irg), ent);
+ sel = new_rd_simpleSel(dbg, get_nodes_block(alloc), get_irg_no_mem(irg), get_irg_frame(irg), ent);
mem = get_Alloc_mem(alloc);
turn_into_tuple(alloc, pn_Alloc_max);
set_Tuple_pred(alloc, pn_Alloc_M, mem);
- set_Tuple_pred(alloc, pn_Alloc_X_regular, new_r_Jmp(irg, blk));
+ set_Tuple_pred(alloc, pn_Alloc_X_regular, new_r_Jmp(blk));
set_Tuple_pred(alloc, pn_Alloc_X_except, new_r_Bad(irg));
set_Tuple_pred(alloc, pn_Alloc_res, sel);
blk = get_nodes_block(call);
turn_into_tuple(call, pn_Call_max);
set_Tuple_pred(call, pn_Call_M_regular, mem);
- set_Tuple_pred(call, pn_Call_X_regular, new_r_Jmp(irg, blk));
+ set_Tuple_pred(call, pn_Call_X_regular, new_r_Jmp(blk));
set_Tuple_pred(call, pn_Call_X_except, new_r_Bad(irg));
set_Tuple_pred(call, pn_Call_T_result, new_r_Bad(irg));
set_Tuple_pred(call, pn_Call_M_except, mem);
case pn_Call_X_regular: {
ir_node *block = get_nodes_block(call);
exc_changed = 1;
- exchange(proj, new_r_Jmp(irg, block));
+ exchange(proj, new_r_Jmp(block));
break;
}
default:
case pn_Call_X_regular: {
ir_node *block = get_nodes_block(call);
exc_changed = 1;
- exchange(proj, new_r_Jmp(irg, block));
+ exchange(proj, new_r_Jmp(block));
break;
}
default:
if (v_pred != pred) {
/* must create a new value here */
- v = new_r_Proj(current_ir_graph, get_nodes_block(v_pred), v_pred, get_irn_mode(v), get_Proj_proj(v));
+ v = new_r_Proj(get_nodes_block(v_pred), v_pred, get_irn_mode(v), get_Proj_proj(v));
}
}
v = identify_remember(value_table, v);
}
in[pos] = pred_info->avail;
} /* for */
- phi = new_r_Phi(current_ir_graph, block, arity, in, mode);
+ phi = new_r_Phi(block, arity, in, mode);
l = lookup(expr);
if (l == NULL) {
l = add(expr, value);
f = val_i;
}
- mux = new_rd_Mux(cond_dbg, current_ir_graph, mux_block, sel, f, t, get_irn_mode(phi));
+ mux = new_rd_Mux(cond_dbg, mux_block, sel, f, t, get_irn_mode(phi));
DB((dbg, LEVEL_2, "Generating %+F for %+F\n", mux, phi));
}
#endif
return;
} else {
- rewire(block, i, j, new_r_Jmp(current_ir_graph, mux_block));
+ rewire(block, i, j, new_r_Jmp(mux_block));
goto restart;
}
}
in[i++] = p;
}
assert(i == n);
- sync = new_r_Sync(irg, block, n, in);
+ sync = new_r_Sync(block, n, in);
exchange(proj, sync);
assert(pn_Load_M == pn_Store_M);
- proj = new_r_Proj(irg, block, mem_op, mode_M, pn_Load_M);
+ proj = new_r_Proj(block, mem_op, mode_M, pn_Load_M);
set_Sync_pred(sync, 0, proj);
n = ir_nodeset_size(&pi.this_mem);
in[i++] = p;
}
assert(i == n);
- sync = new_r_Sync(irg, block, n, in);
+ sync = new_r_Sync(block, n, in);
}
set_memop_mem(mem_op, sync);
}
/* a Load whose value is neither used nor exception checked, remove it */
exchange(info->projs[pn_Load_M], mem);
if (info->projs[pn_Load_X_regular])
- exchange(info->projs[pn_Load_X_regular], new_r_Jmp(current_ir_graph, get_nodes_block(load)));
+ exchange(info->projs[pn_Load_X_regular], new_r_Jmp(get_nodes_block(load)));
kill_node(load);
reduce_adr_usage(ptr);
}
/* FIXME: only true for little endian */
cnst = new_Const_long(mode_Iu, delta * 8);
- store_value = new_r_Shr(current_ir_graph, get_nodes_block(load),
+ store_value = new_r_Shr(get_nodes_block(load),
store_value, cnst, store_mode);
}
/* add an convert if needed */
if (store_mode != load_mode) {
- store_value = new_r_Conv(current_ir_graph, get_nodes_block(load),
- store_value, load_mode);
+ store_value = new_r_Conv(get_nodes_block(load), store_value, load_mode);
}
}
res |= CF_CHANGED;
}
if (info->projs[pn_Load_X_regular]) {
- exchange( info->projs[pn_Load_X_regular], new_r_Jmp(current_ir_graph, get_nodes_block(load)));
+ exchange( info->projs[pn_Load_X_regular], new_r_Jmp(get_nodes_block(load)));
res |= CF_CHANGED;
}
if (info->projs[pn_Load_res]) {
if (pred_info->projs[pn_Load_res] == NULL) {
/* create a new Proj again */
- pred_info->projs[pn_Load_res] = new_r_Proj(current_ir_graph, get_nodes_block(pred), pred, get_Load_mode(pred), pn_Load_res);
+ pred_info->projs[pn_Load_res] = new_r_Proj(get_nodes_block(pred), pred, get_Load_mode(pred), pn_Load_res);
}
value = pred_info->projs[pn_Load_res];
/* add an convert if needed */
if (get_Load_mode(pred) != load_mode) {
- value = new_r_Conv(current_ir_graph, get_nodes_block(load), value, load_mode);
+ value = new_r_Conv(get_nodes_block(load), value, load_mode);
}
exchange(info->projs[pn_Load_res], value);
res |= CF_CHANGED;
}
if (info->projs[pn_Load_X_regular]) {
- exchange( info->projs[pn_Load_X_regular], new_r_Jmp(current_ir_graph, get_nodes_block(load)));
+ exchange( info->projs[pn_Load_X_regular], new_r_Jmp(get_nodes_block(load)));
res |= CF_CHANGED;
}
/* copy the value from the const code irg and cast it */
res = copy_const_value(dbg, c);
- res = new_rd_Conv(dbg, current_ir_graph, block, res, l_mode);
+ res = new_rd_Conv(dbg, block, res, l_mode);
}
} else {
/* copy the value from the const code irg */
*/
exchange(info->projs[pn_Load_X_except], new_Bad());
info->projs[pn_Load_X_except] = NULL;
- exchange(info->projs[pn_Load_X_regular], new_r_Jmp(current_ir_graph, get_nodes_block(load)));
+ exchange(info->projs[pn_Load_X_regular], new_r_Jmp(get_nodes_block(load)));
info->projs[pn_Load_X_regular] = NULL;
res |= CF_CHANGED;
}
if (info->projs[pn_Load_X_regular]) {
/* should not happen, but if it does, remove it */
- exchange(info->projs[pn_Load_X_regular], new_r_Jmp(current_ir_graph, get_nodes_block(load)));
+ exchange(info->projs[pn_Load_X_regular], new_r_Jmp(get_nodes_block(load)));
res |= CF_CHANGED;
}
kill_node(load);
res |= CF_CHANGED;
}
if (info->projs[pn_Load_X_regular]) {
- exchange(info->projs[pn_Load_X_regular], new_r_Jmp(current_ir_graph, get_nodes_block(load)));
+ exchange(info->projs[pn_Load_X_regular], new_r_Jmp(get_nodes_block(load)));
info->projs[pn_Load_X_regular] = NULL;
res |= CF_CHANGED;
}
res |= CF_CHANGED;
}
if (info->projs[pn_Load_X_regular]) {
- exchange(info->projs[pn_Load_X_regular], new_r_Jmp(current_ir_graph, get_nodes_block(load)));
+ exchange(info->projs[pn_Load_X_regular], new_r_Jmp(get_nodes_block(load)));
info->projs[pn_Load_X_regular] = NULL;
res |= CF_CHANGED;
}
block = get_nodes_block(phi);
/* second step: create a new memory Phi */
- phiM = new_rd_Phi(get_irn_dbg_info(phi), current_ir_graph, block, n, inM, mode_M);
+ phiM = new_rd_Phi(get_irn_dbg_info(phi), block, n, inM, mode_M);
/* third step: create a new data Phi */
- phiD = new_rd_Phi(get_irn_dbg_info(phi), current_ir_graph, block, n, inD, mode);
+ phiD = new_rd_Phi(get_irn_dbg_info(phi), block, n, inD, mode);
/* rewire memory and kill the node */
for (i = n - 1; i >= 0; --i) {
}
/* fourth step: create the Store */
- store = new_rd_Store(db, current_ir_graph, block, phiM, ptr, phiD, 0);
+ store = new_rd_Store(db, block, phiM, ptr, phiD, 0);
#ifdef DO_CACHEOPT
co_set_irn_name(store, co_get_irn_ident(old_store));
#endif
- projM = new_rd_Proj(NULL, current_ir_graph, block, store, mode_M, pn_Store_M);
+ projM = new_rd_Proj(NULL, block, store, mode_M, pn_Store_M);
info = get_ldst_info(store, &wenv->obst);
info->projs[pn_Store_M] = projM;
/* fifths step: repair exception flow */
if (exc) {
- ir_node *projX = new_rd_Proj(NULL, current_ir_graph, block, store, mode_X, pn_Store_X_except);
+ ir_node *projX = new_rd_Proj(NULL, block, store, mode_X, pn_Store_X_except);
info->projs[pn_Store_X_except] = projX;
info->exc_block = exc;
if (res != NULL) {
irn = res->load;
} else {
- irn = new_rd_Load(db, current_ir_graph, pred, get_Phi_pred(phi, pos), ptr, load_mode, 0);
+ irn = new_rd_Load(db, pred, get_Phi_pred(phi, pos), ptr, load_mode, 0);
entry.load = irn;
set_insert(avail, &entry, sizeof(entry), hash_cache_entry(&entry));
DB((dbg, LEVEL_1, " Created %+F in %+F\n", irn, pred));
pe->load = irn;
ninfo = get_ldst_info(irn, phase_obst(&env->ph));
- ninfo->projs[pn_Load_M] = mem = new_r_Proj(current_ir_graph, pred, irn, mode_M, pn_Load_M);
+ ninfo->projs[pn_Load_M] = mem = new_r_Proj(pred, irn, mode_M, pn_Load_M);
set_Phi_pred(phi, pos, mem);
- ninfo->projs[pn_Load_res] = new_r_Proj(current_ir_graph, pred, irn, load_mode, pn_Load_res);
+ ninfo->projs[pn_Load_res] = new_r_Proj(pred, irn, load_mode, pn_Load_res);
}
/* now kill the old Load */
if (is_op_forking(cfop)) {
/* a critical edge */
ir_node *block = new_r_Block(irg, 1, &ins[i]);
- ir_node *jmp = new_r_Jmp(irg, block);
+ ir_node *jmp = new_r_Jmp(block);
ins[i] = jmp;
}
}
for (repr_pair = repr->input_pairs; repr_pair != NULL; repr_pair = repr_pair->next) {
ir_node *input = get_irn_n(repr_pair->irn, repr_pair->index);
ir_mode *mode = get_irn_mode(input);
- ir_node *phi = new_r_Phi(current_ir_graph, block, n, repr_pair->ins, mode);
+ ir_node *phi = new_r_Phi(block, n, repr_pair->ins, mode);
set_irn_n(repr_pair->irn, repr_pair->index, phi);
DEL_ARR_F(repr_pair->ins);
* Compare two nodes for root ordering.
*/
static int cmp_nodes(const void *a, const void *b) {
- ir_node *const *pa = a;
- ir_node *const *pb = b;
+ const ir_node *const *pa = a;
+ const ir_node *const *pb = b;
const ir_node *irn_a = *pa;
const ir_node *irn_b = *pb;
ir_opcode code_a = get_irn_opcode(irn_a);
ir_mode *mode = get_type_mode(param_tp);
if (mode != get_irn_mode(arg)) {
- arg = new_r_Conv(irg, block, arg, mode);
+ arg = new_r_Conv(block, arg, mode);
}
args_in[i] = arg;
}
ir_node *ret;
ret = get_Block_cfgpred(end_bl, i);
if (is_Return(ret)) {
- cf_pred[n_ret] = new_r_Jmp(irg, get_nodes_block(ret));
+ cf_pred[n_ret] = new_r_Jmp(get_nodes_block(ret));
n_ret++;
}
}
ir_node *res = get_Return_res(ret, j);
if (get_irn_mode(res) != res_mode) {
ir_node *block = get_nodes_block(res);
- res = new_r_Conv(irg, block, res, res_mode);
+ res = new_r_Conv(block, res, res_mode);
}
cf_pred[n_ret] = res;
n_ret++;
ir_node *ret;
ret = skip_Proj(get_Block_cfgpred(end_bl, i));
if (is_Call(ret)) {
- cf_pred[n_exc] = new_r_Proj(irg, get_nodes_block(ret), ret, mode_M, 3);
+ cf_pred[n_exc] = new_r_Proj(get_nodes_block(ret), ret, mode_M, 3);
n_exc++;
} else if (is_fragile_op(ret)) {
/* We rely that all cfops have the memory output at the same position. */
- cf_pred[n_exc] = new_r_Proj(irg, get_nodes_block(ret), ret, mode_M, 0);
+ cf_pred[n_exc] = new_r_Proj(get_nodes_block(ret), ret, mode_M, 0);
n_exc++;
} else if (is_Raise(ret)) {
- cf_pred[n_exc] = new_r_Proj(irg, get_nodes_block(ret), ret, mode_M, 1);
+ cf_pred[n_exc] = new_r_Proj(get_nodes_block(ret), ret, mode_M, 1);
n_exc++;
}
}
for (i = 0; i < n_exc; ++i)
end_preds[main_end_bl_arity + i] = cf_pred[i];
set_irn_in(main_end_bl, n_exc + main_end_bl_arity, end_preds);
- set_Tuple_pred(call, pn_Call_X_except, new_Bad());
- set_Tuple_pred(call, pn_Call_M_except, new_Bad());
+ set_Tuple_pred(call, pn_Call_X_except, new_Bad());
+ set_Tuple_pred(call, pn_Call_M_except, new_Bad());
free(end_preds);
}
free(res_pred);
env.changed = 1;
}
if (m->projs[pn_Load_X_regular]) {
- exchange(m->projs[pn_Load_X_regular], new_r_Jmp(current_ir_graph, get_nodes_block(load)));
+ exchange(m->projs[pn_Load_X_regular], new_r_Jmp(get_nodes_block(load)));
m->projs[pn_Load_X_regular] = NULL;
env.changed = 1;
}
/* different modes: check if conversion is possible without changing the bits */
if (can_convert_to(other, mode)) {
ir_node *block = get_nodes_block(irn);
- return new_r_Conv(current_ir_graph, block, irn, mode);
+ return new_r_Conv(block, irn, mode);
}
/* otherwise not possible ... yet */
return NULL;
/* a hidden cast */
dbg_info *db = get_irn_dbg_info(load);
ir_node *block = get_nodes_block(proj);
- def = new_rd_Conv(db, current_ir_graph, block, def, mode);
+ def = new_rd_Conv(db, block, def, mode);
}
exchange(proj, def);
}
}
proj = op->projs[pn_Load_X_regular];
if (proj != NULL) {
- exchange(proj, new_r_Jmp(current_ir_graph, get_nodes_block(load)));
+ exchange(proj, new_r_Jmp(get_nodes_block(load)));
}
} /* replace_load */
}
proj = op->projs[pn_Store_X_regular];
if (proj != NULL) {
- exchange(proj, new_r_Jmp(current_ir_graph, get_nodes_block(store)));
+ exchange(proj, new_r_Jmp(get_nodes_block(store)));
}
} /* remove_store */
}
if (need_phi) {
/* build a Phi */
- ir_node *phi = new_r_Phi(current_ir_graph, bl->block, n, ins, mode);
+ ir_node *phi = new_r_Phi(bl->block, n, ins, mode);
memop_t *phiop = alloc_memop(phi);
phiop->value = first->value;
assert(last_mem != NULL);
adr = phi_translate(op->value.address, block, i);
- load = new_rd_Load(db, current_ir_graph, pred, last_mem, adr, mode, cons_none);
- def = new_r_Proj(current_ir_graph, pred, load, mode, pn_Load_res);
+ load = new_rd_Load(db, pred, last_mem, adr, mode, cons_none);
+ def = new_r_Proj(pred, load, mode, pn_Load_res);
DB((dbg, LEVEL_1, "Created new %+F in %+F for party redundant %+F\n", load, pred, op->node));
new_op = alloc_memop(load);
- new_op->mem = new_r_Proj(current_ir_graph, pred, load, mode_M, pn_Load_M);
+ new_op->mem = new_r_Proj(pred, load, mode_M, pn_Load_M);
new_op->value.address = adr;
new_op->value.id = op->value.id;
new_op->value.mode = mode;
}
in[i] = conv_to(pred_bl->avail->value.value, mode);
}
- phi = new_r_Phi(current_ir_graph, block, n, in, mode);
+ phi = new_r_Phi(block, n, in, mode);
DB((dbg, LEVEL_1, "Created new %+F in %+F for now redundant %+F\n", phi, block, op->node));
phi_op = clone_memop_phi(op, phi);
* @return the newly created node
*/
static ir_node *do_apply(ir_opcode code, dbg_info *db, ir_node *op1, ir_node *op2, ir_mode *mode) {
- ir_graph *irg = current_ir_graph;
ir_node *result;
ir_node *block = find_location(get_nodes_block(op1), get_nodes_block(op2));
switch (code) {
case iro_Mul:
- result = new_rd_Mul(db, irg, block, op1, op2, mode);
+ result = new_rd_Mul(db, block, op1, op2, mode);
break;
case iro_Add:
- result = new_rd_Add(db, irg, block, op1, op2, mode);
+ result = new_rd_Add(db, block, op1, op2, mode);
break;
case iro_Sub:
- result = new_rd_Sub(db, irg, block, op1, op2, mode);
+ result = new_rd_Sub(db, block, op1, op2, mode);
break;
default:
panic("Unsupported opcode");
if (get_irn_mode(pred) != mode) {
ir_node *block = get_nodes_block(pred);
- pred = new_r_Conv(current_ir_graph, block, pred, mode);
+ pred = new_r_Conv(block, pred, mode);
set_Add_left(irn, pred);
}
pred = get_Add_right(irn);
if (get_irn_mode(pred) != mode) {
ir_node *block = get_nodes_block(pred);
- pred = new_r_Conv(current_ir_graph, block, pred, mode);
+ pred = new_r_Conv(block, pred, mode);
set_Add_right(irn, pred);
}
}
if (l_mode != mode) {
ir_node *block = get_nodes_block(left);
- left = new_r_Conv(current_ir_graph, block, left, mode);
+ left = new_r_Conv(block, left, mode);
set_Sub_left(irn, left);
}
if (r_mode != mode) {
ir_node *block = get_nodes_block(right);
- right = new_r_Conv(current_ir_graph, block, right, mode);
+ right = new_r_Conv(block, right, mode);
set_Sub_right(irn, right);
}
}
ir_node *bl = get_nodes_block(call);
sym.entity_p = new_entity;
- callee = new_r_SymConst(irg, bl, mode_P_code, sym, symconst_addr_ent);
+ callee = new_r_SymConst(irg, mode_P_code, sym, symconst_addr_ent);
mtp = get_entity_type(new_entity);
n_params = get_Call_n_params(call);
in[new_params++] = get_Call_param(call, i);
}
/* Create and return the new Call. */
- return new_r_Call(irg, bl, get_Call_mem(call),
+ return new_r_Call(bl, get_Call_mem(call),
callee, n_params - 1, in, get_entity_type(new_entity));
}
dbi = get_irn_dbg_info(n);
/* Beware of SubP(P, Is) */
- irn = new_rd_Minus(dbi, current_ir_graph, block, right, rmode);
- irn = new_rd_Add(dbi, current_ir_graph, block, left, irn, mode);
+ irn = new_rd_Minus(dbi, block, right, rmode);
+ irn = new_rd_Add(dbi, block, left, irn, mode);
DBG((dbg, LEVEL_5, "Applied: %n - %n => %n + (-%n)\n",
get_Sub_left(n), right, get_Sub_left(n), right));
if (mode_is_int(mode_c1) && mode_is_int(mode_c2)) {
/* get the bigger one */
if (get_mode_size_bits(mode_c1) > get_mode_size_bits(mode_c2))
- c2 = new_r_Conv(current_ir_graph, block, c2, mode_c1);
+ c2 = new_r_Conv(block, c2, mode_c1);
else if (get_mode_size_bits(mode_c1) < get_mode_size_bits(mode_c2))
- c1 = new_r_Conv(current_ir_graph, block, c1, mode_c2);
+ c1 = new_r_Conv(block, c1, mode_c2);
else {
/* Try to cast the real const */
if (c_c1 == REAL_CONSTANT)
- c1 = new_r_Conv(current_ir_graph, block, c1, mode_c2);
+ c1 = new_r_Conv(block, c1, mode_c2);
else
- c2 = new_r_Conv(current_ir_graph, block, c2, mode_c1);
+ c2 = new_r_Conv(block, c2, mode_c1);
}
}
}
/* we can only multiplication rules on integer arithmetic */
if (mode_is_int(get_irn_mode(t1)) && mode_is_int(get_irn_mode(t2))) {
- in[0] = new_rd_Mul(NULL, current_ir_graph, block, c, t1, mode);
- in[1] = new_rd_Mul(NULL, current_ir_graph, block, c, t2, mode);
+ in[0] = new_rd_Mul(NULL, block, c, t1, mode);
+ in[1] = new_rd_Mul(NULL, block, c, t2, mode);
irn = optimize_node(new_ir_node(NULL, current_ir_graph, block, op, mode, 2, in));
blk = get_nodes_block(n);
c = new_Const(tv);
- irn = new_rd_Mul(get_irn_dbg_info(n), current_ir_graph, blk, x, c, mode);
+ irn = new_rd_Mul(get_irn_dbg_info(n), blk, x, c, mode);
if (irn != n) {
exchange(n, irn);
mode = get_irn_mode(n);
if (is_Add(n))
- irn = new_rd_Add(dbg, current_ir_graph, blk, a, b, mode);
+ irn = new_rd_Add(dbg, blk, a, b, mode);
else
- irn = new_rd_Sub(dbg, current_ir_graph, blk, a, b, mode);
+ irn = new_rd_Sub(dbg, blk, a, b, mode);
blk = earliest_block(irn, x, curr_blk);
if (op == op_Mul)
- irn = new_rd_Mul(dbg, current_ir_graph, blk, irn, x, mode);
+ irn = new_rd_Mul(dbg, blk, irn, x, mode);
else
- irn = new_rd_Shl(dbg, current_ir_graph, blk, irn, x, mode);
+ irn = new_rd_Shl(dbg, blk, irn, x, mode);
exchange(n, irn);
*node = irn;
ir_node *block = get_nodes_block(ret);
/* create a new Jmp for every Ret and place the in in */
- in[j] = new_r_Jmp(irg, block);
+ in[j] = new_r_Jmp(block);
/* save the return values and shuffle them */
for (k = 0; k < n_ret_vals; ++k)
if (first)
in[i] = first;
else
- in[i] = new_r_Phi(irg, block, n_rets, &retvals[j], get_irn_mode(retvals[j]));
+ in[i] = new_r_Phi(block, n_rets, &retvals[j], get_irn_mode(retvals[j]));
}
- endbl_in[last_idx++] = new_rd_Return(combined_dbgi, irg, block, in[0], n_ret_vals-1, &in[1]);
+ endbl_in[last_idx++] = new_rd_Return(combined_dbgi, block, in[0], n_ret_vals-1, &in[1]);
set_irn_in(endbl, last_idx, endbl_in);
/* simply place a new block here */
ir_graph *irg = get_irn_irg(retbl);
ir_node *block = new_r_Block(irg, 1, &pred);
- ir_node *jmp = new_r_Jmp(irg, block);
+ ir_node *jmp = new_r_Jmp(block);
set_Block_cfgpred(retbl, i, jmp);
}
}
in[j] = (is_Phi(pred) && get_nodes_block(pred) == block) ? get_Phi_pred(pred, i) : pred;
}
- new_ret = new_rd_Return(dbgi, irg, new_bl, in[0], n_ret_vals - 1, &in[1]);
+ new_ret = new_rd_Return(dbgi, new_bl, in[0], n_ret_vals - 1, &in[1]);
if (! is_Bad(new_ret)) {
/*
ir_node *block = get_nodes_block(p);
n = get_irn_link(p);
- in[i++] = new_r_Jmp(irg, block);
+ in[i++] = new_r_Jmp(block);
// exchange(p, new_r_Bad(irg));
/* create a new block at start */
block = new_r_Block(irg, env->n_tail_calls + 1, in);
- jmp = new_r_Jmp(irg, block);
+ jmp = new_r_Jmp(block);
/* the old first block is now the second one */
set_Block_cfgpred(data.block, data.blk_idx, jmp);
/* build the memory phi */
i = 0;
- in[i] = new_r_Proj(irg, get_irg_start_block(irg), get_irg_start(irg), mode_M, pn_Start_M);
+ in[i] = new_r_Proj(get_irg_start_block(irg), get_irg_start(irg), mode_M, pn_Start_M);
set_irg_initial_mem(irg, in[i]);
++i;
}
assert(i == env->n_tail_calls + 1);
- phis[0] = new_r_Phi(irg, block, env->n_tail_calls + 1, in, mode_M);
+ phis[0] = new_r_Phi(block, env->n_tail_calls + 1, in, mode_M);
/* build the data Phi's */
if (n_params > 0) {
for (i = 0; i < n_params; ++i) {
ir_mode *mode = get_type_mode(get_method_param_type(method_tp, i));
- in[0] = new_r_Proj(irg, args_bl, args, mode, i);
+ in[0] = new_r_Proj(args_bl, args, mode, i);
for (j = 0; j < env->n_tail_calls; ++j)
in[j + 1] = call_params[j][i];
- phis[i + 1] = new_r_Phi(irg, block, env->n_tail_calls + 1, in, mode);
+ phis[i + 1] = new_r_Phi(block, env->n_tail_calls + 1, in, mode);
}
}
/* Transform Phi */
blk = get_nodes_block(phi);
- nn = new_r_Phi(current_ir_graph, blk, n_preds, pred, get_irn_mode(phi));
+ nn = new_r_Phi(blk, n_preds, pred, get_irn_mode(phi));
set_irn_typeinfo_type(nn, fromtype);
- nn = new_r_Cast(current_ir_graph, blk, nn, totype);
+ nn = new_r_Cast(blk, nn, totype);
set_irn_typeinfo_type(nn, totype);
exchange(phi, nn);
return 1;
return res
def format_blockdecl(node):
+ if hasattr(node, "knownBlock"):
+ return "ir_graph *irg"
+ else:
+ return "ir_node *block"
+
+def format_irgassign(node):
if hasattr(node, "knownBlock"):
return ""
else:
- return ", ir_node *block"
+ return "ir_graph *irg = get_Block_irg(block);\n"
def format_block(node):
if hasattr(node, "knownBlock"):
- return ""
+ return "irg"
else:
- return ", block"
+ return "block"
def format_curblock(node):
if hasattr(node, "knownBlock"):
- return ""
+ return "current_ir_graph"
else:
- return ", current_ir_graph->current_block"
+ return "current_ir_graph->current_block"
def format_insdecl(node):
arity = node.arity
env.filters['argdecls'] = format_argdecls
env.filters['args'] = format_args
env.filters['blockdecl'] = format_blockdecl
+env.filters['irgassign'] = format_irgassign
env.filters['block'] = format_block
env.filters['curblock'] = format_curblock
env.filters['insdecl'] = format_insdecl
constructor_template = env.from_string('''
-ir_node *new_rd_{{node.constrname}}(dbg_info *dbgi, ir_graph *irg{{node|blockdecl}}{{node|argdecls}})
+ir_node *new_rd_{{node.constrname}}(dbg_info *dbgi, {{node|blockdecl}}{{node|argdecls}})
{
ir_node *res;
ir_graph *rem = current_ir_graph;
+ {{node|irgassign}}
{{node|insdecl}}
current_ir_graph = irg;
res = new_ir_node(dbgi, irg, {{node.block}}, op_{{node.name}}, {{node.mode}}, {{node|arity_and_ins}});
return res;
}
-ir_node *new_r_{{node.constrname}}(ir_graph *irg{{node|blockdecl}}{{node|argdecls}})
+ir_node *new_r_{{node.constrname}}({{node|blockdecl}}{{node|argdecls}})
{
- return new_rd_{{node.constrname}}(NULL, irg{{node|block}}{{node|args}});
+ return new_rd_{{node.constrname}}(NULL, {{node|block}}{{node|args}});
}
ir_node *new_d_{{node.constrname}}(dbg_info *dbgi{{node|argdecls}})
{
ir_node *res;
{{ node.d_pre }}
- res = new_rd_{{node.constrname}}(dbgi, current_ir_graph{{node|curblock}}{{node|args}});
+ res = new_rd_{{node.constrname}}(dbgi, {{node|curblock}}{{node|args}});
{{ node.d_post }}
return res;
}
def format_block(node):
if hasattr(node, "knownBlock"):
- return ""
+ return "current_ir_graph"
else:
- return ", get_node(env, preds[0])"
+ return "get_node(env, preds[0])"
env = Environment()
env.filters['args'] = format_args
{% for attr in node.constructor_args %}{{attr.importcmd}}
{% endfor %}
{% for special in node.special_constructors %}if({{special.attrname}} == {{special.value}})
- newnode = new_r_{{special.constrname}}(current_ir_graph{{node|block}}{{node.arguments|args}});
+ newnode = new_r_{{special.constrname}}({{node|block}}{{node.arguments|args}});
else{% endfor %}
- newnode = new_r_{{node.name}}(current_ir_graph{{node|block}}{{node.arguments|args}});
+ newnode = new_r_{{node.name}}({{node|block}}{{node.arguments|args}});
{% for (initarg, initfunc) in node.initargs %}{{initfunc}}(newnode, {{initarg}});
{% endfor %}
break;