aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parser.cc
diff options
context:
space:
mode:
authorJeff Law <jlaw@ventanamicro.com>2024-05-14 18:17:59 -0600
committerJeff Law <jlaw@ventanamicro.com>2024-05-14 18:18:48 -0600
commit32ff344d57d56fddb66c4976b5651345d40b7157 (patch)
tree18ec440e6b39e5aaafdd3063437f42845d62253f /gcc/cp/parser.cc
parent3700bd68d1b01f0fe6d15f8a40b7fdca0904d5aa (diff)
downloadgcc-32ff344d57d56fddb66c4976b5651345d40b7157.zip
gcc-32ff344d57d56fddb66c4976b5651345d40b7157.tar.gz
gcc-32ff344d57d56fddb66c4976b5651345d40b7157.tar.bz2
[to-be-committed,RISC-V] Remove redundant AND in shift-add sequence
So this patch allows us to eliminate an redundant AND in some shift-add style sequences. I think the testcase was reduced from xz by the RAU team, but I'm not highly confident of that. Specifically the AND is masking off the upper 32 bits of the un-shifted value and there's an outer SIGN_EXTEND from SI to DI. However in the RTL it's working on the post-shifted value, so the constant is left shifted, so we have to account for that in the pattern's condition. We can just drop the AND in this case. So instead we do a 64bit shift, then a sign extending ADD utilizing the low part of that 64bit shift result. This has run through Ventana's CI as well as my own. I'll wait for it to run through the larger CI system before pushing. Jeff gcc/ * config/riscv/riscv.md: Add pattern for sign extended shift-add sequence with a masked input. gcc/testsuite * gcc.target/riscv/shift-add-2.c: New test.
Diffstat (limited to 'gcc/cp/parser.cc')
0 files changed, 0 insertions, 0 deletions