bepeephole: Inline be_peephole_new_node() into its only caller.
[libfirm] / ir / be / bepeephole.c
index 9e57bdb..6ff06f5 100644 (file)
@@ -1,20 +1,6 @@
 /*
- * Copyright (C) 1995-2011 University of Karlsruhe.  All right reserved.
- *
  * This file is part of libFirm.
- *
- * This file may be distributed and/or modified under the terms of the
- * GNU General Public License version 2 as published by the Free Software
- * Foundation and appearing in the file LICENSE.GPL included in the
- * packaging of this file.
- *
- * Licensees holding valid libFirm Professional Edition licenses may use
- * this file in accordance with the libFirm Commercial License.
- * Agreement provided with the Software.
- *
- * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
- * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE.
+ * Copyright (C) 2012 University of Karlsruhe.
  */
 
 /**
@@ -93,14 +79,9 @@ static void set_reg_value(ir_node *node)
 static void clear_defs(ir_node *node)
 {
        /* clear values defined */
-       if (get_irn_mode(node) == mode_T) {
-               foreach_out_edge(node, edge) {
-                       ir_node *proj = get_edge_src_irn(edge);
-                       clear_reg_value(proj);
-               }
-       } else {
-               clear_reg_value(node);
-       }
+       be_foreach_value(node, value,
+               clear_reg_value(value);
+       );
 }
 
 static void set_uses(ir_node *node)
@@ -115,11 +96,6 @@ static void set_uses(ir_node *node)
        }
 }
 
-void be_peephole_new_node(ir_node * nw)
-{
-       be_liveness_introduce(lv, nw);
-}
-
 /**
  * must be called from peephole optimisations before a node will be killed
  * and its users will be redirected to new_node.
@@ -176,7 +152,7 @@ void be_peephole_exchange(ir_node *old, ir_node *nw)
        be_peephole_before_exchange(old, nw);
        sched_remove(old);
        exchange(old, nw);
-       be_peephole_new_node(nw);
+       be_liveness_introduce(lv, nw);
 }
 
 /**
@@ -417,11 +393,6 @@ ir_node *be_peephole_IncSP_IncSP(ir_node *node)
 
 void be_peephole_opt(ir_graph *irg)
 {
-#if 0
-       /* we sometimes find BadE nodes in float apps like optest_float.c or
-        * kahansum.c for example... */
-       be_invalidate_live_sets(irg);
-#endif
        be_assure_live_sets(irg);
 
        arch_env = be_get_irg_arch_env(irg);