From 7e35aef87a8dcf83b03dd0cd0ed2d7eabdc6d062 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Wed, 27 Sep 2006 23:27:01 +0000 Subject: [PATCH] renamed exec_freq_t to ir_exec_freq [r8303] --- ir/ana/execfreq.c | 20 ++++++++++---------- ir/ana/execfreq.h | 18 +++++++++--------- ir/ana/irextbb.h | 2 +- ir/ana/irextbb2.c | 4 ++-- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/ir/ana/execfreq.c b/ir/ana/execfreq.c index 21b515a36..5b3833c24 100644 --- a/ir/ana/execfreq.c +++ b/ir/ana/execfreq.c @@ -60,7 +60,7 @@ typedef struct _walkerdata_t { size_t idx; } walkerdata_t; -struct _exec_freq_t { +struct ir_exec_freq { set *set; hook_entry_t hook; double max; @@ -98,7 +98,7 @@ set_insert_freq(set * set, const ir_node * irn) } double -get_block_execfreq(const exec_freq_t *ef, const ir_node * irn) +get_block_execfreq(const ir_exec_freq *ef, const ir_node * irn) { if(!ef->infeasible) { set *freqs = ef->set; @@ -115,7 +115,7 @@ get_block_execfreq(const exec_freq_t *ef, const ir_node * irn) } unsigned long -get_block_execfreq_ulong(const exec_freq_t *ef, const ir_node *bb) +get_block_execfreq_ulong(const ir_exec_freq *ef, const ir_node *bb) { double f = get_block_execfreq(ef, bb); int res = (int) (f > ef->min_non_zero ? ef->m * f + ef->b : 1.0); @@ -193,14 +193,14 @@ get_cf_probability(ir_node *bb, int pos, double loop_weight) static void exec_freq_node_info(void *ctx, FILE *f, const ir_node *irn) { if(is_Block(irn)) { - exec_freq_t *ef = ctx; + ir_exec_freq *ef = ctx; fprintf(f, "execution frequency: %g/%lu\n", get_block_execfreq(ef, irn), get_block_execfreq_ulong(ef, irn)); } } -exec_freq_t *create_execfreq(ir_graph *irg) +ir_exec_freq *create_execfreq(ir_graph *irg) { - exec_freq_t *execfreq = xmalloc(sizeof(execfreq[0])); + ir_exec_freq *execfreq = xmalloc(sizeof(execfreq[0])); memset(execfreq, 0, sizeof(execfreq[0])); execfreq->set = new_set(cmp_freq, 32); @@ -212,13 +212,13 @@ exec_freq_t *create_execfreq(ir_graph *irg) return execfreq; } -void set_execfreq(exec_freq_t *execfreq, const ir_node *block, double freq) +void set_execfreq(ir_exec_freq *execfreq, const ir_node *block, double freq) { freq_t *f = set_insert_freq(execfreq->set, block); f->freq = freq; } -exec_freq_t * +ir_exec_freq * compute_execfreq(ir_graph * irg, double loop_weight) { size_t size; @@ -227,7 +227,7 @@ compute_execfreq(ir_graph * irg, double loop_weight) int i; freq_t *freq; walkerdata_t wd; - exec_freq_t *ef; + ir_exec_freq *ef; set *freqs; #ifdef USE_GSL gsl_vector *x; @@ -363,7 +363,7 @@ compute_execfreq(ir_graph * irg, double loop_weight) } void -free_execfreq(exec_freq_t *ef) +free_execfreq(ir_exec_freq *ef) { del_set(ef->set); unregister_hook(hook_node_info, &ef->hook); diff --git a/ir/ana/execfreq.h b/ir/ana/execfreq.h index 32b33dfa2..c633950b8 100644 --- a/ir/ana/execfreq.h +++ b/ir/ana/execfreq.h @@ -13,31 +13,31 @@ */ #include "firm_types.h" -struct _exec_freq_t; +struct ir_exec_freq; #ifndef _EXECFREQ_TYPEDEF #define _EXECFREQ_TYPEDEF -typedef struct _exec_freq_t exec_freq_t; +typedef struct ir_exec_freq ir_exec_freq; #endif /** * Create execfreq structure (to be used with set_execfreq) */ -exec_freq_t *create_execfreq(ir_graph *irg); +ir_exec_freq *create_execfreq(ir_graph *irg); /** * Set execution frequency of a basic block */ -void set_execfreq(exec_freq_t *ef, const ir_node *block, double freq); +void set_execfreq(ir_exec_freq *ef, const ir_node *block, double freq); /** - * Create execfreq structure and initialze with estimated frequencies + * Create execfreq structure and initialize with estimated frequencies */ -exec_freq_t *compute_execfreq(ir_graph *irg, double loop_weight); +ir_exec_freq *compute_execfreq(ir_graph *irg, double loop_weight); -void free_execfreq(exec_freq_t *ef); +void free_execfreq(ir_exec_freq *ef); -double get_block_execfreq(const exec_freq_t *ef, const ir_node *block); -unsigned long get_block_execfreq_ulong(const exec_freq_t *ef, const ir_node *block); +double get_block_execfreq(const ir_exec_freq *ef, const ir_node *block); +unsigned long get_block_execfreq_ulong(const ir_exec_freq *ef, const ir_node *block); #endif /* EXECFREQ_H_ */ diff --git a/ir/ana/irextbb.h b/ir/ana/irextbb.h index b495e82b3..472fe031b 100644 --- a/ir/ana/irextbb.h +++ b/ir/ana/irextbb.h @@ -61,7 +61,7 @@ void compute_extbb(ir_graph *irg); /** * Compute the extended basic blocks for a graph based on execution frequencies. */ -void compute_extbb_execfreqs(ir_graph *irg, exec_freq_t *execfreqs); +void compute_extbb_execfreqs(ir_graph *irg, ir_exec_freq *execfreqs); /** * free all extended block info. diff --git a/ir/ana/irextbb2.c b/ir/ana/irextbb2.c index 6a1d936ba..543b8be5a 100644 --- a/ir/ana/irextbb2.c +++ b/ir/ana/irextbb2.c @@ -30,7 +30,7 @@ typedef struct _env { struct obstack *obst; /**< the obstack where allocations took place */ ir_extblk *head; /**< head of the list of all extended blocks */ - exec_freq_t *execfreqs; + ir_exec_freq *execfreqs; } env_t; /** @@ -168,7 +168,7 @@ static void pick_successor(ir_node *block, ir_extblk *extblk, env_t *env) /* * Compute the extended basic blocks for a graph */ -void compute_extbb_execfreqs(ir_graph *irg, exec_freq_t *execfreqs) { +void compute_extbb_execfreqs(ir_graph *irg, ir_exec_freq *execfreqs) { env_t env; ir_extblk *extbb, *next; ir_node *endblock; -- 2.20.1