projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove unused variable.
[libfirm]
/
ir
/
opt
/
tailrec.c
diff --git
a/ir/opt/tailrec.c
b/ir/opt/tailrec.c
index
5ca9549
..
c64759f
100644
(file)
--- a/
ir/opt/tailrec.c
+++ b/
ir/opt/tailrec.c
@@
-24,9
+24,7
@@
* @author Michael Beck
* @version $Id$
*/
* @author Michael Beck
* @version $Id$
*/
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "config.h"
#include <string.h>
#include <assert.h>
#include <string.h>
#include <assert.h>
@@
-34,7
+32,7
@@
#include "debug.h"
#include "iroptimize.h"
#include "scalar_replace.h"
#include "debug.h"
#include "iroptimize.h"
#include "scalar_replace.h"
-#include "array.h"
+#include "array
_t
.h"
#include "irprog_t.h"
#include "irgwalk.h"
#include "irgmod.h"
#include "irprog_t.h"
#include "irgwalk.h"
#include "irgmod.h"
@@
-46,7
+44,7
@@
#include "trouts.h"
#include "irouts.h"
#include "irhooks.h"
#include "trouts.h"
#include "irouts.h"
#include "irhooks.h"
-#include "
xmalloc
.h"
+#include "
ircons_t
.h"
DEBUG_ONLY(static firm_dbg_module_t *dbg);
DEBUG_ONLY(static firm_dbg_module_t *dbg);
@@
-77,7
+75,7
@@
static void collect_data(ir_node *node, void *env) {
if (op == op_Proj) {
ir_node *start = get_Proj_pred(pred);
if (op == op_Proj) {
ir_node *start = get_Proj_pred(pred);
- if (
get_irn_op(start) == op_Start
) {
+ if (
is_Start(start)
) {
if (get_Proj_proj(pred) == pn_Start_T_args) {
/* found Proj(ProjT(Start)) */
set_irn_link(node, data->proj_data);
if (get_Proj_proj(pred) == pn_Start_T_args) {
/* found Proj(ProjT(Start)) */
set_irn_link(node, data->proj_data);
@@
-262,10
+260,7
@@
static void do_opt_tail_rec(ir_graph *irg, tr_env *env) {
* ok, we are here, so we have build and collected all needed Phi's
* now exchange all Projs into links to Phi
*/
* ok, we are here, so we have build and collected all needed Phi's
* now exchange all Projs into links to Phi
*/
- for (p = data.proj_m; p; p = n) {
- n = get_irn_link(p);
- exchange(p, phis[0]);
- }
+ exchange(data.proj_m, phis[0]);
for (p = data.proj_data; p; p = n) {
long proj = get_Proj_proj(p);
for (p = data.proj_data; p; p = n) {
long proj = get_Proj_proj(p);
@@
-491,7
+486,7
@@
static tail_rec_variants find_variant(ir_node *irn, ir_node *call) {
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 mu
s
t 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 */
@@
-631,10
+626,10
@@
int opt_tail_rec_irg(ir_graph *irg) {
/* check if it's a recursive call */
call_ptr = get_Call_ptr(call);
/* check if it's a recursive call */
call_ptr = get_Call_ptr(call);
- if (! is_
SymConst_addr_ent
(call_ptr))
+ if (! is_
Global
(call_ptr))
continue;
continue;
- ent = get_
SymConst
_entity(call_ptr);
+ ent = get_
Global
_entity(call_ptr);
if (!ent || get_entity_irg(ent) != irg)
continue;
if (!ent || get_entity_irg(ent) != irg)
continue;
@@
-721,8
+716,11
@@
void opt_tail_recursion(void) {
current_ir_graph = irg;
current_ir_graph = irg;
+ ir_reserve_resources(irg, IR_RESOURCE_IRN_LINK);
if (opt_tail_rec_irg(irg))
++n_opt_applications;
if (opt_tail_rec_irg(irg))
++n_opt_applications;
+
+ ir_free_resources(irg, IR_RESOURCE_IRN_LINK);
}
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",