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
59a6e0a2
Commit
59a6e0a2
authored
Jun 19, 2009
by
Matthias Braun
Browse files
- Get rid of the infamous Start->ProjX->Start backedge
[r26162]
parent
54c484d6
Changes
2
Hide whitespace changes
Inline
Side-by-side
ir/ana/irouts.c
View file @
59a6e0a2
...
...
@@ -420,32 +420,6 @@ static ir_def_use_edge *set_out_edges(ir_graph *irg, ir_def_use_edge *free) {
return
free
;
}
/**
* We want that the out of ProjX from Start contains the next block at
* position 0, the Start block at position 1. This is necessary for
* the out block walker.
*/
static
inline
void
fix_start_proj
(
ir_graph
*
irg
)
{
ir_node
*
startbl
=
get_irg_start_block
(
irg
);
if
(
get_Block_n_cfg_outs
(
startbl
))
{
ir_node
*
proj
=
get_irg_initial_exec
(
irg
);
ir_node
*
irn
;
int
block_pos
,
other_pos
;
if
(
get_irn_n_outs
(
proj
)
==
2
)
{
if
(
get_irn_out_ex
(
proj
,
0
,
&
block_pos
)
==
startbl
)
{
irn
=
get_irn_out_ex
(
proj
,
1
,
&
other_pos
);
set_irn_out
(
proj
,
0
,
irn
,
other_pos
);
set_irn_out
(
proj
,
1
,
startbl
,
block_pos
);
}
}
else
{
assert
(
get_irg_phase_state
(
irg
)
==
phase_backend
);
}
}
}
/* compute the outs for a given graph */
void
compute_irg_outs
(
ir_graph
*
irg
)
{
ir_graph
*
rem
=
current_ir_graph
;
...
...
@@ -477,11 +451,6 @@ void compute_irg_outs(ir_graph *irg) {
/* Check how much memory we have used */
assert
(
end
==
(
irg
->
outs
+
n_out_edges
));
/* We want that the out of ProjX from Start contains the next block at
position 0, the Start block at position 1. This is necessary for
code placement (place_early() ONLY if started GCSE on graphs with dead blocks) */
fix_start_proj
(
irg
);
current_ir_graph
->
outs_state
=
outs_consistent
;
current_ir_graph
=
rem
;
}
...
...
ir/ir/irgraph.c
View file @
59a6e0a2
...
...
@@ -262,7 +262,6 @@ ir_graph *new_r_ir_graph(ir_entity *ent, int n_loc) {
initial_mem
=
new_Proj
(
start
,
mode_M
,
pn_Start_M
);
set_irg_initial_mem
(
res
,
initial_mem
);
add_immBlock_pred
(
start_block
,
projX
);
set_store
(
initial_mem
);
res
->
index
=
get_irp_new_irg_idx
();
...
...
@@ -270,11 +269,6 @@ ir_graph *new_r_ir_graph(ir_entity *ent, int n_loc) {
res
->
graph_nr
=
get_irp_new_node_nr
();
#endif
/*
* The code generation needs it. leave it in now.
* Use of this edge is matter of discussion, unresolved. Also possible:
* add_immBlock_pred(res->start_block, res->start_block), but invalid typed.
*/
mature_immBlock
(
res
->
current_block
);
/*-- Make a block to start with --*/
...
...
@@ -358,7 +352,6 @@ ir_graph *new_const_code_irg(void)
/* Proj results of start node */
set_irg_initial_mem
(
res
,
new_Proj
(
start
,
mode_M
,
pn_Start_M
));
projX
=
new_Proj
(
start
,
mode_X
,
pn_Start_X_initial_exec
);
add_immBlock_pred
(
start_block
,
projX
);
mature_immBlock
(
start_block
);
body_block
=
new_immBlock
();
...
...
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