X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=include%2Flibfirm%2Firlivechk.h;h=53988e7aefb33d9aecffc3ac02a8e0b8b16369b4;hb=9ec98298a0bf99ccb9533365dd7245e0a380f3df;hp=12cbea555decde2fd7017f1ac340872b924cd0f1;hpb=d9888e80deec28a83a4de587506598941efdd60d;p=libfirm diff --git a/include/libfirm/irlivechk.h b/include/libfirm/irlivechk.h index 12cbea555..53988e7ae 100644 --- a/include/libfirm/irlivechk.h +++ b/include/libfirm/irlivechk.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2007 Inria Rhone-Alpes. All right reserved. * * This file is part of libFirm. * @@ -28,11 +28,13 @@ * Hence, nothing has to be updated if the program is modified unless the CFG is touched. * See .c file for more comments. */ + #ifndef FIRM_ANA_IRLIVECHK_H #define FIRM_ANA_IRLIVECHK_H #include "irgraph.h" #include "irnode.h" +#include "dfs.h" typedef enum { lv_chk_state_in = 1, @@ -41,33 +43,15 @@ typedef enum { lv_chk_state_through = lv_chk_state_in | lv_chk_state_out | lv_chk_state_end, } lv_chk_state_t; -#define LV_CHK_MAX_BINS 32 -typedef struct { - int dist_uses_per_var[LV_CHK_MAX_BINS]; /** distribution of uses per variable. */ - int dist_iterations[LV_CHK_MAX_BINS]; /** distribution of loop iterations. */ - int n_calls; /** number of total calls to the chk routine. */ - int n_no_dominance; /** exists due to no existing dominance rel. */ - int n_false; /** number of times the check returned false. */ - int n_def_block; /** number of times the queried block was also - the definition block of the variable. */ -} lv_chk_stat_t; - typedef struct _lv_chk_t lv_chk_t; /** * Make a new liveness check environment. * @param irg The graph. + * @param dfs A forward DFS on CFG of the given irg. * @return The environment. */ -extern lv_chk_t *lv_chk_new(ir_graph *irg); - -/** - * Get statistic data for the liveness check. - * @param lv The liveness check. - * @return A record with statistics data or NULL if stats were - * not enabled. - */ -extern const lv_chk_stat_t *lv_chk_get_stat(const lv_chk_t *lv); +extern lv_chk_t *lv_chk_new(ir_graph *irg, const dfs_t *dfs); /** * Free liveness check information. @@ -75,9 +59,6 @@ extern const lv_chk_stat_t *lv_chk_get_stat(const lv_chk_t *lv); */ extern void lv_chk_free(lv_chk_t *lv); -#define lv_chk_bl_end(lv, bl, irn) ((lv_chk_bl_xxx((lv), (bl), (irn)) & lv_chk_state_end) != 0) -#define lv_chk_bl_out(lv, bl, irn) ((lv_chk_bl_xxx((lv), (bl), (irn)) & lv_chk_state_out) != 0) -#define lv_chk_bl_in(lv, bl, irn) ((lv_chk_bl_xxx((lv), (bl), (irn)) & lv_chk_state_in) != 0) /** * Return liveness information for a node concerning a block. @@ -88,4 +69,8 @@ extern void lv_chk_free(lv_chk_t *lv); */ extern unsigned lv_chk_bl_xxx(const lv_chk_t *lv, const ir_node *bl, const ir_node *irn); +#define lv_chk_bl_in(lv, bl, irn) ((lv_chk_bl_xxx((lv), (bl), (irn)) & lv_chk_state_in) != 0) +#define lv_chk_bl_end(lv, bl, irn) ((lv_chk_bl_xxx((lv), (bl), (irn)) & lv_chk_state_end) != 0) +#define lv_chk_bl_out(lv, bl, irn) ((lv_chk_bl_xxx((lv), (bl), (irn)) & lv_chk_state_out) != 0) + #endif /* FIRM_ANA_IRLIVECHK_H */