Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
7e35aef8
Commit
7e35aef8
authored
Sep 27, 2006
by
Michael Beck
Browse files
renamed exec_freq_t to ir_exec_freq
[r8303]
parent
745df986
Changes
4
Hide whitespace changes
Inline
Side-by-side
ir/ana/execfreq.c
View file @
7e35aef8
...
...
@@ -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
);
...
...
ir/ana/execfreq.h
View file @
7e35aef8
...
...
@@ -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 initial
i
ze 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_ */
ir/ana/irextbb.h
View file @
7e35aef8
...
...
@@ -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.
...
...
ir/ana/irextbb2.c
View file @
7e35aef8
...
...
@@ -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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment