projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
assert that in and out entities of memperms have the same size, we produce such buggy...
[libfirm]
/
ir
/
be
/
bepressurestat.c
diff --git
a/ir/be/bepressurestat.c
b/ir/be/bepressurestat.c
index
0eb07db
..
20c77b4
100644
(file)
--- a/
ir/be/bepressurestat.c
+++ b/
ir/be/bepressurestat.c
@@
-37,7
+37,7
@@
#include "belive_t.h"
#include "besched_t.h"
#include "beirgmod.h"
#include "belive_t.h"
#include "besched_t.h"
#include "beirgmod.h"
-#include "bearch.h"
+#include "bearch
_t
.h"
#include "benode_t.h"
#include "beutil.h"
#include "bespillremat.h"
#include "benode_t.h"
#include "beutil.h"
#include "bespillremat.h"
@@
-48,8
+48,9
@@
#define MAXPRESSURE 128
typedef struct _regpressure_ana_t {
#define MAXPRESSURE 128
typedef struct _regpressure_ana_t {
+ arch_env_t *arch_env;
const arch_register_class_t *cls;
const arch_register_class_t *cls;
- const be_
chordal_env_t *chordal_en
v;
+ const be_
lv_t *l
v;
unsigned int *stat;
DEBUG_ONLY(firm_dbg_module_t * dbg);
} regpressure_ana_t;
unsigned int *stat;
DEBUG_ONLY(firm_dbg_module_t * dbg);
} regpressure_ana_t;
@@
-57,7
+58,7
@@
typedef struct _regpressure_ana_t {
static INLINE int
has_reg_class(const regpressure_ana_t * ra, const ir_node * irn)
{
static INLINE int
has_reg_class(const regpressure_ana_t * ra, const ir_node * irn)
{
- return
chordal_has_class(ra->chordal_env
, irn);
+ return
arch_irn_consider_in_reg_alloc(ra->arch_env, ra->cls
, irn);
}
static INLINE int
}
static INLINE int
@@
-71,17
+72,16
@@
regpressure(pset * live)
static void
regpressureanawalker(ir_node * bb, void * data)
{
static void
regpressureanawalker(ir_node * bb, void * data)
{
- regpressure_ana_t *ra = data;
+ regpressure_ana_t *ra
= data;
pset *live = pset_new_ptr_default();
const ir_node *irn;
pset *live = pset_new_ptr_default();
const ir_node *irn;
- irn_live_t *li;
unsigned int *stat = ra->stat;
unsigned int *stat = ra->stat;
- int i;
+ int i;
+ const be_lv_t *lv = ra->lv;
- live_foreach(bb, li) {
- ir_node *value = (ir_node *) li->irn;
-
- if (live_is_end(li) && has_reg_class(ra, value)) {
+ be_lv_foreach(lv, bb, be_lv_state_end, i) {
+ ir_node *value = be_lv_get_irn(lv, bb, i);
+ if (has_reg_class(ra, value)) {
pset_insert_ptr(live, value);
}
}
pset_insert_ptr(live, value);
}
}
@@
-108,27
+108,32
@@
regpressureanawalker(ir_node * bb, void * data)
}
void
}
void
-be_analyze_regpressure(const be_chordal_env_t * chordal_env, const char * suffix)
+be_analyze_regpressure(be_irg_t *birg, const arch_register_class_t *cls,
+ const char * suffix)
{
regpressure_ana_t ra;
unsigned int stat[MAXPRESSURE+1];
unsigned int i;
char fname[256];
FILE *f;
{
regpressure_ana_t ra;
unsigned int stat[MAXPRESSURE+1];
unsigned int i;
char fname[256];
FILE *f;
+ ir_graph *irg = be_get_birg_irg(birg);
- ir_snprintf(fname, sizeof(fname), "%F_%s%s_pressure.stat",
chordal_env->irg, chordal_env->
cls->name, suffix);
+ ir_snprintf(fname, sizeof(fname), "%F_%s%s_pressure.stat",
irg,
cls->name, suffix);
f = fopen(fname, "w");
assert(f);
f = fopen(fname, "w");
assert(f);
+ be_assure_liveness(birg);
+
FIRM_DBG_REGISTER(ra.dbg, "firm.be.regpressureana");
FIRM_DBG_REGISTER(ra.dbg, "firm.be.regpressureana");
- ra.chordal_env = chordal_env;
- ra.cls = chordal_env->cls;
+ ra.arch_env = birg->main_env->arch_env;
+ ra.lv = be_get_birg_liveness(birg);
+ ra.cls = cls;
ra.stat = stat;
memset(stat, 0, sizeof(stat));
ra.stat = stat;
memset(stat, 0, sizeof(stat));
- irg_block_walk_graph(
chordal_env->
irg, regpressureanawalker, NULL, &ra);
+ irg_block_walk_graph(irg, regpressureanawalker, NULL, &ra);
for(i=0; i<=MAXPRESSURE; ++i) {
fprintf(f,"%d\n",stat[i]);
for(i=0; i<=MAXPRESSURE; ++i) {
fprintf(f,"%d\n",stat[i]);