summaryrefslogtreecommitdiffhomepage
path: root/ir/lower
diff options
context:
space:
mode:
authorSebastian Buchwald <Sebastian.Buchwald@kit.edu>2016-07-29 23:10:31 +0200
committerSebastian Buchwald <Sebastian.Buchwald@kit.edu>2016-07-29 23:23:31 +0200
commit006764a926b7e19fd33b0eef1cf90f08238e72ed (patch)
treef9f3305c8f0f86be2696563ecdc93e007ea983f9 /ir/lower
parent2bcc27daf6c9c8559d093a09ab5b422321fb7662 (diff)
Transform Return nodes before parameters
Return nodes can now access the frame type to decide whether a constructed CopyB node should be volatile.
Diffstat (limited to 'ir/lower')
-rw-r--r--ir/lower/lower_calls.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/ir/lower/lower_calls.c b/ir/lower/lower_calls.c
index ed012c7..1a9173a 100644
--- a/ir/lower/lower_calls.c
+++ b/ir/lower/lower_calls.c
@@ -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);