diff options
author | Roger Sayle <roger@nextmovesoftware.com> | 2023-06-23 15:23:20 +0100 |
---|---|---|
committer | Roger Sayle <roger@nextmovesoftware.com> | 2023-06-23 15:23:20 +0100 |
commit | d0e891406b16dc28905717de2333f5637cf71d3e (patch) | |
tree | e66942d91a5d39cf396f552e102080c2d558255e /libcpp | |
parent | 2acbbf41d4c2a3362991863ce265041f9a2feee4 (diff) | |
download | gcc-d0e891406b16dc28905717de2333f5637cf71d3e.zip gcc-d0e891406b16dc28905717de2333f5637cf71d3e.tar.gz gcc-d0e891406b16dc28905717de2333f5637cf71d3e.tar.bz2 |
Improved SUBREG simplifications in simplify-rtx.cc's simplify_subreg.
An x86 backend improvement that I'm working results in combine attempting
to recognize:
(set (reg:DI 87 [ xD.2846 ])
(ior:DI (subreg:DI (ashift:TI (zero_extend:TI (reg:DI 92))
(const_int 64 [0x40])) 0)
(reg:DI 91)))
where the lowpart SUBREG has difficulty seeing through the (hi<<64)
that the lowpart must be zero. Rather than workaround this in the
backend, the better fix is to teach simplify-rtx that
lowpart((hi<<64)|lo) -> lo and highpart((hi<<64)|lo) -> hi, so that
all backends benefit. Reducing the number of places where the
middle-end generates a SUBREG of something other than REG is a
good thing.
On x86_64-pc-linux-gnu, the testcase pr78904-1b.c FAILs with this patch,
due to changes in expected/canonical RTL, for which a backend patch to
i386.md has already been provisionally approved.
2023-06-23 Roger Sayle <roger@nextmovesoftware.com>
gcc/ChangeLog
* simplify-rtx.cc (simplify_subreg): Optimize lowpart SUBREGs
of ASHIFT to const0_rtx with sufficiently large shift count.
Optimize highpart SUBREGs of ASHIFT as the shift operand when
the shift count is the correct offset. Optimize SUBREGs of
multi-word logic operations if the SUBREGs of both operands
can be simplified.
Diffstat (limited to 'libcpp')
0 files changed, 0 insertions, 0 deletions