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
1bebdda9
Commit
1bebdda9
authored
Apr 19, 2007
by
Christian Würdig
Browse files
phase takes now additional param on init
[r13418]
parent
14618bc6
Changes
11
Hide whitespace changes
Inline
Side-by-side
ir/ana/height.c
View file @
1bebdda9
...
...
@@ -228,7 +228,7 @@ void heights_recompute(heights_t *h)
heights_t
*
heights_new
(
ir_graph
*
irg
)
{
heights_t
*
res
=
xmalloc
(
sizeof
(
res
[
0
]));
phase_init
(
&
res
->
ph
,
"heights"
,
irg
,
PHASE_DEFAULT_GROWTH
,
irn_height_init
);
phase_init
(
&
res
->
ph
,
"heights"
,
irg
,
PHASE_DEFAULT_GROWTH
,
irn_height_init
,
NULL
);
res
->
dump_handle
=
dump_add_node_info_callback
(
height_dump_cb
,
res
);
heights_recompute
(
res
);
...
...
ir/ana/phiclass.c
View file @
1bebdda9
...
...
@@ -198,7 +198,7 @@ phi_classes_t *phi_class_new_from_irg(ir_graph *irg, int pure_phi_classes) {
phi_classes_t
*
res
=
xmalloc
(
sizeof
(
*
res
));
FIRM_DBG_REGISTER
(
res
->
dbg
,
"ir.ana.phiclass"
);
phase_init
(
&
res
->
ph
,
"phi_classes"
,
irg
,
PHASE_DEFAULT_GROWTH
,
irn_phi_class_init
);
phase_init
(
&
res
->
ph
,
"phi_classes"
,
irg
,
PHASE_DEFAULT_GROWTH
,
irn_phi_class_init
,
NULL
);
res
->
irg
=
irg
;
res
->
all_phi_classes
=
pset_new_ptr
(
5
);
...
...
@@ -217,7 +217,7 @@ phi_classes_t *phi_class_new_from_set(ir_graph *irg, ir_nodeset_t *all_phis, int
phi_classes_t
*
res
=
xmalloc
(
sizeof
(
*
res
));
FIRM_DBG_REGISTER
(
res
->
dbg
,
"ir.ana.phiclass"
);
phase_init
(
&
res
->
ph
,
"phi_classes"
,
irg
,
PHASE_DEFAULT_GROWTH
,
irn_phi_class_init
);
phase_init
(
&
res
->
ph
,
"phi_classes"
,
irg
,
PHASE_DEFAULT_GROWTH
,
irn_phi_class_init
,
NULL
);
res
->
irg
=
irg
;
res
->
all_phi_classes
=
pset_new_ptr
(
5
);
...
...
ir/be/becopyheur2.c
View file @
1bebdda9
...
...
@@ -1232,7 +1232,7 @@ int co_solve_heuristic_new(copy_opt_t *co)
co2_t
env
;
FILE
*
f
;
phase_init
(
&
env
.
ph
,
"co2"
,
co
->
cenv
->
birg
->
irg
,
PHASE_DEFAULT_GROWTH
,
co2_irn_init
);
phase_init
(
&
env
.
ph
,
"co2"
,
co
->
cenv
->
birg
->
irg
,
PHASE_DEFAULT_GROWTH
,
co2_irn_init
,
NULL
);
env
.
touched
=
NULL
;
env
.
visited
=
0
;
env
.
co
=
co
;
...
...
ir/be/beifg.c
View file @
1bebdda9
...
...
@@ -69,7 +69,7 @@ static void *regs_irn_data_init(ir_phase *ph, ir_node *irn, void *data)
coloring_t
*
coloring_init
(
coloring_t
*
c
,
ir_graph
*
irg
,
const
arch_env_t
*
aenv
)
{
phase_init
(
&
c
->
ph
,
"regs_map"
,
irg
,
PHASE_DEFAULT_GROWTH
,
regs_irn_data_init
);
phase_init
(
&
c
->
ph
,
"regs_map"
,
irg
,
PHASE_DEFAULT_GROWTH
,
regs_irn_data_init
,
NULL
);
c
->
arch_env
=
aenv
;
c
->
irg
=
irg
;
return
c
;
...
...
ir/be/beifg_pointer.c
View file @
1bebdda9
...
...
@@ -707,7 +707,7 @@ be_ifg_t *be_ifg_pointer_new(const be_chordal_env_t *env)
ifg
->
node_map
=
pmap_create
();
/* to find all nodes, should be replaced by a "keywalker" of irphase */
phase_init
(
&
ifg
->
ph
,
"ptr_map"
,
env
->
irg
,
PHASE_DEFAULT_GROWTH
,
ptr_irn_data_init
);
phase_init
(
&
ifg
->
ph
,
"ptr_map"
,
env
->
irg
,
PHASE_DEFAULT_GROWTH
,
ptr_irn_data_init
,
NULL
);
obstack_init
(
&
ifg
->
obst
);
dom_tree_walk_irg
(
env
->
irg
,
find_neighbour_walker
,
NULL
,
ifg
);
...
...
ir/be/beilpsched.c
View file @
1bebdda9
...
...
@@ -2024,7 +2024,7 @@ void be_ilp_sched(const be_irg_t *birg, be_options_t *be_opts) {
env
.
opts
=
&
ilp_opts
;
env
.
birg
=
birg
;
env
.
be_opts
=
be_opts
;
phase_init
(
&
env
.
ph
,
name
,
env
.
irg
,
PHASE_DEFAULT_GROWTH
,
init_ilpsched_irn
);
phase_init
(
&
env
.
ph
,
name
,
env
.
irg
,
PHASE_DEFAULT_GROWTH
,
init_ilpsched_irn
,
NULL
);
/* assign a unique per block number to all interesting nodes */
irg_walk_in_or_dep_graph
(
env
.
irg
,
NULL
,
build_block_idx
,
&
env
);
...
...
ir/be/belive.c
View file @
1bebdda9
...
...
@@ -468,7 +468,7 @@ be_lv_t *be_liveness(ir_graph *irg)
lv
->
hook_info
.
context
=
lv
;
lv
->
hook_info
.
hook
.
_hook_node_info
=
lv_dump_block
;
register_hook
(
hook_node_info
,
&
lv
->
hook_info
);
phase_init
(
&
lv
->
ph
,
"liveness"
,
irg
,
PHASE_DEFAULT_GROWTH
,
lv_phase_data_init
);
phase_init
(
&
lv
->
ph
,
"liveness"
,
irg
,
PHASE_DEFAULT_GROWTH
,
lv_phase_data_init
,
NULL
);
compute_liveness
(
lv
);
return
lv
;
...
...
@@ -486,7 +486,7 @@ void be_liveness_recompute(be_lv_t *lv)
bitset_clear_all
(
lv
->
nodes
);
phase_free
(
&
lv
->
ph
);
phase_init
(
&
lv
->
ph
,
"liveness"
,
lv
->
irg
,
PHASE_DEFAULT_GROWTH
,
lv_phase_data_init
);
phase_init
(
&
lv
->
ph
,
"liveness"
,
lv
->
irg
,
PHASE_DEFAULT_GROWTH
,
lv_phase_data_init
,
NULL
);
compute_liveness
(
lv
);
}
...
...
ir/be/beschedmris.c
View file @
1bebdda9
...
...
@@ -490,7 +490,7 @@ mris_env_t *be_sched_mris_preprocess(const be_irg_t *birg)
mris_env_t
*
env
=
xmalloc
(
sizeof
(
env
[
0
]));
ir_graph
*
irg
=
be_get_birg_irg
(
birg
);
phase_init
(
&
env
->
ph
,
"mris"
,
irg
,
2
*
PHASE_DEFAULT_GROWTH
,
mris_irn_data_init
);
phase_init
(
&
env
->
ph
,
"mris"
,
irg
,
2
*
PHASE_DEFAULT_GROWTH
,
mris_irn_data_init
,
NULL
);
env
->
aenv
=
be_get_birg_arch_env
(
birg
);
env
->
irg
=
irg
;
env
->
visited
=
0
;
...
...
ir/be/beschedrss.c
View file @
1bebdda9
...
...
@@ -2022,7 +2022,7 @@ static void process_block(ir_node *block, void *env) {
int
i
,
n
;
const
ir_edge_t
*
edge
;
phase_init
(
&
rss
->
ph
,
"rss block preprocessor"
,
rss
->
irg
,
PHASE_DEFAULT_GROWTH
,
init_rss_irn
);
phase_init
(
&
rss
->
ph
,
"rss block preprocessor"
,
rss
->
irg
,
PHASE_DEFAULT_GROWTH
,
init_rss_irn
,
NULL
);
DBG
((
rss
->
dbg
,
LEVEL_1
,
"preprocessing block %+F
\n
"
,
block
));
rss
->
block
=
block
;
...
...
ir/ir/irphase.c
View file @
1bebdda9
...
...
@@ -5,7 +5,7 @@
* Author: Sebastian Hack
* Modified by:
* Created:
*
CVS
-ID: $Id$
*
SVN
-ID: $Id$
* Copyright: (c) 1998-2006 Universitaet Karlsruhe
* Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
*/
...
...
@@ -18,7 +18,7 @@
#include "irnode_t.h"
#include "irphase_t.h"
ir_phase
*
phase_init
(
ir_phase
*
ph
,
const
char
*
name
,
ir_graph
*
irg
,
unsigned
growth_factor
,
phase_irn_data_init_t
*
data_init
)
ir_phase
*
phase_init
(
ir_phase
*
ph
,
const
char
*
name
,
ir_graph
*
irg
,
unsigned
growth_factor
,
phase_irn_data_init_t
*
data_init
,
void
*
priv
)
{
assert
(
growth_factor
>=
256
&&
"growth factor must greater or equal to 256/256"
);
assert
(
data_init
&&
"You must provide a data constructor"
);
...
...
@@ -31,6 +31,7 @@ ir_phase *phase_init(ir_phase *ph, const char *name, ir_graph *irg, unsigned gro
ph
->
irg
=
irg
;
ph
->
n_data_ptr
=
0
;
ph
->
data_ptr
=
NULL
;
ph
->
priv
=
priv
;
return
ph
;
}
...
...
@@ -88,7 +89,7 @@ void phase_reinit_block_irn_data(ir_phase *phase, ir_node *block)
}
ir_node
*
phase_get_first_node
(
ir_phase
*
phase
)
{
int
i
;
unsigned
i
;
for
(
i
=
0
;
i
<
phase
->
n_data_ptr
;
++
i
)
if
(
phase
->
data_ptr
[
i
])
...
...
@@ -98,7 +99,7 @@ ir_node *phase_get_first_node(ir_phase *phase) {
}
ir_node
*
phase_get_next_node
(
ir_phase
*
phase
,
ir_node
*
start
)
{
int
i
;
unsigned
i
;
for
(
i
=
get_irn_idx
(
start
)
+
1
;
i
<
phase
->
n_data_ptr
;
++
i
)
if
(
phase
->
data_ptr
[
i
])
...
...
ir/ir/irphase_t.h
View file @
1bebdda9
...
...
@@ -66,7 +66,7 @@ struct _ir_phase {
* @param priv Some private pointer which is kept in the phase and can be retrieved with phase_get_private().
* @return A new phase object.
*/
ir_phase
*
phase_init
(
ir_phase
*
ph
,
const
char
*
name
,
ir_graph
*
irg
,
unsigned
growth_factor
,
phase_irn_data_init_t
*
data_init
);
ir_phase
*
phase_init
(
ir_phase
*
ph
,
const
char
*
name
,
ir_graph
*
irg
,
unsigned
growth_factor
,
phase_irn_data_init_t
*
data_init
,
void
*
priv
);
/**
* Free the phase and all node data associated with it.
...
...
Write
Preview
Markdown
is supported
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