Added Dummy node which does not CSE with anything
authorMoritz Kroll <Moritz.Kroll@gmx.de>
Wed, 21 Jan 2009 17:40:25 +0000 (17:40 +0000)
committerMoritz Kroll <Moritz.Kroll@gmx.de>
Wed, 21 Jan 2009 17:40:25 +0000 (17:40 +0000)
[r25322]

include/libfirm/ircons.h
include/libfirm/irop.h
ir/ir/ircons.c
ir/ir/irop.c
ir/ir/iropt.c

index ac1dd2b..f251e69 100644 (file)
@@ -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.                           */
index 2ae87d3..db0544d 100644 (file)
@@ -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 */
index fe13edd..08ce8c5 100644 (file)
@@ -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) {
index 5f7c539..9ae042e 100644 (file)
@@ -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;
 }
 
index 50a00bc..6b212d1 100644 (file)
@@ -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 */;