bepeephole: Inline be_peephole_new_node() into its only caller.
[libfirm] / ir / be / bepeephole.h
index c31d66c..26a53c3 100644 (file)
@@ -1,32 +1,16 @@
 /*
- * Copyright (C) 1995-2008 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.
  */
 
 /**
  * @file
  * @brief       peephole optimisation framework
  * @author      Matthias Braun
- * @version     $Id$
  */
 #ifndef BEPEEPHOLE_H
 #define BEPEEPHOLE_H
 
-#include "beirg.h"
 #include "bearch.h"
 
 extern ir_node **register_values;
@@ -47,18 +31,11 @@ static inline ir_node *be_peephole_get_reg_value(const arch_register_t *reg)
  */
 typedef void (*peephole_opt_func) (ir_node *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.
- * Note: Contrary to normal exchange you mustn't remove the node from the
- * schedule either before exchange. Exchange will do that for you.
- */
-void be_peephole_new_node(ir_node *nw);
-
 /**
  * When doing peephole optimisation use this function instead of plain
- * exchange(), so it can update its internal state. */
+ * exchange(), so it can update its internal state.  This function also removes
+ * the old node from the schedule.
+ */
 void be_peephole_exchange(ir_node *old, ir_node *nw);
 
 /**
@@ -75,14 +52,17 @@ bool be_has_only_one_user(ir_node *node);
 
 /**
  * In a scheduled program with registers assigned,
- * checks wether @p node can be moved before @p before without changing program
+ * checks whether @p node can be moved before @p before without changing program
  * semantics.
  *
  * Note: It is allowed to use this function without being in a peephole
  * optimization phase.
  */
-bool be_can_move_before(ir_heights_t *heights, const ir_node *node,
-                        const ir_node *before);
+bool be_can_move_down(ir_heights_t *heights, const ir_node *node,
+                      const ir_node *before);
+
+bool be_can_move_up(ir_heights_t *heights, const ir_node *node,
+                    const ir_node *after);
 
 /**
  * Do peephole optimisations. It traverses the schedule of all blocks in