diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2016-09-13 13:33:37 +0100 |
---|---|---|
committer | Richard Sandiford <richard.sandiford@linaro.org> | 2017-06-07 16:08:33 +0100 |
commit | ea6b25c3216451d387b4be53c3e025f37c235b5d (patch) | |
tree | 02f4ea51fdc9cda3845d041aa3cb79cbe0a54010 /gcc/caller-save.c | |
parent | 44e1932844988ce9ea75a4fed40ed735625a2f4a (diff) | |
download | gcc-ea6b25c3216451d387b4be53c3e025f37c235b5d.tar.gz |
Add a partial_subreg_p predicate
This patch adds a partial_subreg_p predicate to go alongside
paradoxical_subreg_p.
The first two changes to cse_insn preserve the current behaviour,
but the condition seems strange. Shouldn't we be able to continue
to cse if the inner modes of the two subregs have the same size?
The patch also preserves the existing condition in
simplify_operand_subreg, but perhaps it should be using
a df_read_modify_subreg_p-style check instead. We don't
need to reload the inner value first if the inner value
is no bigger than a word, for example.
The use in curr_insn_transform also seemed strange. Surely the
modes of the SET_DEST and SET_SRC will be the same?
Like the paradoxical_subreg_p patch, this one replaces
some tests that were based on GET_MODE_SIZE rather than
GET_MODE_PRECISION. In each case the change should be
a no-op or an improvement.
Some of the places changed here are tracking the widest
access mode found for a register. The series tries to
standardise on:
if (partial_mode_p (widest_seen, new_mode))
widest_seen = new_mode;
rather than:
if (paradoxical_subreg_p (new_mode, widest_seen))
widest_seen = new_mode;
Either would have been OK.
Diffstat (limited to 'gcc/caller-save.c')
-rw-r--r-- | gcc/caller-save.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/gcc/caller-save.c b/gcc/caller-save.c index 27da129ab9c..65a498d0d0c 100644 --- a/gcc/caller-save.c +++ b/gcc/caller-save.c @@ -837,8 +837,7 @@ save_call_clobbered_regs (void) nregs = hard_regno_nregs[r][PSEUDO_REGNO_MODE (regno)]; mode = HARD_REGNO_CALLER_SAVE_MODE (r, nregs, PSEUDO_REGNO_MODE (regno)); - if (GET_MODE_BITSIZE (mode) - > GET_MODE_BITSIZE (save_mode[r])) + if (partial_subreg_p (save_mode[r], mode)) save_mode[r] = mode; while (nregs-- > 0) SET_HARD_REG_BIT (hard_regs_to_save, r + nregs); |