Commit af011537 authored by Moritz Kroll's avatar Moritz Kroll
Browse files

Added Dummy node which does not CSE with anything

[r25322]
parent 6885fb18
......@@ -4481,6 +4481,12 @@ ir_node *new_ASM(int arity, ir_node *in[], ir_asm_constraint *inputs,
int n_outs, ir_asm_constraint *outputs,
int n_clobber, ident *clobber[], ident *asm_text);
/** Constructor for a Dummy node.
*
* @param *mode The mode of the node.
*/
ir_node *new_Dummy(ir_mode *mode);
/*---------------------------------------------------------------------*/
/* The comfortable interface. */
/* Supports automatic Phi node construction. */
......
......@@ -96,6 +96,7 @@ typedef enum {
iro_InstOf, iro_Raise, iro_Bound,
iro_Pin,
iro_ASM, iro_Builtin,
iro_Dummy,
iro_Anchor,
/* first not middleend node number */
iro_Last = iro_Anchor,
......@@ -197,6 +198,8 @@ extern ir_op *op_Pin; ir_op *get_op_Pin (void);
extern ir_op *op_ASM; ir_op *get_op_ASM (void);
extern ir_op *op_Builtin; ir_op *get_op_Builtin (void);
extern ir_op *op_Dummy; ir_op *get_op_Dummy (void);
extern ir_op *op_Anchor; ir_op *get_op_Anchor (void);
/** Returns the ident for the opcode name */
......
......@@ -3157,6 +3157,10 @@ ir_node *new_Bound(ir_node *store, ir_node *idx, ir_node *lower, ir_node *upper)
ir_node *new_Pin(ir_node *node) {
return new_d_Pin(NULL, node);
}
ir_node *new_Dummy(ir_mode *m) {
ir_graph *irg = current_ir_graph;
return new_ir_node(NULL, irg, get_irg_start_block(irg), op_Dummy, m, 0, NULL);
}
ir_node *new_ASM(int arity, ir_node *in[], ir_asm_constraint *inputs,
int n_outs, ir_asm_constraint *outputs,
int n_clobber, ident *clobber[], ident *asm_text) {
......
......@@ -113,6 +113,7 @@ ir_op *op_Bound; ir_op *get_op_Bound (void) { return op_Bound; }
ir_op *op_Pin; ir_op *get_op_Pin (void) { return op_Pin; }
ir_op *op_ASM; ir_op *get_op_ASM (void) { return op_ASM; }
ir_op *op_Dummy; ir_op *get_op_Dummy (void) { return op_Dummy; }
ir_op *op_Anchor; ir_op *get_op_Anchor (void) { return op_Anchor; }
/*
......@@ -356,6 +357,8 @@ init_op(void)
op_ASM = new_ir_op(iro_ASM, "ASM", op_pin_state_mem_pinned, K|M, oparity_variable, -1, sizeof(asm_attr), NULL);
op_Builtin = new_ir_op(iro_Builtin, "Builtin", op_pin_state_mem_pinned, M, oparity_variable, -1, sizeof(builtin_attr), NULL);
op_Dummy = new_ir_op(iro_Dummy, "Dummy", op_pin_state_pinned, X|F|S|c|NB,oparity_zero, -1, 0, NULL);
op_Anchor = new_ir_op(iro_Anchor, "Anchor", op_pin_state_pinned, N|NB, oparity_variable, -1, 0, NULL);
#undef S
......@@ -443,6 +446,7 @@ void finish_op(void) {
free_ir_op (op_Pin ); op_Pin = NULL;
free_ir_op (op_ASM ); op_ASM = NULL;
free_ir_op (op_Dummy ); op_Dummy = NULL;
free_ir_op (op_Anchor ); op_Anchor = NULL;
}
......
......@@ -6091,6 +6091,12 @@ static int node_cmp_attr_ASM(ir_node *a, ir_node *b) {
return 0;
} /* node_cmp_attr_ASM */
/** Compares the inexistent attributes of two Dummy nodes. */
static int node_cmp_attr_Dummy(ir_node *a, ir_node *b)
{
return 1;
}
/**
* Set the default node attribute compare operation for an ir_op_ops.
*
......@@ -6129,6 +6135,7 @@ static ir_op_ops *firm_set_default_node_cmp_attr(ir_opcode code, ir_op_ops *ops)
CASE(Quot);
CASE(Bound);
CASE(Builtin);
CASE(Dummy);
/* FIXME CopyB */
default:
/* leave NULL */;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment