diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2019-09-30 16:39:38 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2019-09-30 16:39:38 +0000 |
commit | 6d1e98dfd2bfce30640d71df355bedf114229744 (patch) | |
tree | 4fd650f51b146fd95f2345a09063f202a8768f53 /gcc/function-abi.h | |
parent | 7c3958812bd5e2e139c7f0adf8f03b505fda67f2 (diff) | |
download | gcc-6d1e98dfd2bfce30640d71df355bedf114229744.zip gcc-6d1e98dfd2bfce30640d71df355bedf114229744.tar.gz gcc-6d1e98dfd2bfce30640d71df355bedf114229744.tar.bz2 |
Make ira call df_set_regs_ever_live for extra call-clobbered regs
If we support multiple ABIs in the same translation unit, it can
sometimes be the case that a callee clobbers more registers than
its caller is allowed to. We need to call df_set_regs_ever_live
on these extra registers so that the prologue and epilogue code
can handle them appropriately.
This patch does that in IRA. I wanted to avoid another full
instruction walk just for this, so I combined it with the existing
set_paradoxical_subreg walk. This happens before the first
calculation of elimination offsets.
2019-09-30 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* function-abi.h (function_abi_aggregator): New class.
* function-abi.cc (function_abi_aggregator::caller_save_regs): New
function.
* ira.c (update_equiv_regs_prescan): New function. Call
set_paradoxical_subreg here rather than...
(update_equiv_regs): ...here.
(ira): Call update_equiv_regs_prescan.
From-SVN: r276339
Diffstat (limited to 'gcc/function-abi.h')
-rw-r--r-- | gcc/function-abi.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/function-abi.h b/gcc/function-abi.h index 8dd139e..9bb4d17 100644 --- a/gcc/function-abi.h +++ b/gcc/function-abi.h @@ -208,6 +208,27 @@ protected: HARD_REG_SET m_mask; }; +/* This class collects information about the ABIs of functions that are + called in a particular region of code. It is mostly intended to be + used as a local variable during an IR walk. */ +class function_abi_aggregator +{ +public: + function_abi_aggregator () : m_abi_clobbers () {} + + /* Record that the code region calls a function with the given ABI. */ + void + note_callee_abi (const function_abi &abi) + { + m_abi_clobbers[abi.id ()] |= abi.full_and_partial_reg_clobbers (); + } + + HARD_REG_SET caller_save_regs (const function_abi &) const; + +private: + HARD_REG_SET m_abi_clobbers[NUM_ABI_IDS]; +}; + struct target_function_abi_info { /* An array of all the target ABIs that are available in this |