Commit 7813122b authored by Götz Lindenmaier's avatar Götz Lindenmaier
Browse files

firmstat added

[r3376]
parent 32a44b62
...@@ -47,7 +47,7 @@ CPPFLAGS += -I$(top_srcdir)/ir/ir -I$(top_srcdir)/ir/common \ ...@@ -47,7 +47,7 @@ CPPFLAGS += -I$(top_srcdir)/ir/ir -I$(top_srcdir)/ir/common \
-I$(top_srcdir)/ir/ident -I$(top_srcdir)/ir/tr \ -I$(top_srcdir)/ir/ident -I$(top_srcdir)/ir/tr \
-I$(top_srcdir)/ir/tv -I$(top_srcdir)/ir/debug \ -I$(top_srcdir)/ir/tv -I$(top_srcdir)/ir/debug \
-I$(top_srcdir)/ir/ana -I$(top_srcdir)/ir/opt \ -I$(top_srcdir)/ir/ana -I$(top_srcdir)/ir/opt \
-I$(top_srcdir)/ir/st -I$(top_srcdir)/ir/st -I$(top_srcdir)/ir/stat
LDFLAGS += -I$(topdir) LDFLAGS += -I$(topdir)
...@@ -68,7 +68,7 @@ FIRM_PATH_HEADERS=common/firm.h common/firm_common.h \ ...@@ -68,7 +68,7 @@ FIRM_PATH_HEADERS=common/firm.h common/firm_common.h \
ir/ircons.h ir/ircgcons.h ir/irflag.h ir/irvrfy.h ir/irdump.h \ ir/ircons.h ir/ircgcons.h ir/irflag.h ir/irvrfy.h ir/irdump.h \
ir/iropt.h ir/irgopt.h ir/ircgopt.h \ ir/iropt.h ir/irgopt.h ir/ircgopt.h \
ana/irouts.h ana/irdom.h ana/irloop.h ana/cgana.h \ ana/irouts.h ana/irdom.h ana/irloop.h ana/cgana.h \
ir/irgmod.h tr/typegmod.h opt/tailrec.h ir/irgmod.h tr/typegmod.h opt/tailrec.h stat/firmstat.h
FIRM_SOURCE_DIR_HEADERS=$(addprefix $(SOURCE_DIR)/,$(FIRM_HEADERS)) FIRM_SOURCE_DIR_HEADERS=$(addprefix $(SOURCE_DIR)/,$(FIRM_HEADERS))
......
...@@ -24,21 +24,19 @@ ...@@ -24,21 +24,19 @@
#include "cgana.h" #include "cgana.h"
#include "rta.h" #include "rta.h"
#include "irnode_t.h"
#include "eset.h" #include "irmode_t.h"
#include "pmap.h" #include "irprog_t.h"
#include "array.h"
#include "irprog.h"
#include "irgwalk.h" #include "irgwalk.h"
#include "ircons.h" #include "ircons.h"
#include "irgmod.h" #include "irgmod.h"
#include "irnode_t.h"
#include "irflag_t.h"
#include "irmode_t.h"
#include "irflag_t.h"
#include "dbginfo_t.h" #include "dbginfo_t.h"
#include "irdump.h" #include "eset.h"
#include "pmap.h"
#include "array.h"
/* Eindeutige Adresse zur Markierung von besuchten Knoten und zur /* Eindeutige Adresse zur Markierung von besuchten Knoten und zur
* Darstellung der unbekannten Methode. */ * Darstellung der unbekannten Methode. */
......
...@@ -958,59 +958,19 @@ static void scc (ir_node *n) { ...@@ -958,59 +958,19 @@ static void scc (ir_node *n) {
if (!is_outermost_Start(n)) { if (!is_outermost_Start(n)) {
int arity = get_irn_arity(n); int arity = get_irn_arity(n);
#if EXPERIMENTAL_LOOP_TREE for (i = get_start_index(n); i < arity; i++) {
ir_node *m;
/* This is meant to be used with the experimenatl code above. if (is_backedge(n, i)) continue;
If the above code is not used any more, this can be deleted, too.... */ m = get_irn_n(n, i); /* get_irn_ip_pred(n, i); */
/* if ((!m) || (get_irn_op(m) == op_Unknown)) continue; */
if(interprocedural_view && scc (m);
is_Block(n) && if (irn_is_in_stack(m)) {
get_irn_op(get_irn_n(n, 0)) == op_Proj && /* Uplink of m is smaller if n->m is a backedge.
get_irn_op(get_irn_n(get_irn_n(n, 0), 0)) == op_CallBegin) Propagate the uplink to mark the loop. */
{ if (get_irn_uplink(m) < get_irn_uplink(n))
/* We are at the start node of a function: set_irn_uplink(n, get_irn_uplink(m));
Walk to the callers in the correct order! */
DDMN(n);
DDMN(get_irn_n(get_irn_n(n, 0), 0));
for(i = 0; i < arity; i++)
{
int pred_nr;
ir_node *m;
pred_nr = search_endproj_in_stack(n);
assert(pred_nr >= 0);
if(is_backedge(n, pred_nr))
continue;
m = get_irn_n(n, pred_nr);
scc(m);
if (irn_is_in_stack(m)) {
/* Uplink of m is smaller if n->m is a backedge.
Propagate the uplink to mark the loop. */
if (get_irn_uplink(m) < get_irn_uplink(n))
set_irn_uplink(n, get_irn_uplink(m));
}
}
}
else
#endif
{
for (i = get_start_index(n); i < arity; i++) {
ir_node *m;
if (is_backedge(n, i)) continue;
m = get_irn_n(n, i); /* get_irn_ip_pred(n, i); */
/* if ((!m) || (get_irn_op(m) == op_Unknown)) continue; */
scc (m);
if (irn_is_in_stack(m)) {
/* Uplink of m is smaller if n->m is a backedge.
Propagate the uplink to mark the loop. */
if (get_irn_uplink(m) < get_irn_uplink(n))
set_irn_uplink(n, get_irn_uplink(m));
}
}
} }
}
} }
if (get_irn_dfn(n) == get_irn_uplink(n)) { if (get_irn_dfn(n) == get_irn_uplink(n)) {
...@@ -1032,10 +992,8 @@ static void scc (ir_node *n) { ...@@ -1032,10 +992,8 @@ static void scc (ir_node *n) {
Next actions: Open a new loop on the loop tree and Next actions: Open a new loop on the loop tree and
try to find inner loops */ try to find inner loops */
#define NO_LOOPS_WITHOUT_HEAD 1 #define NO_LOOPS_WITHOUT_HEAD 1
#if NO_LOOPS_WITHOUT_HEAD #if NO_LOOPS_WITHOUT_HEAD
/* This is an adaption of the algorithm from fiasco / optscc to /* This is an adaption of the algorithm from fiasco / optscc to
* avoid loops without Block or Phi as first node. This should * avoid loops without Block or Phi as first node. This should
* severely reduce the number of evaluations of nodes to detect * severely reduce the number of evaluations of nodes to detect
...@@ -1052,27 +1010,19 @@ static void scc (ir_node *n) { ...@@ -1052,27 +1010,19 @@ static void scc (ir_node *n) {
l = current_loop; l = current_loop;
close = 0; close = 0;
} }
#else #else
ir_loop *l = new_loop(); ir_loop *l = new_loop();
#endif #endif
/* Remove the loop from the stack ... */ /* Remove the loop from the stack ... */
pop_scc_unmark_visit (n); pop_scc_unmark_visit (n);
/* GL @@@ remove experimental stuff rem = find_irg_on_stack(tail); */
/* The current backedge has been marked, that is temporarily eliminated, /* The current backedge has been marked, that is temporarily eliminated,
by find tail. Start the scc algorithm by find tail. Start the scc algorithm
anew on the subgraph thats left (the current loop without the backedge) anew on the subgraph thats left (the current loop without the backedge)
in order to find more inner loops. */ in order to find more inner loops. */
scc (tail); scc (tail);
/* GL @@@ remove experimental stuff current_ir_graph = rem; */
assert (irn_visited(n)); assert (irn_visited(n));
#if NO_LOOPS_WITHOUT_HEAD #if NO_LOOPS_WITHOUT_HEAD
if (close) if (close)
...@@ -1081,8 +1031,8 @@ static void scc (ir_node *n) { ...@@ -1081,8 +1031,8 @@ static void scc (ir_node *n) {
} }
else else
{ {
/* AS: No loop head was found, that is we have straightline code. /* No loop head was found, that is we have straightline code.
Pop all nodes from the stack to the current loop. */ Pop all nodes from the stack to the current loop. */
pop_scc_to_loop(n); pop_scc_to_loop(n);
} }
} }
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
# include "irsimpletype.h" # include "irsimpletype.h"
# include "irnode_t.h" # include "irnode_t.h"
# include "irprog.h" # include "irprog_t.h"
# include "irgwalk.h" # include "irgwalk.h"
# include "ident.h" # include "ident.h"
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
#include <stddef.h> #include <stddef.h>
#include "irgraph_t.h" /* for setting the state flag. */ #include "irgraph_t.h" /* for setting the state flag. */
#include "irprog.h" #include "irprog_t.h"
#include "pmap.h" #include "pmap.h"
/* ------------ The map. ---------------------------------------------- */ /* ------------ The map. ---------------------------------------------- */
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include <stdlib.h> #include <stdlib.h>
#include "irnode_t.h" #include "irnode_t.h"
#include "irprog.h" #include "irprog_t.h"
#include "eset.h" #include "eset.h"
#include "irgwalk.h" #include "irgwalk.h"
...@@ -544,6 +544,9 @@ void rta_report (void) ...@@ -544,6 +544,9 @@ void rta_report (void)
/* /*
* $Log$ * $Log$
* Revision 1.21 2004/07/08 15:50:56 goetz
* firmstat added
*
* Revision 1.20 2004/07/08 11:17:40 goetz * Revision 1.20 2004/07/08 11:17:40 goetz
* *** empty log message *** * *** empty log message ***
* *
......
...@@ -14,15 +14,18 @@ ...@@ -14,15 +14,18 @@
# include <config.h> # include <config.h>
#endif #endif
#include <string.h>
#include "firmwalk.h" #include "firmwalk.h"
#include "pmap.h"
#include "entity.h" #include "entity_t.h"
#include "irnode_t.h" #include "irnode_t.h"
#include "irprog.h" #include "irprog_t.h"
#include "irgwalk.h" #include "irgwalk.h"
#include "array.h" #include "array.h"
#include "obst.h" #include "obst.h"
#include <string.h> #include "pmap.h"
/** obstack for firm walker */ /** obstack for firm walker */
static struct obstack fw_obst; static struct obstack fw_obst;
......
Markdown is supported
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