diff options
author | Radovan Obradovic <robradovic@mips.com> | 2014-05-28 09:43:21 +0000 |
---|---|---|
committer | Tom de Vries <vries@gcc.gnu.org> | 2014-05-28 09:43:21 +0000 |
commit | c2ba7e7a62c63106e1e811d31b27df26bdae0169 (patch) | |
tree | 3fd6226eae59256645e73f80df2f379d2a822117 /gcc/resource.c | |
parent | 27c07cc5d06c0f74d147c14c6a4b0b071266e774 (diff) | |
download | gcc-c2ba7e7a62c63106e1e811d31b27df26bdae0169.zip gcc-c2ba7e7a62c63106e1e811d31b27df26bdae0169.tar.gz gcc-c2ba7e7a62c63106e1e811d31b27df26bdae0169.tar.bz2 |
-fuse-caller-save - Use collected register usage information
2014-05-28 Radovan Obradovic <robradovic@mips.com>
Tom de Vries <tom@codesourcery.com>
* df-scan.c (df_get_call_refs): Use get_call_reg_set_usage.
* caller-save.c (setup_save_areas, save_call_clobbered_regs): Use
get_call_reg_set_usage.
* resource.c (mark_set_resources, mark_target_live_regs): Use
get_call_reg_set_usage.
* ira-int.h (struct ira_allocno): Add crossed_calls_clobbered_regs
field.
(ALLOCNO_CROSSED_CALLS_CLOBBERED_REGS): Define.
* ira-lives.c (process_bb_node_lives): Use get_call_reg_set_usage.
Calculate ALLOCNO_CROSSED_CALLS_CLOBBERED_REGS.
* ira-build.c (ira_create_allocno): Init
ALLOCNO_CROSSED_CALLS_CLOBBERED_REGS.
(create_cap_allocno, propagate_allocno_info)
(propagate_some_info_from_allocno)
(copy_info_to_removed_store_destinations): Handle
ALLOCNO_CROSSED_CALLS_CLOBBERED_REGS.
* ira-costs.c (ira_tune_allocno_costs): Use
ALLOCNO_CROSSED_CALLS_CLOBBERED_REGS to adjust costs.
Co-Authored-By: Tom de Vries <tom@codesourcery.com>
From-SVN: r211007
Diffstat (limited to 'gcc/resource.c')
-rw-r--r-- | gcc/resource.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/resource.c b/gcc/resource.c index aed00ed..b555682 100644 --- a/gcc/resource.c +++ b/gcc/resource.c @@ -655,10 +655,12 @@ mark_set_resources (rtx x, struct resources *res, int in_dest, if (mark_type == MARK_SRC_DEST_CALL) { rtx link; + HARD_REG_SET regs; res->cc = res->memory = 1; - IOR_HARD_REG_SET (res->regs, regs_invalidated_by_call); + get_call_reg_set_usage (x, ®s, regs_invalidated_by_call); + IOR_HARD_REG_SET (res->regs, regs); for (link = CALL_INSN_FUNCTION_USAGE (x); link; link = XEXP (link, 1)) @@ -1011,11 +1013,15 @@ mark_target_live_regs (rtx insns, rtx target, struct resources *res) predicated instruction, or if the CALL is NORETURN. */ if (GET_CODE (PATTERN (real_insn)) != COND_EXEC) { + HARD_REG_SET regs_invalidated_by_this_call; + get_call_reg_set_usage (real_insn, + ®s_invalidated_by_this_call, + regs_invalidated_by_call); /* CALL clobbers all call-used regs that aren't fixed except sp, ap, and fp. Do this before setting the result of the call live. */ AND_COMPL_HARD_REG_SET (current_live_regs, - regs_invalidated_by_call); + regs_invalidated_by_this_call); } /* A CALL_INSN sets any global register live, since it may |