Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
634770b1
Commit
634770b1
authored
Sep 06, 2015
by
Matthias Braun
Browse files
pdeq: Remove unnecessary waitq aliases
parent
7ccf8903
Changes
11
Hide whitespace changes
Inline
Side-by-side
include/libfirm/adt/pdeq.h
View file @
634770b1
...
...
@@ -155,56 +155,6 @@ FIRM_API void *pdeq_getl(pdeq *dq);
*/
FIRM_API
void
*
pdeq_getr
(
pdeq
*
dq
);
/**
* The pdeq is often used as a wait queue. A helper
* type to support this.
*/
typedef
pdeq
waitq
;
/**
* Creates a new pointer wait queue (fifo).
*
* @return A new queue.
*/
#define new_waitq() new_pdeq()
/**
* Delete a wait queue (fifo)
*
* @param wq The wait queue.
*/
#define del_waitq(wq) del_pdeq(wq)
/**
* Retrieve a pointer from the wait queue (fifo).
*
* @param wq The wait queue.
*
* @return The pointer element.
*
* @remark This function will fail if the queue is empty.
*/
#define waitq_get(wq) pdeq_getl(wq)
/**
* Add a pointer to the wait queue (fifo).
*
* @param wq The wait queue
* @param x The pointer element to be added
*
* @return The wait queue.
*/
#define waitq_put(wq, x) pdeq_putr((wq), (x))
/**
* Checks if a wait queue is empty.
*
* @param wq The wait queue.
*
* @return non-zero if the queue is empty.
*/
#define waitq_empty(wq) pdeq_empty(wq)
/**
* The pdeq can be used as a stack. A helper
* type to support this.
...
...
ir/ana/vrp.c
View file @
634770b1
...
...
@@ -28,7 +28,7 @@
DEBUG_ONLY
(
static
firm_dbg_module_t
*
dbg
;)
typedef
struct
vrp_env_t
{
waitq
*
workqueue
;
pdeq
*
workqueue
;
bitset_t
*
visited
;
ir_vrp_info
*
info
;
}
vrp_env_t
;
...
...
@@ -476,7 +476,7 @@ static void vrp_first_pass(ir_node *n, void *e)
foreach_irn_out_r
(
n
,
i
,
succ
)
{
if
(
bitset_is_set
(
env
->
visited
,
get_irn_idx
(
succ
)))
{
/* we found a loop*/
wait
q_put
(
env
->
workqueue
,
succ
);
pde
q_put
r
(
env
->
workqueue
,
succ
);
}
}
}
...
...
@@ -520,7 +520,7 @@ void set_vrp_data(ir_graph *irg)
}
vrp_env_t
*
env
=
OALLOCZ
(
&
irg
->
vrp
.
obst
,
vrp_env_t
);
env
->
workqueue
=
new_
wait
q
();
env
->
workqueue
=
new_
pde
q
();
env
->
info
=
info
;
env
->
visited
=
bitset_malloc
(
get_irg_last_idx
(
irg
));
...
...
@@ -528,17 +528,17 @@ void set_vrp_data(ir_graph *irg)
free
(
env
->
visited
);
/* while there are entries in the worklist, continue*/
while
(
!
wait
q_empty
(
env
->
workqueue
))
{
ir_node
*
node
=
(
ir_node
*
)
wait
q_get
(
env
->
workqueue
);
while
(
!
pde
q_empty
(
env
->
workqueue
))
{
ir_node
*
node
=
(
ir_node
*
)
pde
q_get
l
(
env
->
workqueue
);
if
(
vrp_update_node
(
info
,
node
))
{
/* if something changed, add successors to worklist*/
foreach_irn_out_r
(
node
,
i
,
succ
)
{
wait
q_put
(
env
->
workqueue
,
succ
);
pde
q_put
r
(
env
->
workqueue
,
succ
);
}
}
}
del_
wait
q
(
env
->
workqueue
);
del_
pde
q
(
env
->
workqueue
);
}
void
free_vrp_data
(
ir_graph
*
irg
)
...
...
ir/be/becopyheur4.c
View file @
634770b1
...
...
@@ -674,20 +674,20 @@ static void expand_chunk_from(co_mst_env_t *env, co_mst_irn_t *node,
aff_chunk_t
*
orig_chunk
,
decide_func_t
*
decider
,
unsigned
col
)
{
wait
q
*
nodes
=
new_
wait
q
();
pde
q
*
nodes
=
new_
pde
q
();
DBG
((
dbg
,
LEVEL_1
,
"
\n\t
Expanding new chunk (#%u) from %+F, color %d:"
,
chunk
->
id
,
node
->
irn
,
col
));
/* init queue and chunk */
wait
q_put
(
nodes
,
node
);
pde
q_put
r
(
nodes
,
node
);
bitset_set
(
visited
,
get_irn_idx
(
node
->
irn
));
aff_chunk_add_node
(
chunk
,
node
);
DB
((
dbg
,
LEVEL_1
,
" %+F"
,
node
->
irn
));
/* as long as there are nodes in the queue */
while
(
!
wait
q_empty
(
nodes
))
{
co_mst_irn_t
*
n
=
(
co_mst_irn_t
*
)
wait
q_get
(
nodes
);
while
(
!
pde
q_empty
(
nodes
))
{
co_mst_irn_t
*
n
=
(
co_mst_irn_t
*
)
pde
q_get
l
(
nodes
);
affinity_node_t
*
an
=
get_affinity_info
(
env
->
co
,
n
->
irn
);
/* check all affinity neighbors */
...
...
@@ -713,14 +713,14 @@ static void expand_chunk_from(co_mst_env_t *env, co_mst_irn_t *node,
aff_chunk_add_node
(
chunk
,
n2
);
DB
((
dbg
,
LEVEL_1
,
" %+F"
,
n2
->
irn
));
/* enqueue for further search */
wait
q_put
(
nodes
,
n2
);
pde
q_put
r
(
nodes
,
n2
);
}
}
}
}
DB
((
dbg
,
LEVEL_1
,
"
\n
"
));
del_
wait
q
(
nodes
);
del_
pde
q
(
nodes
);
}
/**
...
...
@@ -728,7 +728,7 @@ static void expand_chunk_from(co_mst_env_t *env, co_mst_irn_t *node,
* color.
*/
static
aff_chunk_t
*
fragment_chunk
(
co_mst_env_t
*
env
,
unsigned
col
,
aff_chunk_t
*
c
,
wait
q
*
tmp
)
aff_chunk_t
*
c
,
pde
q
*
tmp
)
{
bitset_t
*
visited
=
bitset_malloc
(
get_irg_last_idx
(
env
->
co
->
irg
));
aff_chunk_t
*
best
=
NULL
;
...
...
@@ -752,7 +752,7 @@ static aff_chunk_t *fragment_chunk(co_mst_env_t *env, unsigned col,
/* create a new chunk starting at current node */
aff_chunk_t
*
tmp_chunk
=
new_aff_chunk
(
env
);
wait
q_put
(
tmp
,
tmp_chunk
);
pde
q_put
r
(
tmp
,
tmp_chunk
);
expand_chunk_from
(
env
,
node
,
visited
,
tmp_chunk
,
c
,
decider
,
col
);
assert
(
ARR_LEN
(
tmp_chunk
->
n
)
>
0
&&
"No nodes added to chunk"
);
...
...
@@ -1068,8 +1068,8 @@ static void color_aff_chunk(co_mst_env_t *env, aff_chunk_t *c)
* which one to take anyway.
* TODO Sebastian: Perhaps we should at all nodes and figure out
* a suitable color using costs as done above (determine_color_costs). */
waitq
*
tmp_chunks
=
new_
wait
q
();
waitq
*
best_starts
=
NULL
;
pdeq
*
tmp_chunks
=
new_
pde
q
();
pdeq
*
best_starts
=
NULL
;
unsigned
n_nodes
=
ARR_LEN
(
c
->
n
);
aff_chunk_t
*
best_chunk
=
NULL
;
int
best_color
=
-
1
;
...
...
@@ -1083,7 +1083,7 @@ static void color_aff_chunk(co_mst_env_t *env, aff_chunk_t *c)
/* try to bring all nodes of given chunk to the current color. */
unsigned
n_succeeded
=
0
;
waitq
*
good_starts
=
new_
wait
q
();
pdeq
*
good_starts
=
new_
pde
q
();
for
(
size_t
idx
=
0
,
len
=
ARR_LEN
(
c
->
n
);
idx
<
len
;
++
idx
)
{
const
ir_node
*
irn
=
c
->
n
[
idx
];
co_mst_irn_t
*
node
=
get_co_mst_irn
(
env
,
irn
);
...
...
@@ -1099,7 +1099,7 @@ static void color_aff_chunk(co_mst_env_t *env, aff_chunk_t *c)
bool
good
=
change_node_color
(
env
,
node
,
col
,
&
changed
);
stat_ev_tim_pop
(
"heur4_recolor"
);
if
(
good
)
{
wait
q_put
(
good_starts
,
node
);
pde
q_put
r
(
good_starts
,
node
);
materialize_coloring
(
&
changed
);
node
->
fixed
=
1
;
}
else
{
...
...
@@ -1118,7 +1118,7 @@ static void color_aff_chunk(co_mst_env_t *env, aff_chunk_t *c)
/* try next color when failed */
if
(
n_succeeded
==
0
)
{
del_
wait
q
(
good_starts
);
del_
pde
q
(
good_starts
);
continue
;
}
...
...
@@ -1137,15 +1137,15 @@ static void color_aff_chunk(co_mst_env_t *env, aff_chunk_t *c)
best_chunk
=
local_best
;
best_color
=
col
;
if
(
best_starts
)
del_
wait
q
(
best_starts
);
del_
pde
q
(
best_starts
);
best_starts
=
good_starts
;
DB
((
dbg
,
LEVEL_3
,
"
\n\t\t
... setting global best chunk (id %u), color %d
\n
"
,
best_chunk
->
id
,
best_color
));
}
else
{
DB
((
dbg
,
LEVEL_3
,
"
\n\t\t
... omitting, global best is better
\n
"
));
del_
wait
q
(
good_starts
);
del_
pde
q
(
good_starts
);
}
}
else
{
del_
wait
q
(
good_starts
);
del_
pde
q
(
good_starts
);
}
/* if all nodes were recolored, bail out */
...
...
@@ -1156,17 +1156,17 @@ static void color_aff_chunk(co_mst_env_t *env, aff_chunk_t *c)
stat_ev_int
(
"heur4_colors_tried"
,
i
);
/* free all intermediate created chunks except best one */
while
(
!
wait
q_empty
(
tmp_chunks
))
{
aff_chunk_t
*
tmp
=
(
aff_chunk_t
*
)
wait
q_get
(
tmp_chunks
);
while
(
!
pde
q_empty
(
tmp_chunks
))
{
aff_chunk_t
*
tmp
=
(
aff_chunk_t
*
)
pde
q_get
l
(
tmp_chunks
);
if
(
tmp
!=
best_chunk
)
delete_aff_chunk
(
tmp
);
}
del_
wait
q
(
tmp_chunks
);
del_
pde
q
(
tmp_chunks
);
/* return if coloring failed */
if
(
!
best_chunk
)
{
if
(
best_starts
)
del_
wait
q
(
best_starts
);
del_
pde
q
(
best_starts
);
return
;
}
...
...
@@ -1243,7 +1243,7 @@ static void color_aff_chunk(co_mst_env_t *env, aff_chunk_t *c)
delete_aff_chunk
(
best_chunk
);
free
(
visited
);
if
(
best_starts
)
del_
wait
q
(
best_starts
);
del_
pde
q
(
best_starts
);
stat_ev_ctx_pop
(
"heur4_color_chunk"
);
}
...
...
ir/be/bessaconstr.c
View file @
634770b1
...
...
@@ -153,7 +153,7 @@ static void introduce_use(be_ssa_construction_env_t *env, ir_node *use)
info
->
is_use
=
true
;
block_info
->
is_use
=
true
;
wait
q_put
(
env
->
worklist
,
use
);
pde
q_put
r
(
env
->
worklist
,
use
);
}
/**
...
...
@@ -166,8 +166,8 @@ static void mark_iterated_dominance_frontiers(
stat_ev_cnt_decl
(
blocks
);
DBG
((
dbg
,
LEVEL_3
,
"Dominance Frontier:"
));
stat_ev_tim_push
();
while
(
!
wait
q_empty
(
env
->
worklist
))
{
ir_node
*
block
=
(
ir_node
*
)
wait
q_get
(
env
->
worklist
);
while
(
!
pde
q_empty
(
env
->
worklist
))
{
ir_node
*
block
=
(
ir_node
*
)
pde
q_get
l
(
env
->
worklist
);
ir_node
**
domfront
=
ir_get_dominance_frontier
(
block
);
for
(
size_t
i
=
0
,
len
=
ARR_LEN
(
domfront
);
i
<
len
;
++
i
)
{
ir_node
*
y
=
domfront
[
i
];
...
...
@@ -175,7 +175,7 @@ static void mark_iterated_dominance_frontiers(
continue
;
if
(
!
irn_visited
(
y
))
wait
q_put
(
env
->
worklist
,
y
);
pde
q_put
r
(
env
->
worklist
,
y
);
DBG
((
dbg
,
LEVEL_3
,
" %+F"
,
y
));
mark_Block_block_visited
(
y
);
...
...
@@ -206,7 +206,7 @@ static ir_node *insert_dummy_phi(be_ssa_construction_env_t *env, ir_node *block)
DBG
((
dbg
,
LEVEL_2
,
"
\t
creating phi %+F in %+F
\n
"
,
phi
,
block
));
introduce_definition
(
env
,
phi
);
wait
q_put
(
env
->
worklist
,
phi
);
pde
q_put
r
(
env
->
worklist
,
phi
);
return
phi
;
}
...
...
@@ -359,7 +359,7 @@ void be_ssa_construction_init(be_ssa_construction_env_t *env, ir_graph *irg)
memset
(
env
,
0
,
sizeof
(
env
[
0
]));
env
->
irg
=
irg
;
env
->
new_phis
=
NEW_ARR_F
(
ir_node
*
,
0
);
env
->
worklist
=
new_
wait
q
();
env
->
worklist
=
new_
pde
q
();
ir_nodemap_init
(
&
env
->
infos
,
irg
);
obstack_init
(
&
env
->
obst
);
...
...
@@ -382,7 +382,7 @@ void be_ssa_construction_destroy(be_ssa_construction_env_t *env)
stat_ev_int
(
"bessaconstr_phis"
,
ARR_LEN
(
env
->
new_phis
));
obstack_free
(
&
env
->
obst
,
NULL
);
ir_nodemap_destroy
(
&
env
->
infos
);
del_
wait
q
(
env
->
worklist
);
del_
pde
q
(
env
->
worklist
);
DEL_ARR_F
(
env
->
new_phis
);
ir_free_resources
(
env
->
irg
,
IR_RESOURCE_IRN_VISITED
...
...
@@ -422,7 +422,7 @@ void be_ssa_construction_add_copy(be_ssa_construction_env_t *env,
ir_node
*
block
=
get_nodes_block
(
copy
);
if
(
!
has_definition
(
block
))
wait
q_put
(
env
->
worklist
,
block
);
pde
q_put
r
(
env
->
worklist
,
block
);
introduce_definition
(
env
,
copy
);
}
...
...
@@ -440,7 +440,7 @@ void be_ssa_construction_add_copies(be_ssa_construction_env_t *env,
assert
(
env
->
mode
==
get_irn_mode
(
copy
));
if
(
!
has_definition
(
block
))
{
wait
q_put
(
env
->
worklist
,
block
);
pde
q_put
r
(
env
->
worklist
,
block
);
}
introduce_definition
(
env
,
copy
);
}
...
...
@@ -497,7 +497,7 @@ void be_ssa_construction_fix_users_array(be_ssa_construction_env_t *env,
DBG
((
dbg
,
LEVEL_1
,
"
\t
fixing users array
\n
"
));
assert
(
wait
q_empty
(
env
->
worklist
));
assert
(
pde
q_empty
(
env
->
worklist
));
stat_ev_tim_push
();
...
...
@@ -516,8 +516,8 @@ void be_ssa_construction_fix_users_array(be_ssa_construction_env_t *env,
}
stat_ev_cnt_decl
(
uses
);
while
(
!
wait
q_empty
(
env
->
worklist
))
{
ir_node
*
use
=
(
ir_node
*
)
wait
q_get
(
env
->
worklist
);
while
(
!
pde
q_empty
(
env
->
worklist
))
{
ir_node
*
use
=
(
ir_node
*
)
pde
q_get
l
(
env
->
worklist
);
constr_info
*
info
=
get_info
(
env
,
use
);
if
(
info
->
already_processed
)
...
...
ir/be/bessaconstr.h
View file @
634770b1
...
...
@@ -45,7 +45,7 @@ typedef struct be_ssa_construction_env_t {
ir_graph
*
irg
;
ir_mode
*
mode
;
const
arch_register_req_t
*
phi_req
;
waitq
*
worklist
;
pdeq
*
worklist
;
ir_node
**
new_phis
;
bool
iterated_domfront_calculated
;
ir_nodemap
infos
;
...
...
ir/be/betranshlp.c
View file @
634770b1
...
...
@@ -36,8 +36,7 @@
#include
"util.h"
typedef
struct
be_transform_env_t
{
waitq
*
worklist
;
/**< worklist of nodes that still need to be
transformed */
pdeq
*
worklist
;
/**< worklist of nodes that still need to be transformed */
}
be_transform_env_t
;
static
be_transform_env_t
env
;
...
...
@@ -254,7 +253,7 @@ static void transform_nodes(ir_graph *irg, arch_pretrans_nodes *pre_transform)
inc_irg_visited
(
irg
);
env
.
worklist
=
new_
wait
q
();
env
.
worklist
=
new_
pde
q
();
ir_node
*
const
old_anchor
=
irg
->
anchor
;
ir_node
*
const
new_anchor
=
new_r_Anchor
(
irg
);
...
...
@@ -272,8 +271,8 @@ static void transform_nodes(ir_graph *irg, arch_pretrans_nodes *pre_transform)
pre_transform
(
irg
);
/* process worklist (this should transform all nodes in the graph) */
while
(
!
wait
q_empty
(
env
.
worklist
))
{
ir_node
*
node
=
(
ir_node
*
)
wait
q_get
(
env
.
worklist
);
while
(
!
pde
q_empty
(
env
.
worklist
))
{
ir_node
*
node
=
(
ir_node
*
)
pde
q_get
l
(
env
.
worklist
);
be_transform_node
(
node
);
}
...
...
@@ -283,7 +282,7 @@ static void transform_nodes(ir_graph *irg, arch_pretrans_nodes *pre_transform)
fix_loops
(
n
);
}
del_
wait
q
(
env
.
worklist
);
del_
pde
q
(
env
.
worklist
);
free_End
(
old_end
);
hook_dead_node_elim
(
irg
,
0
);
}
...
...
ir/be/ia32/ia32_finish.c
View file @
634770b1
...
...
@@ -369,8 +369,8 @@ static void ia32_finish_irg_walker(ir_node *block, void *env)
*/
static
void
ia32_push_on_queue_walker
(
ir_node
*
block
,
void
*
env
)
{
wait
q
*
wq
=
(
wait
q
*
)
env
;
wait
q_put
(
wq
,
block
);
pde
q
*
wq
=
(
pde
q
*
)
env
;
pde
q_put
r
(
wq
,
block
);
}
...
...
@@ -379,17 +379,17 @@ static void ia32_push_on_queue_walker(ir_node *block, void *env)
*/
void
ia32_finish_irg
(
ir_graph
*
irg
)
{
wait
q
*
wq
=
new_
wait
q
();
pde
q
*
wq
=
new_
pde
q
();
/* Push the blocks on the
wait
q because ia32_finish_irg_walker starts more
/* Push the blocks on the
pde
q because ia32_finish_irg_walker starts more
* walks ... */
irg_block_walk_graph
(
irg
,
NULL
,
ia32_push_on_queue_walker
,
wq
);
while
(
!
wait
q_empty
(
wq
))
{
ir_node
*
block
=
(
ir_node
*
)
wait
q_get
(
wq
);
while
(
!
pde
q_empty
(
wq
))
{
ir_node
*
block
=
(
ir_node
*
)
pde
q_get
l
(
wq
);
ia32_finish_irg_walker
(
block
,
NULL
);
}
del_
wait
q
(
wq
);
del_
pde
q
(
wq
);
}
void
ia32_init_finish
(
void
)
...
...
ir/be/ia32/ia32_x87.c
View file @
634770b1
...
...
@@ -103,7 +103,7 @@ struct x87_simulator {
be_lv_t
*
lv
;
/**< intrablock liveness. */
fp_liveness
*
live
;
/**< Liveness information. */
unsigned
n_idx
;
/**< The cached get_irg_last_idx() result. */
waitq
*
worklist
;
/**< Worklist of blocks that must be processed. */
pdeq
*
worklist
;
/**< Worklist of blocks that must be processed. */
};
/**
...
...
@@ -1399,7 +1399,7 @@ static void x87_simulate_block(x87_simulator *sim, ir_node *block)
DEBUG_ONLY
(
x87_dump_stack
(
state
);)
succ_state
->
begin
=
state
;
wait
q_put
(
sim
->
worklist
,
succ
);
pde
q_put
r
(
sim
->
worklist
,
succ
);
}
else
{
DB
((
dbg
,
LEVEL_2
,
"succ %+F already has a state, shuffling
\n
"
,
succ
));
/* There is already a begin state for the successor, bad.
...
...
@@ -1516,8 +1516,8 @@ void ia32_x87_simulate_graph(ir_graph *irg)
x87_state
const
empty
=
{
.
sim
=
&
sim
};
bl_state
->
begin
=
&
empty
;
sim
.
worklist
=
new_
wait
q
();
wait
q_put
(
sim
.
worklist
,
start_block
);
sim
.
worklist
=
new_
pde
q
();
pde
q_put
r
(
sim
.
worklist
,
start_block
);
be_assure_live_sets
(
irg
);
sim
.
lv
=
be_get_irg_liveness
(
irg
);
...
...
@@ -1532,12 +1532,12 @@ void ia32_x87_simulate_graph(ir_graph *irg)
/* iterate */
do
{
ir_node
*
block
=
(
ir_node
*
)
wait
q_get
(
sim
.
worklist
);
ir_node
*
block
=
(
ir_node
*
)
pde
q_get
l
(
sim
.
worklist
);
x87_simulate_block
(
&
sim
,
block
);
}
while
(
!
wait
q_empty
(
sim
.
worklist
));
}
while
(
!
pde
q_empty
(
sim
.
worklist
));
/* kill it */
del_
wait
q
(
sim
.
worklist
);
del_
pde
q
(
sim
.
worklist
);
x87_destroy_simulator
(
&
sim
);
}
...
...
ir/opt/code_placement.c
View file @
634770b1
...
...
@@ -42,7 +42,7 @@ static bool is_block_reachable(ir_node *block)
* this may still be a dead block, but then there is no real use, as
* the control flow will be dead later.
*/
static
void
place_floats_early
(
ir_node
*
n
,
wait
q
*
worklist
)
static
void
place_floats_early
(
ir_node
*
n
,
pde
q
*
worklist
)
{
/* we must not run into an infinite loop */
if
(
irn_visited_else_mark
(
n
))
...
...
@@ -101,7 +101,7 @@ static void place_floats_early(ir_node *n, waitq *worklist)
*
* @param worklist a worklist, used for the algorithm, empty on in/output
*/
static
void
place_early
(
ir_graph
*
irg
,
wait
q
*
worklist
)
static
void
place_early
(
ir_graph
*
irg
,
pde
q
*
worklist
)
{
assert
(
worklist
);
inc_irg_visited
(
irg
);
...
...
@@ -110,8 +110,8 @@ static void place_early(ir_graph *irg, waitq *worklist)
place_floats_early
(
get_irg_end
(
irg
),
worklist
);
/* Work the content of the worklist. */
while
(
!
wait
q_empty
(
worklist
))
{
ir_node
*
n
=
(
ir_node
*
)
wait
q_get
(
worklist
);
while
(
!
pde
q_empty
(
worklist
))
{
ir_node
*
n
=
(
ir_node
*
)
pde
q_get
l
(
worklist
);
if
(
!
irn_visited
(
n
))
place_floats_early
(
n
,
worklist
);
}
...
...
@@ -310,7 +310,7 @@ static void place_floats_late(ir_node *n, pdeq *worklist)
*
* @param worklist the worklist containing the nodes to place
*/
static
void
place_late
(
ir_graph
*
irg
,
wait
q
*
worklist
)
static
void
place_late
(
ir_graph
*
irg
,
pde
q
*
worklist
)
{
assert
(
worklist
);
inc_irg_visited
(
irg
);
...
...
@@ -319,8 +319,8 @@ static void place_late(ir_graph *irg, waitq *worklist)
place_floats_late
(
get_irg_start_block
(
irg
),
worklist
);
/* And now empty the worklist again... */
while
(
!
wait
q_empty
(
worklist
))
{
ir_node
*
n
=
(
ir_node
*
)
wait
q_get
(
worklist
);
while
(
!
pde
q_empty
(
worklist
))
{
ir_node
*
n
=
(
ir_node
*
)
pde
q_get
l
(
worklist
);
if
(
!
irn_visited
(
n
))
place_floats_late
(
n
,
worklist
);
}
...
...
@@ -339,7 +339,7 @@ void place_code(ir_graph *irg)
/* Place all floating nodes as early as possible. This guarantees
a legal code placement. */
wait
q
*
worklist
=
new_
wait
q
();
pde
q
*
worklist
=
new_
pde
q
();
place_early
(
irg
,
worklist
);
/* While GCSE might place nodes in unreachable blocks,
...
...
@@ -352,6 +352,6 @@ void place_code(ir_graph *irg)
unnecessary executions of the node. */
place_late
(
irg
,
worklist
);
del_
wait
q
(
worklist
);
del_
pde
q
(
worklist
);
confirm_irg_properties
(
irg
,
IR_GRAPH_PROPERTIES_CONTROL_FLOW
);
}
ir/opt/opt_osr.c
View file @
634770b1
...
...
@@ -403,10 +403,10 @@ static void update_scc(ir_node *iv, node_entry *e, iv_env *env)
scc
*
pscc
=
e
->
pscc
;
ir_node
*
header
=
e
->
header
;
pscc
->
head
=
NULL
;
wait
q
*
wq
=
new_
wait
q
();
wait
q_put
(
wq
,
iv
);
pde
q
*
wq
=
new_
pde
q
();
pde
q_put
r
(
wq
,
iv
);
do
{
ir_node
*
irn
=
(
ir_node
*
)
wait
q_get
(
wq
);
ir_node
*
irn
=
(
ir_node
*
)
pde
q_get
l
(
wq
);
node_entry
*
ne
=
get_irn_ne
(
irn
,
env
);
ne
->
pscc
=
pscc
;
...
...
@@ -420,11 +420,11 @@ static void update_scc(ir_node *iv, node_entry *e, iv_env *env)
if
(
pe
->
header
==
header
&&
pe
->
pscc
==
NULL
)
{
/* set the pscc here to ensure that the node is NOT enqueued another time */
pe
->
pscc
=
pscc
;
wait
q_put
(
wq
,
pred
);
pde
q_put
r
(
wq
,
pred
);
}
}
}
while
(
!
wait
q_empty
(
wq
));
del_
wait
q
(
wq
);
}
while
(
!
pde
q_empty
(
wq
));
del_
pde
q
(
wq
);
DB
((
dbg
,
LEVEL_2
,
"
\n
"
));
}
...
...
ir/opt/reassoc.c
View file @
634770b1
...
...
@@ -262,11 +262,11 @@ static int reassoc_commutative(ir_node **node)
*/
static
void
wq_walker
(
ir_node
*
n
,
void
*
env
)
{
wait
q
*
const
wq
=
(
waitq
*
)
env
;
pde
q
*
const
wq
=
(
pdeq
*
)
env
;
set_irn_link
(
n
,
NULL
);
if
(
!
is_Block
(
n
))
{
wait
q_put
(
wq
,
n
);
pde
q_put
r
(
wq
,
n
);
set_irn_link
(
n
,
wq
);
}
}
...
...
@@ -274,10 +274,10 @@ static void wq_walker(ir_node *n, void *env)
/**
* The walker for the reassociation.
*/
static
void
do_reassociation
(
wait
q
*
const
wq
)
static
void
do_reassociation
(
pde
q
*
const
wq
)
{
while
(
!
wait
q_empty
(
wq
))
{
ir_node
*
n
=
(
ir_node
*
)
wait
q_get
(
wq
);
while
(
!
pde
q_empty
(
wq
))
{
ir_node
*
n
=
(
ir_node
*
)
pde
q_get
l
(
wq
);
set_irn_link
(
n
,
NULL
);
hook_reassociate
(
1
);
...
...
@@ -305,7 +305,7 @@ static void do_reassociation(waitq *const wq)
if
(
changed
)
{
foreach_irn_in_r
(
n
,
i
,
pred
)
{
if
(
get_irn_link
(
pred
)
!=
wq
)
{
wait
q_put
(
wq
,
pred
);
pde
q_put
r
(
wq
,
pred
);
set_irn_link
(
pred
,
wq
);
}
}
...
...
@@ -2036,14 +2036,14 @@ static bool walk_chains(ir_node *node)
*/
static
void
do_chaining
(
ir_graph
*
irg
)
{
wait
q
*
const
wq
=
new_
wait
q
();
pde
q
*
const
wq
=
new_
pde
q
();
/* now we have collected enough information, optimize */
ir_reserve_resources
(
irg
,
IR_RESOURCE_IRN_LINK
);
irg_walk_graph
(
irg
,
NULL
,
wq_walker
,
wq
);
while
(
!
wait
q_empty
(
wq
))
{
ir_node
*
n
=
(
ir_node
*
)
wait
q_get
(
wq
);
while
(
!
pde
q_empty
(
wq
))
{
ir_node
*
n
=
(
ir_node
*
)
pde
q_get
l
(
wq
);
set_irn_link
(
n
,
NULL
);
hook_reassociate
(
1
);
...
...
@@ -2066,7 +2066,7 @@ static void do_chaining(ir_graph *irg)
if
(
changed
)
{
foreach_irn_in_r
(
n
,
i
,
pred
)
{
if
(
get_irn_link
(
pred
)
!=
wq
)
{
wait
q_put
(
wq
,
pred
);
pde
q_put
r
(
wq
,
pred
);
set_irn_link
(
pred
,
wq
);
}
}
...
...
@@ -2074,7 +2074,7 @@ static void do_chaining(ir_graph *irg)
}
ir_free_resour