spill preparation needs liveness
[libfirm] / include / libfirm / irgopt.h
index aeaf02c..986f1a2 100644 (file)
@@ -39,20 +39,31 @@ void local_optimize_node(ir_node *n);
  * @param irg  The graph to be optimized.
  *
  * After applying local_optimize_graph() to a IR-graph, Bad nodes
- * only occure as predecessor of Block and Phi nodes.
+ * only occur as predecessor of Block and Phi nodes.
  */
 void local_optimize_graph(ir_graph *irg);
 
 /** Applies local optimizations (see iropt.h) to all nodes in the graph.
+ *
+ * After applying optimize_graph_df() to a IR-graph, Bad nodes
+ * only occur as predecessor of Block and Phi nodes.
+ *
+ * This version uses fixpoint iteration.
  *
  * @param irg  The graph to be optimized.
  *
- * After applying local_optimize_graph() to a IR-graph, Bad nodes
- * only occure as predecessor of Block and Phi nodes.
+ * @return non-zero if the optimization could be applied, 0 else
+ */
+int optimize_graph_df(ir_graph *irg);
+
+/**
+ * Creates an ir_graph pass for optimize_graph_df().
+ *
+ * @param name     the name of this pass or NULL
  *
- * This version used a fixpoint iteration.
+ * @return  the newly created ir_graph pass
  */
-void optimize_graph_df(ir_graph *irg);
+ir_graph_pass_t *optimize_graph_df_pass(const char *name);
 
 /** Performs dead node elimination by copying the ir graph to a new obstack.
  *
@@ -74,6 +85,15 @@ void optimize_graph_df(ir_graph *irg);
  */
 void dead_node_elimination(ir_graph *irg);
 
+/**
+ * Creates an ir_graph pass for dead_node_elimination().
+ *
+ * @param name     the name of this pass or NULL
+ *
+ * @return  the newly created ir_graph pass
+ */
+ir_graph_pass_t *dead_node_elimination_pass(const char *name);
+
 typedef struct _survive_dce_t survive_dce_t;
 
 /**
@@ -162,6 +182,17 @@ int inline_method(ir_node *call, ir_graph *called_graph);
  */
 void place_code(ir_graph *irg);
 
+/**
+ * Creates an ir_graph pass for place_code().
+ * This pass enables GCSE, runs optimize_graph_df() and finally
+ * place_code();
+ *
+ * @param name     the name of this pass or NULL
+ *
+ * @return  the newly created ir_graph pass
+ */
+ir_graph_pass_t *place_code_pass(const char *name);
+
 /** Places an empty basic block on critical control flow edges thereby
  * removing them.
  *