Commit 7e35aef8 authored by Michael Beck's avatar Michael Beck
Browse files

renamed exec_freq_t to ir_exec_freq

[r8303]
parent 745df986
...@@ -60,7 +60,7 @@ typedef struct _walkerdata_t { ...@@ -60,7 +60,7 @@ typedef struct _walkerdata_t {
size_t idx; size_t idx;
} walkerdata_t; } walkerdata_t;
struct _exec_freq_t { struct ir_exec_freq {
set *set; set *set;
hook_entry_t hook; hook_entry_t hook;
double max; double max;
...@@ -98,7 +98,7 @@ set_insert_freq(set * set, const ir_node * irn) ...@@ -98,7 +98,7 @@ set_insert_freq(set * set, const ir_node * irn)
} }
double 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) { if(!ef->infeasible) {
set *freqs = ef->set; set *freqs = ef->set;
...@@ -115,7 +115,7 @@ get_block_execfreq(const exec_freq_t *ef, const ir_node * irn) ...@@ -115,7 +115,7 @@ get_block_execfreq(const exec_freq_t *ef, const ir_node * irn)
} }
unsigned long 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); double f = get_block_execfreq(ef, bb);
int res = (int) (f > ef->min_non_zero ? ef->m * f + ef->b : 1.0); 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) ...@@ -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) static void exec_freq_node_info(void *ctx, FILE *f, const ir_node *irn)
{ {
if(is_Block(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)); 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])); memset(execfreq, 0, sizeof(execfreq[0]));
execfreq->set = new_set(cmp_freq, 32); execfreq->set = new_set(cmp_freq, 32);
...@@ -212,13 +212,13 @@ exec_freq_t *create_execfreq(ir_graph *irg) ...@@ -212,13 +212,13 @@ exec_freq_t *create_execfreq(ir_graph *irg)
return execfreq; 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); freq_t *f = set_insert_freq(execfreq->set, block);
f->freq = freq; f->freq = freq;
} }
exec_freq_t * ir_exec_freq *
compute_execfreq(ir_graph * irg, double loop_weight) compute_execfreq(ir_graph * irg, double loop_weight)
{ {
size_t size; size_t size;
...@@ -227,7 +227,7 @@ compute_execfreq(ir_graph * irg, double loop_weight) ...@@ -227,7 +227,7 @@ compute_execfreq(ir_graph * irg, double loop_weight)
int i; int i;
freq_t *freq; freq_t *freq;
walkerdata_t wd; walkerdata_t wd;
exec_freq_t *ef; ir_exec_freq *ef;
set *freqs; set *freqs;
#ifdef USE_GSL #ifdef USE_GSL
gsl_vector *x; gsl_vector *x;
...@@ -363,7 +363,7 @@ compute_execfreq(ir_graph * irg, double loop_weight) ...@@ -363,7 +363,7 @@ compute_execfreq(ir_graph * irg, double loop_weight)
} }
void void
free_execfreq(exec_freq_t *ef) free_execfreq(ir_exec_freq *ef)
{ {
del_set(ef->set); del_set(ef->set);
unregister_hook(hook_node_info, &ef->hook); unregister_hook(hook_node_info, &ef->hook);
......
...@@ -13,31 +13,31 @@ ...@@ -13,31 +13,31 @@
*/ */
#include "firm_types.h" #include "firm_types.h"
struct _exec_freq_t; struct ir_exec_freq;
#ifndef _EXECFREQ_TYPEDEF #ifndef _EXECFREQ_TYPEDEF
#define _EXECFREQ_TYPEDEF #define _EXECFREQ_TYPEDEF
typedef struct _exec_freq_t exec_freq_t; typedef struct ir_exec_freq ir_exec_freq;
#endif #endif
/** /**
* Create execfreq structure (to be used with set_execfreq) * 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 * 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); double get_block_execfreq(const ir_exec_freq *ef, const ir_node *block);
unsigned long get_block_execfreq_ulong(const exec_freq_t *ef, const ir_node *block); unsigned long get_block_execfreq_ulong(const ir_exec_freq *ef, const ir_node *block);
#endif /* EXECFREQ_H_ */ #endif /* EXECFREQ_H_ */
...@@ -61,7 +61,7 @@ void compute_extbb(ir_graph *irg); ...@@ -61,7 +61,7 @@ void compute_extbb(ir_graph *irg);
/** /**
* Compute the extended basic blocks for a graph based on execution frequencies. * 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. * free all extended block info.
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
typedef struct _env { typedef struct _env {
struct obstack *obst; /**< the obstack where allocations took place */ struct obstack *obst; /**< the obstack where allocations took place */
ir_extblk *head; /**< head of the list of all extended blocks */ ir_extblk *head; /**< head of the list of all extended blocks */
exec_freq_t *execfreqs; ir_exec_freq *execfreqs;
} env_t; } env_t;
/** /**
...@@ -168,7 +168,7 @@ static void pick_successor(ir_node *block, ir_extblk *extblk, env_t *env) ...@@ -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 * 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; env_t env;
ir_extblk *extbb, *next; ir_extblk *extbb, *next;
ir_node *endblock; ir_node *endblock;
......
Supports Markdown
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