diff options
author | Alan Hayward <alan.hayward@arm.com> | 2015-01-21 17:53:04 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2015-01-21 17:53:04 +0000 |
commit | 9ab41c76dd2db2e2880a17eb4e6d760a087dfa45 (patch) | |
tree | bf54cac754967f41ce3094b4f89e52d598f739ab /gcc | |
parent | 122a5d603b4c67952fb32742775e8a3a478c2075 (diff) | |
download | gcc-9ab41c76dd2db2e2880a17eb4e6d760a087dfa45.zip gcc-9ab41c76dd2db2e2880a17eb4e6d760a087dfa45.tar.gz gcc-9ab41c76dd2db2e2880a17eb4e6d760a087dfa45.tar.bz2 |
rtlanal.c (subreg_get_info): Exit early for simple and common cases.
gcc/
2015-01-25 Alan Hayward <alan.hayward@arm.com>
* rtlanal.c (subreg_get_info): Exit early for simple and common
cases.
From-SVN: r219957
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/rtlanal.c | 16 |
2 files changed, 21 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3f1dda4..40422a3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-01-21 Alan Hayward <alan.hayward@arm.com> + + * rtlanal.c (subreg_get_info): Exit early for simple and common + cases. + 2015-01-21 Richard Henderson <rth@redhat.com> PR target/64669 diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index 513feeb..743aad6 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -3440,6 +3440,22 @@ subreg_get_info (unsigned int xregno, machine_mode xmode, info->offset = offset / regsize_xmode; return; } + /* Quick exit for the simple and common case of extracting whole + subregisters from a multiregister value. */ + /* ??? It would be better to integrate this into the code below, + if we can generalize the concept enough and figure out how + odd-sized modes can coexist with the other weird cases we support. */ + if (!rknown + && WORDS_BIG_ENDIAN == REG_WORDS_BIG_ENDIAN + && regsize_xmode == regsize_ymode + && (offset % regsize_ymode) == 0) + { + info->representable_p = true; + info->nregs = nregs_ymode; + info->offset = offset / regsize_ymode; + gcc_assert (info->offset + info->nregs <= nregs_xmode); + return; + } } /* Lowpart subregs are otherwise valid. */ |