diff options
author | vries <vries@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-05-30 08:43:05 +0000 |
---|---|---|
committer | vries <vries@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-05-30 08:43:05 +0000 |
commit | f2cc6708f2348577cc886ffdf648a817d193a964 (patch) | |
tree | bf5a31454d3701aa688b9681b11ee36cdfa0438f /gcc/lra.c | |
parent | def44e012535109b987ad98162e1aca5b9c658d8 (diff) | |
download | gcc-f2cc6708f2348577cc886ffdf648a817d193a964.tar.gz |
-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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211074 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lra.c')
-rw-r--r-- | gcc/lra.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/gcc/lra.c b/gcc/lra.c index ecec8908ca9..d199a813fbe 100644 --- a/gcc/lra.c +++ b/gcc/lra.c @@ -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. */ |