diff options
author | Pan Li <pan2.li@intel.com> | 2023-04-26 20:00:06 +0800 |
---|---|---|
committer | Kito Cheng <kito.cheng@sifive.com> | 2023-04-26 21:23:00 +0800 |
commit | a8e1551bdb372aa3cfe754429b5efd6229ae5fdb (patch) | |
tree | 23f9229600e6b85e73acbf17da3277ee44e6d7b8 /libgcc | |
parent | 0ef3756adf078caf11c59470018fa56862ebc61f (diff) | |
download | gcc-a8e1551bdb372aa3cfe754429b5efd6229ae5fdb.zip gcc-a8e1551bdb372aa3cfe754429b5efd6229ae5fdb.tar.gz gcc-a8e1551bdb372aa3cfe754429b5efd6229ae5fdb.tar.bz2 |
RISC-V: Legitimise the const0_rtx for RVV load/store address
This patch try to legitimise the const0_rtx (aka zero register)
as the base register for the RVV load/store instructions.
For example:
vint32m1_t test_vle32_v_i32m1_shortcut (size_t vl)
{
return __riscv_vle32_v_i32m1 ((int32_t *)0, vl);
}
Before this patch:
li a5,0
vsetvli zero,a1,e32,m1,ta,ma
vle32.v v24,0(a5) <- can propagate the const 0 to a5 here
vs1r.v v24,0(a0)
After this patch:
vsetvli zero,a1,e32,m1,ta,ma
vle32.v v24,0(zero)
vs1r.v v24,0(a0)
As above, this patch allow you to propagate the const 0 (aka zero
register) to the base register of the RVV Unit-Stride load in the
combine pass. This may benefit the underlying RVV auto-vectorization.
However, the indexed load failed to perform the optimization and it
will be take care of in another PATCH.
gcc/ChangeLog:
* config/riscv/riscv.cc (riscv_classify_address): Allow
const0_rtx for the RVV load/store.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/base/zero_base_load_store_optimization.c: New test.
Signed-off-by: Pan Li <pan2.li@intel.com>
Co-authored-by: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>
Diffstat (limited to 'libgcc')
0 files changed, 0 insertions, 0 deletions