X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbepeephole.h;h=cca76d98d0432f27135dee3fbf09d06a7405d4ed;hb=9a6232862313e1e255e8039f2d2144cde9f671ad;hp=764c9f34763a86ea82d5b63091008584ba2b8453;hpb=7f40bd1250b868879e10d8789f9867d09e20e647;p=libfirm diff --git a/ir/be/bepeephole.h b/ir/be/bepeephole.h index 764c9f347..cca76d98d 100644 --- a/ir/be/bepeephole.h +++ b/ir/be/bepeephole.h @@ -32,13 +32,13 @@ extern ir_node ***register_values; -static INLINE ir_node *be_peephole_get_value(unsigned regclass_idx, +static inline ir_node *be_peephole_get_value(unsigned regclass_idx, unsigned register_idx) { return register_values[regclass_idx][register_idx]; } -static INLINE ir_node *be_peephole_get_reg_value(const arch_register_t *reg) +static inline ir_node *be_peephole_get_reg_value(const arch_register_t *reg) { unsigned regclass_idx = arch_register_class_index(arch_register_get_class(reg)); unsigned register_idx = arch_register_get_index(reg); @@ -52,16 +52,15 @@ static INLINE ir_node *be_peephole_get_reg_value(const arch_register_t *reg) typedef void (*peephole_opt_func) (ir_node *node); /** - * must be called from peephole optimisations before a node is exchanged, - * so bepeephole can update it's internal state. - */ -void be_peephole_before_exchange(const ir_node *old_node, ir_node *new_node); + * Notify the peephole phase about a newly added node, so it can update its + * internal state. This is not needed for the new node, when + * be_peephole_exchange() is used. */ +void be_peephole_new_node(ir_node *nw); /** - * must be called from peephole optimisations after a node is exchanged, - * so bepeephole can update it's internal state. - */ -void be_peephole_after_exchange(ir_node *new_node); + * When doing peephole optimisation use this function instead of plain + * exchange(), so it can update its internal state. */ +void be_peephole_exchange(ir_node *old, ir_node *nw); /** * Tries to optimize a beIncSp node with it's previous IncSP node.