diff options
author | Tom de Vries <tom@codesourcery.com> | 2014-05-30 08:43:05 +0000 |
---|---|---|
committer | Tom de Vries <vries@gcc.gnu.org> | 2014-05-30 08:43:05 +0000 |
commit | 10e1bdb2723bfd322516ebf76432b6f927a478e2 (patch) | |
tree | bf5a31454d3701aa688b9681b11ee36cdfa0438f /gcc/lra.c | |
parent | 569120372d8b1c3cd1e0b867c686e250872f760e (diff) | |
download | gcc-10e1bdb2723bfd322516ebf76432b6f927a478e2.zip gcc-10e1bdb2723bfd322516ebf76432b6f927a478e2.tar.gz gcc-10e1bdb2723bfd322516ebf76432b6f927a478e2.tar.bz2 |
-fuse-caller-save - Support in lra
2014-05-30 Tom de Vries <tom@codesourcery.com>
* lra-int.h (struct lra_reg): Add field actual_call_used_reg_set.
* lra.c (initialize_lra_reg_info_element): Add init of
actual_call_used_reg_set field.
(lra): Call lra_create_live_ranges before lra_inheritance for
-fuse-caller-save.
* lra-assigns.c (lra_assign): Allow call_used_regs to cross calls for
-fuse-caller-save.
* lra-constraints.c (need_for_call_save_p): Use actual_call_used_reg_set
instead of call_used_reg_set for -fuse-caller-save.
* lra-lives.c (process_bb_lives): Calculate actual_call_used_reg_set.
From-SVN: r211074
Diffstat (limited to 'gcc/lra.c')
-rw-r--r-- | gcc/lra.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -1427,6 +1427,7 @@ initialize_lra_reg_info_element (int i) lra_reg_info[i].no_stack_p = false; #endif CLEAR_HARD_REG_SET (lra_reg_info[i].conflict_hard_regs); + CLEAR_HARD_REG_SET (lra_reg_info[i].actual_call_used_reg_set); lra_reg_info[i].preferred_hard_regno1 = -1; lra_reg_info[i].preferred_hard_regno2 = -1; lra_reg_info[i].preferred_hard_regno_profit1 = 0; @@ -2344,7 +2345,18 @@ lra (FILE *f) lra_eliminate (false, false); /* Do inheritance only for regular algorithms. */ if (! lra_simple_p) - lra_inheritance (); + { + if (flag_use_caller_save) + { + if (live_p) + lra_clear_live_ranges (); + /* As a side-effect of lra_create_live_ranges, we calculate + actual_call_used_reg_set, which is needed during + lra_inheritance. */ + lra_create_live_ranges (true); + } + lra_inheritance (); + } if (live_p) lra_clear_live_ranges (); /* We need live ranges for lra_assign -- so build them. */ |