fix weak external functions
[libfirm] / ir / ir / irnode.c
index 0f053e5..83bf3ed 100644 (file)
@@ -163,16 +163,17 @@ new_ir_node(dbg_info *db, ir_graph *irg, ir_node *block, ir_op *op, ir_mode *mod
                memcpy(&res->in[1], in, sizeof(ir_node *) * arity);
        }
 
-       res->in[0] = block;
+       res->in[0]   = block;
        set_irn_dbg_info(res, db);
-       res->out = NULL;
-
-#ifdef DEBUG_libfirm
+       res->out     = NULL;
        res->node_nr = get_irp_new_node_nr();
-#endif
 
-       for (i = 0; i < EDGE_KIND_LAST; ++i)
+       for (i = 0; i < EDGE_KIND_LAST; ++i) {
                INIT_LIST_HEAD(&res->edge_info[i].outs_head);
+               /* edges will be build immediately */
+               res->edge_info[i].edges_built = 1;
+               res->edge_info[i].out_count = 0;
+       }
 
        /* don't put this into the for loop, arity is -1 for some nodes! */
        edges_notify_edge(res, -1, res->in[0], NULL, irg);
@@ -183,6 +184,25 @@ new_ir_node(dbg_info *db, ir_graph *irg, ir_node *block, ir_op *op, ir_mode *mod
        if (get_irg_phase_state(irg) == phase_backend) {
                be_info_new_node(res);
        }
+       // Init the VRP structures
+       res->vrp.range_type = VRP_UNDEFINED;
+       res->vrp.valid = 0;
+       if(mode_is_int(mode)) {
+               // We are assuming that 0 is always represented as 0x0000
+               res->vrp.bits_set = new_tarval_from_long(0, mode);
+               res->vrp.bits_not_set = new_tarval_from_long(0, mode);
+               res->vrp.range_bottom = get_tarval_top();
+               res->vrp.range_top = get_tarval_top();
+       } else {
+               res->vrp.bits_set = get_tarval_bad();
+               res->vrp.bits_not_set = get_tarval_bad();
+               res->vrp.range_bottom = get_tarval_bad();
+               res->vrp.range_top = get_tarval_bad();
+       }
+       res->vrp.bits_node = NULL;
+       res->vrp.range_node = NULL;
+       res->vrp.range_op = VRP_NONE;
+
 
        return res;
 }
@@ -232,7 +252,7 @@ ir_node **get_irn_in(const ir_node *node) {
 void set_irn_in(ir_node *node, int arity, ir_node **in) {
        int i;
        ir_node *** pOld_in;
-       ir_graph *irg = current_ir_graph;
+       ir_graph *irg = get_irn_irg(node);
 
        assert(node);
 #ifdef INTERPROCEDURAL_VIEW
@@ -272,11 +292,11 @@ void set_irn_in(ir_node *node, int arity, ir_node **in) {
 }
 
 ir_node *(get_irn_intra_n)(const ir_node *node, int n) {
-       return _get_irn_intra_n (node, n);
+       return _get_irn_intra_n(node, n);
 }
 
 ir_node *(get_irn_inter_n)(const ir_node *node, int n) {
-       return _get_irn_inter_n (node, n);
+       return _get_irn_inter_n(node, n);
 }
 
 ir_node *(*_get_irn_n)(const ir_node *node, int n) = _get_irn_intra_n;
@@ -291,6 +311,7 @@ void set_irn_n(ir_node *node, int n, ir_node *in) {
        assert(n < get_irn_arity(node));
        assert(in && in->kind == k_ir_node);
 
+#ifdef INTERPROCEDURAL_VIEW
        if ((n == -1) && (get_irn_opcode(node) == iro_Filter)) {
                /* Change block pred in both views! */
                node->in[n + 1] = in;
@@ -298,7 +319,6 @@ void set_irn_n(ir_node *node, int n, ir_node *in) {
                node->attr.filter.in_cg[n + 1] = in;
                return;
        }
-#ifdef INTERPROCEDURAL_VIEW
        if (get_interprocedural_view()) { /* handle Filter and Block specially */
                if (get_irn_opcode(node) == iro_Filter) {
                        assert(node->attr.filter.in_cg);
@@ -407,11 +427,6 @@ void (set_irn_mode)(ir_node *node, ir_mode *mode) {
        _set_irn_mode(node, mode);
 }
 
-ir_modecode get_irn_modecode(const ir_node *node) {
-       assert(node);
-       return node->mode->code;
-}
-
 /** Gets the string representation of the mode .*/
 const char *get_irn_modename(const ir_node *node) {
        assert(node);
@@ -497,11 +512,7 @@ void set_irn_pinned(ir_node *node, op_pin_state state) {
 /* Outputs a unique number for this node */
 long get_irn_node_nr(const ir_node *node) {
        assert(node);
-#ifdef DEBUG_libfirm
        return node->node_nr;
-#else
-       return (long)PTR_TO_INT(node);
-#endif
 }
 
 const_attr *get_irn_const_attr(ir_node *node) {
@@ -530,9 +541,9 @@ symconst_attr *get_irn_symconst_attr(ir_node *node) {
        return &node->attr.symc;
 }
 
-ir_type *get_irn_call_attr(ir_node *node) {
+call_attr *get_irn_call_attr(ir_node *node) {
        assert(is_Call(node));
-       return node->attr.call.cld_tp = skip_tid(node->attr.call.cld_tp);
+       return &node->attr.call;
 }
 
 sel_attr *get_irn_sel_attr(ir_node *node) {
@@ -643,10 +654,6 @@ ir_type *is_tls_pointer(const ir_node *n) {
        return NULL;
 }
 
-/* Returns an array with the predecessors of the Block. Depending on
-   the implementation of the graph data structure this can be a copy of
-   the internal representation of predecessors as well as the internal
-   array itself. Therefore writing to this array might obstruct the ir. */
 ir_node **get_Block_cfgpred_arr(ir_node *node) {
        assert(is_Block(node));
        return (ir_node **)&(get_irn_in(node)[1]);
@@ -665,6 +672,16 @@ void set_Block_cfgpred(ir_node *node, int pos, ir_node *pred) {
        set_irn_n(node, pos, pred);
 }
 
+int get_Block_cfgpred_pos(const ir_node *block, const ir_node *pred) {
+       int i;
+
+       for (i = get_Block_n_cfgpreds(block) - 1; i >= 0; --i) {
+               if (get_Block_cfgpred_block(block, i) == pred)
+                       return i;
+       }
+       return -1;
+}
+
 ir_node *(get_Block_cfgpred_block)(const ir_node *node, int pos) {
        return _get_Block_cfgpred_block(node, pos);
 }
@@ -788,6 +805,7 @@ ir_node *get_Block_MacroBlock(const ir_node *block) {
 /* Sets the macro block header of a block. */
 void set_Block_MacroBlock(ir_node *block, ir_node *mbh) {
        assert(is_Block(block));
+       mbh = skip_Id(mbh);
        assert(is_Block(mbh));
        set_irn_n(block, -1, mbh);
 }
@@ -804,25 +822,47 @@ ir_node *get_irn_MacroBlock(const ir_node *n) {
 }
 
 /* returns the graph of a Block. */
-ir_graph *get_Block_irg(const ir_node *block) {
-       assert(is_Block(block));
-       return block->attr.block.irg;
+ir_graph *(get_Block_irg)(const ir_node *block) {
+       return _get_Block_irg(block);
 }
 
-int has_Block_label(const ir_node *block) {
+ir_entity *create_Block_entity(ir_node *block) {
+       ir_entity *entity;
        assert(is_Block(block));
-       return block->attr.block.has_label;
+
+       entity = block->attr.block.entity;
+       if (entity == NULL) {
+               ir_label_t  nr;
+               ir_type   *glob;
+
+               glob = get_glob_type();
+               entity = new_entity(glob, id_unique("block_%u"), get_code_type());
+               set_entity_visibility(entity, ir_visibility_local);
+               set_entity_linkage(entity, IR_LINKAGE_CONSTANT);
+               nr = get_irp_next_label_nr();
+               set_entity_label(entity, nr);
+               set_entity_compiler_generated(entity, 1);
+
+               block->attr.block.entity = entity;
+       }
+       return entity;
 }
 
-ir_label_t get_Block_label(const ir_node *block) {
+ir_entity *get_Block_entity(const ir_node *block) {
        assert(is_Block(block));
-       return block->attr.block.label;
+       return block->attr.block.entity;
 }
 
-void set_Block_label(ir_node *block, ir_label_t label) {
+void set_Block_entity(ir_node *block, ir_entity *entity)
+{
        assert(is_Block(block));
-       block->attr.block.has_label = 1;
-       block->attr.block.label = label;
+       assert(get_entity_type(entity) == get_code_type());
+       block->attr.block.entity = entity;
+}
+
+int has_Block_entity(const ir_node *block)
+{
+       return block->attr.block.entity != NULL;
 }
 
 ir_node *(get_Block_phis)(const ir_node *block) {
@@ -975,49 +1015,6 @@ void set_IJmp_target(ir_node *ijmp, ir_node *tgt) {
        set_irn_n(ijmp, 0, tgt);
 }
 
-/*
-> Implementing the case construct (which is where the constant Proj node is
-> important) involves far more than simply determining the constant values.
-> We could argue that this is more properly a function of the translator from
-> Firm to the target machine.  That could be done if there was some way of
-> projecting "default" out of the Cond node.
-I know it's complicated.
-Basically there are two problems:
- - determining the gaps between the Projs
- - determining the biggest case constant to know the proj number for
-   the default node.
-I see several solutions:
-1. Introduce a ProjDefault node.  Solves both problems.
-   This means to extend all optimizations executed during construction.
-2. Give the Cond node for switch two flavors:
-   a) there are no gaps in the Projs  (existing flavor)
-   b) gaps may exist, default proj is still the Proj with the largest
-      projection number.  This covers also the gaps.
-3. Fix the semantic of the Cond to that of 2b)
-
-Solution 2 seems to be the best:
-Computing the gaps in the Firm representation is not too hard, i.e.,
-libFIRM can implement a routine that transforms between the two
-flavours.  This is also possible for 1) but 2) does not require to
-change any existing optimization.
-Further it should be far simpler to determine the biggest constant than
-to compute all gaps.
-I don't want to choose 3) as 2a) seems to have advantages for
-dataflow analysis and 3) does not allow to convert the representation to
-2a).
-*/
-
-const char *get_cond_kind_name(cond_kind kind)
-{
-#define X(a)    case a: return #a;
-       switch (kind) {
-               X(dense);
-               X(fragmentary);
-       }
-       return "<unknown>";
-#undef X
-}
-
 ir_node *
 get_Cond_selector(const ir_node *node) {
        assert(is_Cond(node));
@@ -1030,18 +1027,6 @@ set_Cond_selector(ir_node *node, ir_node *selector) {
        set_irn_n(node, 0, selector);
 }
 
-cond_kind
-get_Cond_kind(const ir_node *node) {
-       assert(is_Cond(node));
-       return node->attr.cond.kind;
-}
-
-void
-set_Cond_kind(ir_node *node, cond_kind kind) {
-       assert(is_Cond(node));
-       node->attr.cond.kind = kind;
-}
-
 long
 get_Cond_default_proj(const ir_node *node) {
        assert(is_Cond(node));
@@ -1129,7 +1114,6 @@ int (is_Const_all_one)(const ir_node *node) {
 ir_type *
 get_Const_type(ir_node *node) {
        assert(is_Const(node));
-       node->attr.con.tp = skip_tid(node->attr.con.tp);
        return node->attr.con.tp;
 }
 
@@ -1163,7 +1147,7 @@ get_SymConst_type(const ir_node *node) {
        ir_node *irn = (ir_node *)node;
        assert(is_SymConst(node) &&
               (SYMCONST_HAS_TYPE(get_SymConst_kind(node))));
-       return irn->attr.symc.sym.type_p = skip_tid(irn->attr.symc.sym.type_p);
+       return irn->attr.symc.sym.type_p;
 }
 
 void
@@ -1219,20 +1203,9 @@ set_SymConst_symbol(ir_node *node, union symconst_symbol sym) {
        node->attr.symc.sym = sym;
 }
 
-ir_label_t get_SymConst_label(const ir_node *node) {
-       assert(is_SymConst(node) && SYMCONST_HAS_LABEL(get_SymConst_kind(node)));
-       return node->attr.symc.sym.label;
-}
-
-void set_SymConst_label(ir_node *node, ir_label_t label) {
-       assert(is_SymConst(node) && SYMCONST_HAS_LABEL(get_SymConst_kind(node)));
-       node->attr.symc.sym.label = label;
-}
-
 ir_type *
 get_SymConst_value_type(ir_node *node) {
        assert(is_SymConst(node));
-       if (node->attr.symc.tp) node->attr.symc.tp = skip_tid(node->attr.symc.tp);
        return node->attr.symc.tp;
 }
 
@@ -1296,7 +1269,7 @@ set_Sel_index(ir_node *node, int pos, ir_node *index) {
 ir_entity *
 get_Sel_entity(const ir_node *node) {
        assert(is_Sel(node));
-       return node->attr.sel.ent;
+       return node->attr.sel.entity;
 }
 
 /* need a version without const to prevent warning */
@@ -1307,7 +1280,7 @@ static ir_entity *_get_Sel_entity(ir_node *node) {
 void
 set_Sel_entity(ir_node *node, ir_entity *ent) {
        assert(is_Sel(node));
-       node->attr.sel.ent = ent;
+       node->attr.sel.entity = ent;
 }
 
 
@@ -1370,14 +1343,26 @@ set_Call_param(ir_node *node, int pos, ir_node *param) {
 ir_type *
 get_Call_type(ir_node *node) {
        assert(is_Call(node));
-       return node->attr.call.cld_tp = skip_tid(node->attr.call.cld_tp);
+       return node->attr.call.type;
 }
 
 void
 set_Call_type(ir_node *node, ir_type *tp) {
        assert(is_Call(node));
        assert((get_unknown_type() == tp) || is_Method_type(tp));
-       node->attr.call.cld_tp = tp;
+       node->attr.call.type = tp;
+}
+
+unsigned
+get_Call_tail_call(const ir_node *node) {
+       assert(is_Call(node));
+       return node->attr.call.tail_call;
+}
+
+void
+set_Call_tail_call(ir_node *node, unsigned tail_call) {
+       assert(is_Call(node));
+       node->attr.call.tail_call = tail_call != 0;
 }
 
 ir_node *
@@ -1431,14 +1416,14 @@ set_Builtin_param(ir_node *node, int pos, ir_node *param) {
 ir_type *
 get_Builtin_type(ir_node *node) {
        assert(is_Builtin(node));
-       return node->attr.builtin.builtin_tp = skip_tid(node->attr.builtin.builtin_tp);
+       return node->attr.builtin.type;
 }
 
 void
 set_Builtin_type(ir_node *node, ir_type *tp) {
        assert(is_Builtin(node));
        assert((get_unknown_type() == tp) || is_Method_type(tp));
-       node->attr.builtin.builtin_tp = tp;
+       node->attr.builtin.type = tp;
 }
 
 /* Returns a human readable string for the ir_builtin_kind. */
@@ -1448,7 +1433,7 @@ const char *get_builtin_kind_name(ir_builtin_kind kind) {
                X(ir_bk_trap);
                X(ir_bk_debugbreak);
                X(ir_bk_return_address);
-               X(ir_bk_frame_addess);
+               X(ir_bk_frame_address);
                X(ir_bk_prefetch);
                X(ir_bk_ffs);
                X(ir_bk_clz);
@@ -1578,16 +1563,17 @@ BINOP_MEM(OP)                                           \
                                                         \
 ir_mode *get_##OP##_resmode(const ir_node *node) {      \
   assert(is_##OP(node));                                \
-  return node->attr.divmod.res_mode;                    \
+  return node->attr.divmod.resmode;                     \
 }                                                       \
                                                         \
 void set_##OP##_resmode(ir_node *node, ir_mode *mode) { \
   assert(is_##OP(node));                                \
-  node->attr.divmod.res_mode = mode;                    \
+  node->attr.divmod.resmode = mode;                     \
 }
 
 
 BINOP(Add)
+BINOP(Borrow)
 BINOP(Carry)
 BINOP(Sub)
 UNOP(Minus)
@@ -1610,11 +1596,16 @@ BINOP(Cmp)
 UNOP(Conv)
 UNOP(Cast)
 
-int is_Div_remainderless(const ir_node *node) {
+int get_Div_no_remainder(const ir_node *node) {
        assert(is_Div(node));
        return node->attr.divmod.no_remainder;
 }
 
+void set_Div_no_remainder(ir_node *node, int no_remainder) {
+       assert(is_Div(node));
+       node->attr.divmod.no_remainder = no_remainder;
+}
+
 int get_Conv_strict(const ir_node *node) {
        assert(is_Conv(node));
        return node->attr.conv.strict;
@@ -1628,14 +1619,13 @@ void set_Conv_strict(ir_node *node, int strict_flag) {
 ir_type *
 get_Cast_type(ir_node *node) {
        assert(is_Cast(node));
-       node->attr.cast.totype = skip_tid(node->attr.cast.totype);
-       return node->attr.cast.totype;
+       return node->attr.cast.type;
 }
 
 void
 set_Cast_type(ir_node *node, ir_type *to_tp) {
        assert(is_Cast(node));
-       node->attr.cast.totype = to_tp;
+       node->attr.cast.type = to_tp;
 }
 
 
@@ -1734,11 +1724,6 @@ set_binop_right(ir_node *node, ir_node *right) {
        set_irn_n(node, node->op->op_index + 1, right);
 }
 
-int
-(is_Phi)(const ir_node *n) {
-       return _is_Phi(n);
-}
-
 int is_Phi0(const ir_node *n) {
        assert(n);
 
@@ -1837,13 +1822,13 @@ set_Load_ptr(ir_node *node, ir_node *ptr) {
 ir_mode *
 get_Load_mode(const ir_node *node) {
        assert(is_Load(node));
-       return node->attr.load.load_mode;
+       return node->attr.load.mode;
 }
 
 void
 set_Load_mode(ir_node *node, ir_mode *mode) {
        assert(is_Load(node));
-       node->attr.load.load_mode = mode;
+       node->attr.load.mode = mode;
 }
 
 ir_volatility
@@ -1959,7 +1944,7 @@ set_Alloc_size(ir_node *node, ir_node *size) {
 ir_type *
 get_Alloc_type(ir_node *node) {
        assert(is_Alloc(node));
-       return node->attr.alloc.type = skip_tid(node->attr.alloc.type);
+       return node->attr.alloc.type;
 }
 
 void
@@ -2020,7 +2005,7 @@ set_Free_size(ir_node *node, ir_node *size) {
 ir_type *
 get_Free_type(ir_node *node) {
        assert(is_Free(node));
-       return node->attr.free.type = skip_tid(node->attr.free.type);
+       return node->attr.free.type;
 }
 
 void
@@ -2353,19 +2338,19 @@ void set_CopyB_src(ir_node *node, ir_node *src) {
 
 ir_type *get_CopyB_type(ir_node *node) {
        assert(is_CopyB(node));
-       return node->attr.copyb.data_type = skip_tid(node->attr.copyb.data_type);
+       return node->attr.copyb.type;
 }
 
 void set_CopyB_type(ir_node *node, ir_type *data_type) {
        assert(is_CopyB(node) && data_type);
-       node->attr.copyb.data_type = data_type;
+       node->attr.copyb.type = data_type;
 }
 
 
 ir_type *
 get_InstOf_type(ir_node *node) {
        assert(node->op == op_InstOf);
-       return node->attr.instof.type = skip_tid(node->attr.instof.type);
+       return node->attr.instof.type;
 }
 
 void
@@ -2533,10 +2518,8 @@ get_irn_irg(const ir_node *node) {
         */
        if (! is_Block(node))
                node = get_irn_n(node, -1);
-       if (is_Bad(node))  /* sometimes bad is predecessor of nodes instead of block: in case of optimization */
-               node = get_irn_n(node, -1);
-       assert(is_Block(node));
-       return node->attr.block.irg;
+       /* note that get_Block_irg() can handle Bad nodes */
+       return get_Block_irg(node);
 }
 
 
@@ -2685,310 +2668,22 @@ void skip_Id_and_store(ir_node **node) {
        *node = skip_Id(n);
 }
 
-int
-(is_Bad)(const ir_node *node) {
-       return _is_Bad(node);
-}
-
-int
-(is_NoMem)(const ir_node *node) {
-       return _is_NoMem(node);
-}
-
-int
-(is_Minus)(const ir_node *node) {
-       return _is_Minus(node);
-}
-
-int
-(is_Abs)(const ir_node *node) {
-       return _is_Abs(node);
-}
-
-int
-(is_Mod)(const ir_node *node) {
-       return _is_Mod(node);
-}
-
-int
-(is_Div)(const ir_node *node) {
-       return _is_Div(node);
-}
-
-int
-(is_DivMod)(const ir_node *node) {
-       return _is_DivMod(node);
-}
-
-int
-(is_Quot)(const ir_node *node) {
-       return _is_Quot(node);
-}
-
-int
-(is_Add)(const ir_node *node) {
-       return _is_Add(node);
-}
-
-int
-(is_Carry)(const ir_node *node) {
-       return _is_Carry(node);
-}
-
-int
-(is_And)(const ir_node *node) {
-       return _is_And(node);
-}
-
-int
-(is_Or)(const ir_node *node) {
-       return _is_Or(node);
-}
-
-int
-(is_Eor)(const ir_node *node) {
-       return _is_Eor(node);
-}
-
-int
-(is_Sub)(const ir_node *node) {
-       return _is_Sub(node);
-}
-
-int
-(is_Shl)(const ir_node *node) {
-       return _is_Shl(node);
-}
-
-int
-(is_Shr)(const ir_node *node) {
-       return _is_Shr(node);
-}
-
-int
-(is_Shrs)(const ir_node *node) {
-       return _is_Shrs(node);
-}
-
-int
-(is_Rotl)(const ir_node *node) {
-       return _is_Rotl(node);
-}
-
-int
-(is_Not)(const ir_node *node) {
-       return _is_Not(node);
-}
-
-int
-(is_Id)(const ir_node *node) {
-       return _is_Id(node);
-}
-
-int
-(is_Tuple)(const ir_node *node) {
-       return _is_Tuple(node);
-}
-
-int
-(is_Bound)(const ir_node *node) {
-       return _is_Bound(node);
-}
-
-int
-(is_Start)(const ir_node *node) {
-  return _is_Start(node);
-}
-
-int
-(is_End)(const ir_node *node) {
-       return _is_End(node);
-}
-
-int
-(is_Const)(const ir_node *node) {
-       return _is_Const(node);
-}
-
-int
-(is_Conv)(const ir_node *node) {
-       return _is_Conv(node);
-}
-
 int
 (is_strictConv)(const ir_node *node) {
        return _is_strictConv(node);
 }
 
-int
-(is_Cast)(const ir_node *node) {
-       return _is_Cast(node);
-}
-
 int
 (is_no_Block)(const ir_node *node) {
        return _is_no_Block(node);
 }
 
-int
-(is_Block)(const ir_node *node) {
-       return _is_Block(node);
-}
-
-/* returns true if node is an Unknown node. */
-int
-(is_Unknown)(const ir_node *node) {
-       return _is_Unknown(node);
-}
-
-/* returns true if node is a Return node. */
-int
-(is_Return)(const ir_node *node) {
-       return _is_Return(node);
-}
-
-/* returns true if node is a Call node. */
-int
-(is_Call)(const ir_node *node) {
-       return _is_Call(node);
-}
-
-/* returns true if node is a Builtin node. */
-int
-(is_Builtin)(const ir_node *node) {
-       return _is_Builtin(node);
-}
-
-/* returns true if node is a CallBegin node. */
-int
-(is_CallBegin)(const ir_node *node) {
-       return _is_CallBegin(node);
-}
-
-/* returns true if node is a Sel node. */
-int
-(is_Sel)(const ir_node *node) {
-       return _is_Sel(node);
-}
-
-/* returns true if node is a Mux node. */
-int
-(is_Mux)(const ir_node *node) {
-       return _is_Mux(node);
-}
-
-/* returns true if node is a Load node. */
-int
-(is_Load)(const ir_node *node) {
-       return _is_Load(node);
-}
-
-/* returns true if node is a Load node. */
-int
-(is_Store)(const ir_node *node) {
-       return _is_Store(node);
-}
-
-/* returns true if node is a Sync node. */
-int
-(is_Sync)(const ir_node *node) {
-       return _is_Sync(node);
-}
-
-/* Returns true if node is a Confirm node. */
-int
-(is_Confirm)(const ir_node *node) {
-       return _is_Confirm(node);
-}
-
-/* Returns true if node is a Pin node. */
-int
-(is_Pin)(const ir_node *node) {
-       return _is_Pin(node);
-}
-
-/* Returns true if node is a SymConst node. */
-int
-(is_SymConst)(const ir_node *node) {
-       return _is_SymConst(node);
-}
-
 /* Returns true if node is a SymConst node with kind symconst_addr_ent. */
 int
 (is_SymConst_addr_ent)(const ir_node *node) {
        return _is_SymConst_addr_ent(node);
 }
 
-/* Returns true if node is a Cond node. */
-int
-(is_Cond)(const ir_node *node) {
-       return _is_Cond(node);
-}
-
-int
-(is_CopyB)(const ir_node *node) {
-       return _is_CopyB(node);
-}
-
-/* returns true if node is a Cmp node. */
-int
-(is_Cmp)(const ir_node *node) {
-       return _is_Cmp(node);
-}
-
-/* returns true if node is an Alloc node. */
-int
-(is_Alloc)(const ir_node *node) {
-       return _is_Alloc(node);
-}
-
-/* returns true if node is a Free node. */
-int
-(is_Free)(const ir_node *node) {
-       return _is_Free(node);
-}
-
-/* returns true if a node is a Jmp node. */
-int
-(is_Jmp)(const ir_node *node) {
-       return _is_Jmp(node);
-}
-
-/* returns true if a node is a IJmp node. */
-int
-(is_IJmp)(const ir_node *node) {
-       return _is_IJmp(node);
-}
-
-/* returns true if a node is a Raise node. */
-int
-(is_Raise)(const ir_node *node) {
-       return _is_Raise(node);
-}
-
-/* returns true if a node is an ASM node. */
-int
-(is_ASM)(const ir_node *node) {
-       return _is_ASM(node);
-}
-
-/* returns true if a node is an Dummy node. */
-int
-(is_Dummy)(const ir_node *node) {
-       return _is_Dummy(node);
-}
-
-int
-(is_Proj)(const ir_node *node) {
-       return _is_Proj(node);
-}
-
-/* Returns true if node is a Filter node. */
-int
-(is_Filter)(const ir_node *node) {
-       return _is_Filter(node);
-}
-
 /* Returns true if the operation manipulates control flow. */
 int is_cfop(const ir_node *node) {
        return is_op_cfopcode(get_irn_op(node));
@@ -3022,7 +2717,7 @@ ir_node *get_fragile_op_mem(ir_node *node) {
        case iro_Alloc :
        case iro_Bound :
        case iro_CopyB :
-               return get_irn_n(node, pn_Generic_M_regular);
+               return get_irn_n(node, pn_Generic_M);
        case iro_Bad   :
        case iro_Unknown:
                return node;
@@ -3050,6 +2745,10 @@ int (is_irn_forking)(const ir_node *node) {
        return _is_irn_forking(node);
 }
 
+void (copy_node_attr)(const ir_node *old_node, ir_node *new_node) {
+       _copy_node_attr(old_node, new_node);
+}
+
 /* Return the type associated with the value produced by n
  * if the node remarks this type as it is the case for
  * Cast, Const, SymConst and some Proj nodes. */
@@ -3103,6 +2802,10 @@ int (is_irn_machine_user)(const ir_node *node, unsigned n) {
        return _is_irn_machine_user(node, n);
 }
 
+/* Returns non-zero for nodes that are CSE neutral to its users. */
+int (is_irn_cse_neutral)(const ir_node *node) {
+       return _is_irn_cse_neutral(node);
+}
 
 /* Gets the string representation of the jump prediction .*/
 const char *get_cond_jmp_predicate_name(cond_jmp_predicate pred) {
@@ -3221,30 +2924,6 @@ dbg_info *(get_irn_dbg_info)(const ir_node *n) {
        return _get_irn_dbg_info(n);
 }
 
-#if 0 /* allow the global pointer */
-
-/* checks whether a node represents a global address */
-int is_Global(const ir_node *node) {
-       ir_node *ptr;
-
-       if (is_SymConst_addr_ent(node))
-               return 1;
-       if (! is_Sel(node))
-               return 0;
-
-       ptr = get_Sel_ptr(node);
-       return is_globals_pointer(ptr) != NULL;
-}
-
-/* returns the entity of a global address */
-ir_entity *get_Global_entity(const ir_node *node) {
-       if (is_SymConst(node))
-               return get_SymConst_entity(node);
-       else
-               return get_Sel_entity(node);
-}
-#else
-
 /* checks whether a node represents a global address */
 int is_Global(const ir_node *node) {
        return is_SymConst_addr_ent(node);
@@ -3254,7 +2933,6 @@ int is_Global(const ir_node *node) {
 ir_entity *get_Global_entity(const ir_node *node) {
        return get_SymConst_entity(node);
 }
-#endif
 
 /*
  * Calculate a hash value of a node.
@@ -3268,7 +2946,11 @@ unsigned firm_default_hash(const ir_node *node) {
 
        /* consider all in nodes... except the block if not a control flow. */
        for (i = is_cfop(node) ? -1 : 0;  i < irn_arity;  ++i) {
-               h = 9*h + HASH_PTR(get_irn_intra_n(node, i));
+               ir_node *pred = get_irn_intra_n(node, i);
+               if (is_irn_cse_neutral(pred))
+                       h *= 9;
+               else
+                       h = 9*h + HASH_PTR(pred);
        }
 
        /* ...mode,... */
@@ -3278,3 +2960,6 @@ unsigned firm_default_hash(const ir_node *node) {
 
        return h;
 }  /* firm_default_hash */
+
+/* include generated code */
+#include "gen_irnode.c.inl"