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
75bdba69
Commit
75bdba69
authored
Jun 13, 2007
by
Matthias Braun
Browse files
fixed the fix of the fix (that was fix)
[r14462]
parent
e15091dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/opt/ldstopt.c
View file @
75bdba69
...
...
@@ -1063,18 +1063,18 @@ static unsigned optimize_phi(ir_node *phi, walk_env_t *wenv)
first because we otherwise may loose a store when exchanging its
memory Proj.
*/
for
(
i
=
0
;
i
<
n
;
++
i
)
for
(
i
=
n
-
1
;
i
>=
0
;
--
i
)
{
ir_node
*
store
;
projMs
[
i
]
=
get_Phi_pred
(
phi
,
i
);
assert
(
is_Proj
(
projMs
[
i
]));
/* first step: collect all inputs and kill the node */
for
(
i
=
n
-
1
;
i
>=
0
;
--
i
)
{
ir_node
*
store
=
get_Proj_pred
(
projMs
[
i
]);
info
=
get_irn_link
(
store
);
store
=
get_Proj_pred
(
projMs
[
i
]);
info
=
get_irn_link
(
store
);
inM
[
i
]
=
get_Store_mem
(
store
);
inD
[
i
]
=
get_Store_value
(
store
);
idx
[
i
]
=
info
->
exc_idx
;
kill_node
(
store
);
}
block
=
get_nodes_block
(
phi
);
...
...
@@ -1084,11 +1084,15 @@ static unsigned optimize_phi(ir_node *phi, walk_env_t *wenv)
/* third step: create a new data Phi */
phiD
=
new_rd_Phi
(
get_irn_dbg_info
(
phi
),
current_ir_graph
,
block
,
n
,
inD
,
mode
);
/* rewire memory */
/* rewire memory
and kill the node
*/
for
(
i
=
n
-
1
;
i
>=
0
;
--
i
)
{
ir_node
*
proj
=
projMs
[
i
];
ir_node
*
proj
=
projMs
[
i
];
exchange
(
proj
,
inM
[
i
]);
if
(
is_Proj
(
proj
))
{
ir_node
*
store
=
get_Proj_pred
(
proj
);
exchange
(
proj
,
inM
[
i
]);
kill_node
(
store
);
}
}
/* fourth step: create the Store */
...
...
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