ia32: Simplify ia32_register_saved_by().
[libfirm] / ir / be / beirgmod.h
index 6d5240c..5447a38 100644 (file)
@@ -1,22 +1,63 @@
+/*
+ * 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.
+ */
 
 /**
- * IRG modifications for be routines.
- * @date 4.5.2005
+ * @file
+ * @brief       Backend IRG modification routines.
+ * @author      Sebastian Hack, Daniel Grund, Matthias Braun, Christian Wuerdig
+ * @date        04.05.2005
  *
- * Copyright (C) 2005 Universitaet Karlsruhe.
- * Released under the GPL.
+ * This file contains the following IRG modifications for be routines:
+ * - insertion of Perm nodes
+ * - empty block elimination
+ * - a simple dead node elimination (set inputs of unreachable nodes to BAD)
  */
+#ifndef FIRM_BE_BEIRGMOD_H
+#define FIRM_BE_BEIRGMOD_H
 
-#ifndef _BEIRGMOD_H
-#define _BEIRGMOD_H
+#include "be_types.h"
+#include "firm_types.h"
 
-typedef struct _dom_front_info_t dom_front_info_t;
+/**
+ * Insert a Perm which permutes all (non-ignore) live values of a given register class
+ * before a certain instruction.
+ * @param lv        Liveness Information.
+ * @param irn       The node to insert the Perm before.
+ * @return          The Perm or NULL if nothing was live before @p irn.
+ */
+ir_node *insert_Perm_before(ir_graph *irg, const arch_register_class_t *cls,
+                                                  ir_node *irn);
 
-dom_front_info_t *be_compute_dominance_frontiers(ir_graph *irg);
-pset *be_get_dominance_frontier(dom_front_info_t *info, ir_node *block);
-void be_free_dominance_frontiers(dom_front_info_t *info);
+/**
+ * Removes basic blocks that only contain a jump instruction
+ * (this will potentially create critical edges).
+ *
+ * @param irg  the graph that will be changed
+ *
+ * @return non-zero if the graph was changed, zero else
+ */
+int be_remove_empty_blocks(ir_graph *irg);
 
-void be_introduce_copies(dom_front_info_t *info, ir_node *orig,
-    int n, ir_node *copy_nodes[]);
+/**
+ * Removes dead nodes from schedule
+ * @param irg  the graph
+ */
+void be_remove_dead_nodes_from_schedule(ir_graph *irg);
 
 #endif