diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2017-08-30 15:28:18 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2017-08-30 15:28:18 +0000 |
commit | 33845ca96bdaa9510cfb041540a45c3e8be6c477 (patch) | |
tree | bc69488d125557e352f5d02d91a2fdac5505faa3 /gcc/rtlanal.c | |
parent | bd4288c02b487cc8a9afcfa9c21bfe594a78e26d (diff) | |
download | gcc-33845ca96bdaa9510cfb041540a45c3e8be6c477.zip gcc-33845ca96bdaa9510cfb041540a45c3e8be6c477.tar.gz gcc-33845ca96bdaa9510cfb041540a45c3e8be6c477.tar.bz2 |
Drop df_ from df_read_modify_subreg_p
...it's really a general RTL predicate, rather than something that depends
on the DF state. Thanks to Segher for the suggestion.
2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
gcc/
* df.h (df_read_modify_subreg_p): Remove in favor of...
* rtl.h (read_modify_subreg_p): ...this new function. Take a
const_rtx instead of an rtx.
* cprop.c (local_cprop_find_used_regs): Update accordingly.
* df-problems.c (df_word_lr_mark_ref): Likewise.
* ira-lives.c (mark_pseudo_reg_live): Likewise.
(mark_pseudo_reg_dead): Likewise.
(mark_ref_dead): Likewise.
* reginfo.c (init_subregs_of_mode): Likewise.
* sched-deps.c (sched_analyze_1): Likewise.
* df-scan.c (df_def_record_1): Likewise.
(df_uses_record): Likewise.
(df_read_modify_subreg_p): Remove in favor of...
* rtlanal.c (read_modify_subreg_p): ...this new function. Take a
const_rtx instead of an rtx.
From-SVN: r251537
Diffstat (limited to 'gcc/rtlanal.c')
-rw-r--r-- | gcc/rtlanal.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index e648367..3ae06e4 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -1358,6 +1358,23 @@ modified_in_p (const_rtx x, const_rtx insn) return 0; } + +/* Return true if X is a SUBREG and if storing a value to X would + preserve some of its SUBREG_REG. For example, on a normal 32-bit + target, using a SUBREG to store to one half of a DImode REG would + preserve the other half. */ + +bool +read_modify_subreg_p (const_rtx x) +{ + unsigned int isize, osize; + if (GET_CODE (x) != SUBREG) + return false; + isize = GET_MODE_SIZE (GET_MODE (SUBREG_REG (x))); + osize = GET_MODE_SIZE (GET_MODE (x)); + return isize > osize + && isize > REGMODE_NATURAL_SIZE (GET_MODE (SUBREG_REG (x))); +} /* Helper function for set_of. */ struct set_of_data |