diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2019-09-30 16:20:56 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2019-09-30 16:20:56 +0000 |
commit | 5c64181d62bb816b8c2c91e251cee7e2b597f244 (patch) | |
tree | ea59ccb17df7d0341fee51fa3f2ded631a6881ee | |
parent | 6c47622219d6386807b26890dcdc84f192499d33 (diff) | |
download | gcc-5c64181d62bb816b8c2c91e251cee7e2b597f244.zip gcc-5c64181d62bb816b8c2c91e251cee7e2b597f244.tar.gz gcc-5c64181d62bb816b8c2c91e251cee7e2b597f244.tar.bz2 |
Remove global call sets: loop-iv.c
Similar idea to the combine.c and gcse.c patches.
2019-09-30 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* loop-iv.c: Include regs.h and function-abi.h.
(simplify_using_initial_values): Use insn_callee_abi to get the
ABI of the call insn target. Conservatively assume that
partially-clobbered registers are altered.
From-SVN: r276326
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/loop-iv.c | 12 |
2 files changed, 17 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c0454ce..1129ec5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,12 @@ 2019-09-30 Richard Sandiford <richard.sandiford@arm.com> + * loop-iv.c: Include regs.h and function-abi.h. + (simplify_using_initial_values): Use insn_callee_abi to get the + ABI of the call insn target. Conservatively assume that + partially-clobbered registers are altered. + +2019-09-30 Richard Sandiford <richard.sandiford@arm.com> + * function-abi.h (call_clobbers_in_region): Declare. (call_clobbered_in_region_p): New function. * function-abi.cc (call_clobbers_in_region): Likewise. diff --git a/gcc/loop-iv.c b/gcc/loop-iv.c index 33be75a..d0e6994 100644 --- a/gcc/loop-iv.c +++ b/gcc/loop-iv.c @@ -62,6 +62,8 @@ along with GCC; see the file COPYING3. If not see #include "dumpfile.h" #include "rtl-iter.h" #include "tree-ssa-loop-niter.h" +#include "regs.h" +#include "function-abi.h" /* Possible return values of iv_get_reaching_def. */ @@ -1972,8 +1974,14 @@ simplify_using_initial_values (class loop *loop, enum rtx_code op, rtx *expr) CLEAR_REG_SET (this_altered); note_stores (insn, mark_altered, this_altered); if (CALL_P (insn)) - /* Kill all call clobbered registers. */ - IOR_REG_SET_HRS (this_altered, regs_invalidated_by_call); + { + /* Kill all registers that might be clobbered by the call. + We don't track modes of hard registers, so we need to be + conservative and assume that partial kills are full kills. */ + function_abi callee_abi = insn_callee_abi (insn); + IOR_REG_SET_HRS (this_altered, + callee_abi.full_and_partial_reg_clobbers ()); + } if (suitable_set_for_replacement (insn, &dest, &src)) { |