Commit 006764a9 authored by yb9976's avatar yb9976
Browse files

Transform Return nodes before parameters

Return nodes can now access the frame type to decide whether
a constructed CopyB node should be volatile.
parent 2bcc27da
......@@ -920,6 +920,17 @@ static void transform_irg(lowering_env_t const *const env, ir_graph *const irg)
irg_walk_graph(irg, firm_clear_link, NULL, &walk_env);
irg_walk_graph(irg, fix_args_and_collect_calls, NULL, &walk_env);
/* transform return nodes */
if (n_ret_com > 0) {
ir_node *endbl = get_irg_end_block(irg);
foreach_irn_in(endbl, i, pred) {
if (is_Return(pred)) {
transform_return(pred, n_ret_com, &walk_env);
break;
}
}
}
/* fix parameter sels */
ir_node *args = get_irg_args(irg);
for (size_t i = 0, n = ARR_LEN(walk_env.param_members); i < n; ++i) {
......@@ -938,17 +949,6 @@ static void transform_irg(lowering_env_t const *const env, ir_graph *const irg)
fix_calls(&walk_env);
ir_free_resources(irg, IR_RESOURCE_IRN_LINK);
/* transform return nodes */
if (n_ret_com > 0) {
ir_node *endbl = get_irg_end_block(irg);
foreach_irn_in(endbl, i, pred) {
if (is_Return(pred)) {
transform_return(pred, n_ret_com, &walk_env);
break;
}
}
}
if (walk_env.heights != NULL)
heights_free(walk_env.heights);
obstack_free(&walk_env.obst, NULL);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment