Commit 887edd1f authored by Michael Beck's avatar Michael Beck
Browse files

- opt_tail_recursion() must run before optimize_funccalls():

  Add this not-unimportant info to the doxygen docu
- typo fixed
- add a set_using_irn_link()/clear_using_irn_link() pair

[r20777]
parent 558c2a2d
......@@ -439,9 +439,16 @@ void reduce_strength(ir_graph *irg);
*/
int opt_tail_rec_irg(ir_graph *irg);
/*
/**
* 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);
......@@ -514,6 +521,8 @@ void optimize_class_casts(void);
*
* 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);
......
......@@ -489,7 +489,7 @@ static tail_rec_variants find_variant(ir_node *irn, ir_node *call) {
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 */
......@@ -719,8 +719,10 @@ void opt_tail_recursion(void) {
current_ir_graph = irg;
set_using_irn_link(irg);
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",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment