Add this not-unimportant info to the doxygen docu
- typo fixed
- add a set_using_irn_link()/clear_using_irn_link() pair
[r20777]
*/
int opt_tail_rec_irg(ir_graph *irg);
*/
int opt_tail_rec_irg(ir_graph *irg);
* Optimize tail-recursion calls for all IR-Graphs.
* Optimize tail-recursion calls for all IR-Graphs.
- * Depends on the flag opt_tail_recursion.
+ * Can currently handle:
+ * - direct return value, i.e. return func().
+ * - additive return value, i.e. return x +/- func()
+ * - multiplicative return value, i.e. return x * func() or return -func()
+ *
+ * The current implementation must be run before optimize_funccalls(),
+ * because it expects the memory edges pointing to calls, which might be
+ * removed by optimize_funccalls().
*/
void opt_tail_recursion(void);
*/
void opt_tail_recursion(void);
*
* Does conditional constant propagation, unreachable code elimination and optimistic
* global value numbering at once.
*
* Does conditional constant propagation, unreachable code elimination and optimistic
* global value numbering at once.
+ *
+ * @param irg the graph to run on
*/
void combo(ir_graph *irg);
*/
void combo(ir_graph *irg);
return TR_BAD;
case iro_Sub:
return TR_BAD;
case iro_Sub:
- /* try additive, but return value mut be left */
+ /* try additive, but return value must be left */
a = get_Sub_left(irn);
if (get_irn_MacroBlock(a) != get_irn_MacroBlock(call)) {
/* we are outside, ignore */
a = get_Sub_left(irn);
if (get_irn_MacroBlock(a) != get_irn_MacroBlock(call)) {
/* we are outside, ignore */
+ set_using_irn_link(irg);
if (opt_tail_rec_irg(irg))
++n_opt_applications;
if (opt_tail_rec_irg(irg))
++n_opt_applications;
+ clear_using_irn_link(irg);
}
DB((dbg, LEVEL_1, "Performed tail recursion for %d of %d graphs\n",
}
DB((dbg, LEVEL_1, "Performed tail recursion for %d of %d graphs\n",