diff options
author | Richard Sandiford <richard@codesourcery.com> | 2007-03-21 09:10:08 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2007-03-21 09:10:08 +0000 |
commit | 2a450639801b638f5b28d00b1ba0b560d8a2c271 (patch) | |
tree | dcedf9b4a8071779c736674a2898f51cb3a47948 /gcc/rtlanal.c | |
parent | fe24cc36d56fe9bf973480d4fe97b2cbc652b69b (diff) | |
download | gcc-2a450639801b638f5b28d00b1ba0b560d8a2c271.zip gcc-2a450639801b638f5b28d00b1ba0b560d8a2c271.tar.gz gcc-2a450639801b638f5b28d00b1ba0b560d8a2c271.tar.bz2 |
rtl.h (constant_pool_reference_p): Delete.
gcc/
* rtl.h (constant_pool_reference_p): Delete.
(find_constant_src): Declare.
* rtlanal.c (find_constant_src): New function.
* simplify-rtx.c (constant_pool_reference_p): Delete.
* config/i386/i386.md: Use find_constant_src instead of
constant_pool_reference_p/avoid_constant_pool_reference pairs.
From-SVN: r123106
Diffstat (limited to 'gcc/rtlanal.c')
-rw-r--r-- | gcc/rtlanal.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index cf9fd1d..ce7018b 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -1750,6 +1750,30 @@ find_reg_equal_equiv_note (rtx insn) return NULL; } +/* Check whether INSN is a single_set whose source is known to be + equivalent to a constant. Return that constant if so, otherwise + return null. */ + +rtx +find_constant_src (rtx insn) +{ + rtx note, set, x; + + set = single_set (insn); + if (set) + { + x = avoid_constant_pool_reference (SET_SRC (set)); + if (CONSTANT_P (x)) + return x; + } + + note = find_reg_equal_equiv_note (insn); + if (note && CONSTANT_P (XEXP (note, 0))) + return XEXP (note, 0); + + return NULL_RTX; +} + /* Return true if DATUM, or any overlap of DATUM, of kind CODE is found in the CALL_INSN_FUNCTION_USAGE information of INSN. */ |