return res;
}
+static ir_node *
+new_bd_Keep(dbg_info *db, ir_node *block, int n, ir_node *in[])
+{
+ ir_graph *irg = current_ir_graph;
+ ir_node *res;
+
+ res = new_ir_node(db, irg, block, op_Keep, mode_ANY, n, in);
+ keep_alive(res);
+
+ res = optimize_node(res);
+ IRN_VRFY_IRG(res, irg);
+ return res;
+}
+
/* --------------------------------------------- */
/* private interfaces, for professional use only */
/* --------------------------------------------- */
return res;
}
+ir_node *new_rd_Keep(dbg_info *db, ir_graph *irg, ir_node *block, int n, ir_node *in[])
+{
+ ir_node *res;
+ ir_graph *rem = current_ir_graph;
+
+ current_ir_graph = irg;
+ res = new_bd_Keep(db, block, n, in);
+ current_ir_graph = rem;
+
+ return res;
+}
+
ir_node *new_r_Block (ir_graph *irg, int arity, ir_node **in) {
return new_rd_Block(NULL, irg, arity, in);
}
return new_rd_Bound(NULL, irg, block, store, idx, lower, upper);
}
+ir_node *new_r_Keep(ir_graph *irg, ir_node *block,
+ int n, ir_node *in[])
+{
+ return new_rd_Keep(NULL, irg, block, n, in);
+}
+
/** ********************/
/** public interfaces */
/** construction tools */
return res;
}
+ir_node *new_d_Keep(dbg_info *db, int n, ir_node *in[])
+{
+ return new_bd_Keep(db, current_ir_graph->current_block, n, in);
+}
+
/* ********************************************************************* */
/* Comfortable interface with automatic Phi node construction. */
/* (Uses also constructors of ?? interface, except new_Block. */
ir_node *new_Bound(ir_node *store, ir_node *idx, ir_node *lower, ir_node *upper) {
return new_d_Bound(NULL, store, idx, lower, upper);
}
+ir_node *new_Keep(int n, ir_node *in[]) {
+ return new_d_Keep(NULL, n, in);
+}
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);
+/**
+ * Construct a new Keep node.
+ * @see new_Keep().
+ */
+ir_node *new_rd_Keep(dbg_info *db, ir_graph *irg, ir_node *block,
+ int n, ir_node *in[]);
+
/*-------------------------------------------------------------------------*/
/* The raw interface without debug support */
/*-------------------------------------------------------------------------*/
ir_node *new_r_Bound(ir_graph *irg, ir_node *block,
ir_node *store, ir_node *idx, ir_node *lower, ir_node *upper);
+/**
+ * Constructor of a Keep node.
+ * @see new_Keep()
+ */
+ir_node *new_r_Keep(ir_graph *irg, ir_node *block, int n, ir_node *in[]);
+
/*-----------------------------------------------------------------------*/
/* The block oriented interface */
/*-----------------------------------------------------------------------*/
*/
ir_node *new_d_Bound(dbg_info *db, ir_node *store, ir_node *idx, ir_node *lower, ir_node *upper);
+/**
+ * Constructor for a Keep node.
+ * @see new_Keep.
+ */
+ir_node *new_d_Keep(dbg_info *db, int n, ir_node *in[]);
+
/*-----------------------------------------------------------------------*/
/* The block oriented interface without debug support */
/*-----------------------------------------------------------------------*/
*/
ir_node *new_Bound(ir_node *store, ir_node *idx, ir_node *lower, ir_node *upper);
+/**
+ * Constructor for a Keep node.
+ * @param n Number of inputs.
+ * @param in Input array.
+ * @reutrn A new Keep node.
+ */
+ir_node *new_Keep(int n, ir_node *in[]);
+
/*---------------------------------------------------------------------*/
/* The comfortable interface. */
/* Supports automatic Phi node construction. */
ir_op *op_CopyB; ir_op *get_op_CopyB (void) { return op_CopyB; }
ir_op *op_Bound; ir_op *get_op_Bound (void) { return op_Bound; }
+ir_op *op_Keep; ir_op *get_op_Keep (void) { return op_Keep; }
/*
* Copies all attributes stored in the old node to the new node.
op_CopyB = new_ir_op(iro_CopyB, "CopyB", op_pin_state_mem_pinned, L|F|H, oparity_trinary, -1, sizeof(copyb_attr), NULL);
op_Bound = new_ir_op(iro_Bound, "Bound", op_pin_state_mem_pinned, L|F|H, oparity_trinary, -1, sizeof(bound_attr), NULL);
+ op_Keep = new_ir_op(iro_Keep, "Keep", op_pin_state_pinned, N, oparity_variable, -1, 0, NULL);
+
#undef H
#undef Y
#undef F
free_ir_op (op_Mux ); op_Mux = NULL;
free_ir_op (op_CopyB ); op_CopyB = NULL;
free_ir_op (op_Bound ); op_Bound = NULL;
+
+ free_ir_op (op_Keep ); op_Keep = NULL;
}
/* Returns the string for the opcode. */
iro_Proj, iro_Tuple, iro_Id, iro_Bad, iro_Confirm,
iro_Unknown, iro_Filter, iro_Break, iro_CallBegin, iro_EndReg, iro_EndExcept,
iro_NoMem, iro_Mux, iro_CopyB, iro_Bound,
+ iro_Keep,
iro_MaxOpcode
} opcode;
extern ir_op *op_Mux; ir_op *get_op_Mux (void);
extern ir_op *op_CopyB; ir_op *get_op_CopyB (void);
extern ir_op *op_Bound; ir_op *get_op_Bound (void);
+extern ir_op *op_Keep; ir_op *get_op_Keep (void);
/** Returns the ident for the opcode name */
ident *get_op_ident(const ir_op *op);