aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.cc
diff options
context:
space:
mode:
authorJivan Hakobyan <jivanhakobyan9@gmail.com>2023-08-09 13:26:58 -0600
committerJeff Law <jlaw@ventanamicro.com>2023-08-09 13:29:27 -0600
commita16dc729fda9fabd6472d50cce45791cb3b6ada8 (patch)
tree98101861f21810802f698c8d4d598382390e3c44 /gcc/expr.cc
parent7fb65f102851248bafa0815401d8bdcea6d7626c (diff)
downloadgcc-a16dc729fda9fabd6472d50cce45791cb3b6ada8.zip
gcc-a16dc729fda9fabd6472d50cce45791cb3b6ada8.tar.gz
gcc-a16dc729fda9fabd6472d50cce45791cb3b6ada8.tar.bz2
RISC-V: Folding memory for FP + constant case
Accessing local arrays element turned into load form (fp + (index << C1)) + C2 address. In the case when access is in the loop we got loop invariant computation. For some reason, moving out that part cannot be done in loop-invariant passes. But we can handle that in target-specific hook (legitimize_address). That provides an opportunity to rewrite memory access more suitable for the target architecture. This patch solves the mentioned case by rewriting mentioned case to ((fp + C2) + (index << C1)) I have evaluated it on SPEC2017 and got an improvement on leela (over 7b instructions, .39% of the dynamic count) and dwarfs the regression for gcc (14m instructions, .0012% of the dynamic count). gcc/ChangeLog: * config/riscv/riscv.cc (riscv_legitimize_address): Handle folding. (mem_shadd_or_shadd_rtx_p): New function.
Diffstat (limited to 'gcc/expr.cc')
0 files changed, 0 insertions, 0 deletions