* @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.
*
- * @param irg The graph to be optimized.
+ * After applying optimize_graph_df() to a IR-graph, Bad nodes
+ * only occur as predecessor of Block and Phi nodes.
*
- * After applying local_optimize_graph() to a IR-graph, Bad nodes
- * only occure as predecessor of Block and Phi nodes.
+ * This version uses fixpoint iteration.
+ *
+ * @param irg The graph to be optimized.
*
- * This version used a fixpoint iteration.
+ * @return non-zero if the optimization could be applied, 0 else
*/
-void optimize_graph_df(ir_graph *irg);
+int optimize_graph_df(ir_graph *irg);
/** Performs dead node elimination by copying the ir graph to a new obstack.
*
*/
int inline_method(ir_node *call, ir_graph *called_graph);
-/** Inlines all small methods at call sites where the called address comes
- * from a SymConst node that references the entity representing the called
- * method.
- *
- * The size argument is a rough measure for the code size of the method:
- * Methods where the obstack containing the firm graph is smaller than
- * size are inlined. Further only a limited number of calls are inlined.
- * If the method contains more than 1024 inlineable calls none will be
- * inlined.
- * Inlining is only performed if flags `optimize' and `inlineing' are set.
- * The graph may not be in state phase_building.
- * It is recommended to call local_optimize_graph() after inlining as this
- * function leaves a set of obscure Tuple nodes, e.g. a Proj-Tuple-Jmp
- * combination as control flow operation.
- */
-void inline_small_irgs(ir_graph *irg, int size);
-
-
-/** Inlineing with a different heuristic than inline_small_irgs().
- *
- * Inlines leave functions. If inlinening creates new leave
- * function inlines these, too. (If g calls f, and f calls leave h,
- * h is first inlined in f and then f in g.)
- *
- * Then inlines all small functions (this is not recursive).
- *
- * For a heuristic this inlineing uses firm node counts. It does
- * not count auxiliary nodes as Proj, Tuple, End, Start, Id, Sync.
- * If the ignore_runtime flag is set, calls to functions marked with the
- * mtp_property_runtime property are ignored.
- *
- * @param maxsize Do not inline any calls if a method has more than
- * maxsize firm nodes. It may reach this limit by
- * inlineing.
- * @param leavesize Inline leave functions if they have less than leavesize
- * nodes.
- * @param size Inline all function smaller than size.
- * @param ignore_runtime count a function only calling runtime functions as
- * leave
- */
-void inline_leave_functions(int maxsize, int leavesize, int size, int ignore_runtime);
-
-/**
- * Heuristic inliner. Calculates a benefice value for every call and inlines
- * those calls with a value higher than the threshold.
- *
- * @param maxsize Do not inline any calls if a method has more than
- * maxsize firm nodes. It may reach this limit by
- * inlineing.
- * @param threshold inlining threshold
- */
-void inline_functions(int maxsize, int inline_threshold);
-
/** Code Placement.
*
* Pins all floating nodes to a block where they
*
* A critical control flow edge is an edge from a block with several
* control exits to a block with several control entries (See Muchnic
- * p. 407).
+ * p. 407). Exception edges are always ignored.
*
- * @param irg IR Graph
+ * @param irg IR Graph
*/
void remove_critical_cf_edges(ir_graph *irg);
+/** Places an empty basic block on critical control flow edges thereby
+ * removing them.
+ *
+ * A critical control flow edge is an edge from a block with several
+ * control exits to a block with several control entries (See Muchnic
+ * p. 407).
+ *
+ * @param irg IR Graph
+ * @param ignore_exception_edges if non-zero, exception edges will be ignored
+ */
+void remove_critical_cf_edges_ex(ir_graph *irg, int ignore_exception_edges);
+
#endif