From: Matthias Braun Date: Thu, 10 Nov 2011 12:45:21 +0000 (+0100) Subject: remove unused op_machine, op_machine_op stuff X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=c2e55800e76ff59722d4774e212908cda1dae592;p=libfirm remove unused op_machine, op_machine_op stuff --- diff --git a/include/libfirm/irnode.h b/include/libfirm/irnode.h index 0f24af495..a70794e01 100644 --- a/include/libfirm/irnode.h +++ b/include/libfirm/irnode.h @@ -633,21 +633,6 @@ FIRM_API int is_irn_keep(const ir_node *node); */ FIRM_API int is_irn_start_block_placed(const ir_node *node); -/** - * Returns non-zero for nodes that are machine operations. - */ -FIRM_API int is_irn_machine_op(const ir_node *node); - -/** - * Returns non-zero for nodes that are machine operands. - */ -FIRM_API int is_irn_machine_operand(const ir_node *node); - -/** - * Returns non-zero for nodes that have the n'th user machine flag set. - */ -FIRM_API int is_irn_machine_user(const ir_node *node, unsigned n); - /** * Returns non-zero for nodes that are CSE neutral to its users. */ diff --git a/include/libfirm/irop.h b/include/libfirm/irop.h index d6b372579..3f7480fe3 100644 --- a/include/libfirm/irop.h +++ b/include/libfirm/irop.h @@ -73,14 +73,11 @@ typedef enum { irop_flag_uses_memory = 1U << 10, /**< This operation has a memory input and may change the memory state. */ irop_flag_dump_noblock = 1U << 11, /**< node should be dumped outside any blocks */ irop_flag_dump_noinput = 1U << 12, /**< node is a placeholder for "no input" */ - irop_flag_machine = 1U << 13, /**< This operation is a machine operation. */ - irop_flag_machine_op = 1U << 14, /**< This operation is a machine operand. */ - irop_flag_cse_neutral = 1U << 15, /**< This operation is CSE neutral to its users. */ + irop_flag_cse_neutral = 1U << 13, /**< This operation is CSE neutral to its users. */ /** This operation jumps to an unknown destination. The CFG is a * conservative aproximation in this case. You cannot change the destination * of an unknown_jump */ - irop_flag_unknown_jump = 1U << 16, - irop_flag_user = 1U << 17, /**< This flag and all higher ones are free for machine user. */ + irop_flag_unknown_jump = 1U << 14, } irop_flags; /** Returns the ident for the opcode name */ diff --git a/ir/be/beinsn.c b/ir/be/beinsn.c index d0183eab1..2f7a29009 100644 --- a/ir/be/beinsn.c +++ b/ir/be/beinsn.c @@ -35,40 +35,6 @@ #include "beabi.h" #include "raw_bitset.h" -/** - * Add machine operands to the instruction uses. - * - * @param env the insn construction environment - * @param insn the be_insn that is build - * @param mach_op the machine operand for which uses are added - */ -static void add_machine_operands(const be_insn_env_t *env, be_insn_t *insn, ir_node *mach_op) -{ - struct obstack *obst = env->obst; - int i, n; - - for (i = 0, n = get_irn_arity(mach_op); i < n; ++i) { - ir_node *op = get_irn_n(mach_op, i); - - if (is_irn_machine_operand(op)) { - add_machine_operands(env, insn, op); - } else if (arch_irn_consider_in_reg_alloc(env->cls, op)) { - be_operand_t o; - - /* found a register use, create an operand */ - o.req = arch_get_irn_register_req_in(mach_op, i); - o.carrier = op; - o.irn = insn->irn; - o.pos = i; - o.partner = NULL; - o.has_constraints = arch_register_req_is(o.req, limited); - obstack_grow(obst, &o, sizeof(o)); - insn->n_ops++; - insn->in_constraints |= o.has_constraints; - } - } -} - /** * Create a be_insn_t for an IR node. * @@ -140,9 +106,7 @@ be_insn_t *be_scan_insn(const be_insn_env_t *env, ir_node *irn) for (i = 0, n = get_irn_arity(irn); i < n; ++i) { ir_node *op = get_irn_n(irn, i); - if (is_irn_machine_operand(op)) { - add_machine_operands(env, insn, op); - } else if (arch_irn_consider_in_reg_alloc(env->cls, op)) { + if (arch_irn_consider_in_reg_alloc(env->cls, op)) { /* found a register use, create an operand */ o.req = arch_get_irn_register_req_in(irn, i); o.carrier = op; diff --git a/ir/be/scripts/generate_new_opcodes.pl b/ir/be/scripts/generate_new_opcodes.pl index 20ba8997b..205a01d45 100755 --- a/ir/be/scripts/generate_new_opcodes.pl +++ b/ir/be/scripts/generate_new_opcodes.pl @@ -676,7 +676,7 @@ EOF "none", "labeled", "commutative", "cfopcode", "unknown_jump", "fragile", "forking", "highlevel", "constlike", "always_opt", "keep", "start_block", "uses_memory", "dump_noblock", "dump_noinput", - "machine", "machine_op", "cse_neutral" + "cse_neutral" ); my $is_fragile = 0; foreach my $flag (@{$n{"op_flags"}}) { @@ -697,7 +697,7 @@ EOF $n_opcodes++; $temp = "\top_$op = new_ir_op(cur_opcode + iro_$op, \"$op\", op_pin_state_".$n{"state"}.", $op_flags"; - $temp .= "|irop_flag_machine, ".translate_arity($arity).", 0, ${attr_size}, &ops);\n"; + $temp .= ", ".translate_arity($arity).", 0, ${attr_size}, &ops);\n"; push(@obst_new_irop, $temp); if ($is_fragile) { push(@obst_new_irop, "\tir_op_set_fragile_indices(op_${op}, n_${op}_mem, pn_${op}_X_regular, pn_${op}_X_except);\n"); diff --git a/ir/ir/irnode.c b/ir/ir/irnode.c index 43e1433c5..aaf00365c 100644 --- a/ir/ir/irnode.c +++ b/ir/ir/irnode.c @@ -1590,24 +1590,6 @@ int (is_irn_start_block_placed)(const ir_node *node) return is_irn_start_block_placed_(node); } -/* Returns non-zero for nodes that are machine operations. */ -int (is_irn_machine_op)(const ir_node *node) -{ - return is_irn_machine_op_(node); -} - -/* Returns non-zero for nodes that are machine operands. */ -int (is_irn_machine_operand)(const ir_node *node) -{ - return is_irn_machine_operand_(node); -} - -/* Returns non-zero for nodes that have the n'th user machine flag set. */ -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) { diff --git a/ir/ir/irnode_t.h b/ir/ir/irnode_t.h index 80474c915..fed446885 100644 --- a/ir/ir/irnode_t.h +++ b/ir/ir/irnode_t.h @@ -481,21 +481,6 @@ static inline int is_irn_start_block_placed_(const ir_node *node) return is_op_start_block_placed(get_irn_op_(node)); } -static inline int is_irn_machine_op_(const ir_node *node) -{ - return is_op_machine(get_irn_op_(node)); -} - -static inline int is_irn_machine_operand_(const ir_node *node) -{ - return is_op_machine_operand(get_irn_op_(node)); -} - -static inline int is_irn_machine_user_(const ir_node *node, unsigned n) -{ - return is_op_machine_user(get_irn_op_(node), n); -} - static inline int is_irn_cse_neutral_(const ir_node *node) { return is_op_cse_neutral(get_irn_op_(node)); @@ -672,9 +657,6 @@ void init_irnode(void); #define is_irn_always_opt(node) is_irn_always_opt_(node) #define is_irn_keep(node) is_irn_keep_(node) #define is_irn_start_block_placed(node) is_irn_start_block_placed_(node) -#define is_irn_machine_op(node) is_irn_machine_op_(node) -#define is_irn_machine_operand(node) is_irn_machine_operand_(node) -#define is_irn_machine_user(node, n) is_irn_machine_user_(node, n) #define is_irn_cse_neutral(node) is_irn_cse_neutral_(node) #define get_Cond_jmp_pred(node) get_Cond_jmp_pred_(node) #define set_Cond_jmp_pred(node, pred) set_Cond_jmp_pred_(node, pred) diff --git a/ir/ir/irop_t.h b/ir/ir/irop_t.h index f92e20835..a2fc0eca0 100644 --- a/ir/ir/irop_t.h +++ b/ir/ir/irop_t.h @@ -129,30 +129,12 @@ static inline bool is_op_start_block_placed(const ir_op *op) return op->flags & irop_flag_start_block; } -/** Returns non-zero if operation is a machine operation */ -static inline bool is_op_machine(const ir_op *op) -{ - return op->flags & irop_flag_machine; -} - -/** Returns non-zero if operation is a machine operand */ -static inline bool is_op_machine_operand(const ir_op *op) -{ - return op->flags & irop_flag_machine_op; -} - /** Returns non-zero if operation is CSE neutral */ static inline bool is_op_cse_neutral(const ir_op *op) { return op->flags & irop_flag_cse_neutral; } -/** Returns non-zero if operation is a machine user op number n */ -static inline bool is_op_machine_user(const ir_op *op, unsigned n) -{ - return op->flags & (irop_flag_user << n); -} - static inline unsigned get_op_code_(const ir_op *op) { return op->code;