diff options
author | Juzhe-Zhong <juzhe.zhong@rivai.ai> | 2024-01-06 13:10:38 +0800 |
---|---|---|
committer | Pan Li <pan2.li@intel.com> | 2024-01-06 13:24:00 +0800 |
commit | 6cf47447f6fba84a17864fc7a19a532a62b6e736 (patch) | |
tree | f6e662d07152448d3e8ae3bb749cc97754a2c275 /gcc/tree-vect-loop.cc | |
parent | 19c76b5a91837cdb3e7aa4cb484dd4cfdebca8ae (diff) | |
download | gcc-6cf47447f6fba84a17864fc7a19a532a62b6e736.zip gcc-6cf47447f6fba84a17864fc7a19a532a62b6e736.tar.gz gcc-6cf47447f6fba84a17864fc7a19a532a62b6e736.tar.bz2 |
RISC-V: Update MAX_SEW for available vsevl info[VSETVL PASS]
This patch fixes a bug of VSETVL PASS in this following situation:
Ignore curr info since prev info available with it:
prev_info: VALID (insn 8, bb 2)
Demand fields: demand_ratio_and_ge_sew demand_avl
SEW=16, VLMUL=mf4, RATIO=64, MAX_SEW=64
TAIL_POLICY=agnostic, MASK_POLICY=agnostic
AVL=(const_int 1 [0x1])
VL=(nil)
curr_info: VALID (insn 12, bb 2)
Demand fields: demand_ge_sew demand_non_zero_avl
SEW=16, VLMUL=m1, RATIO=16, MAX_SEW=32
TAIL_POLICY=agnostic, MASK_POLICY=agnostic
AVL=(const_int 1 [0x1])
VL=(nil)
We should update prev_info MAX_SEW from 64 into 32.
Before this patch:
foo:
vsetivli zero,1,e64,m1,ta,ma
vle64.v v1,0(a1)
vmv.s.x v3,a0
vfmv.s.f v2,fa0
vadd.vv v1,v1,v1
ret
After this patch:
foo:
vsetivli zero,1,e16,mf4,ta,ma
vle64.v v1,0(a1)
vmv.s.x v3,a0
vfmv.s.f v2,fa0
vsetvli zero,zero,e64,m1,ta,ma
vadd.vv v1,v1,v1
ret
Tested on both RV32 and RV64 no regression. Committed.
PR target/113248
gcc/ChangeLog:
* config/riscv/riscv-vsetvl.cc (pre_vsetvl::fuse_local_vsetvl_info):
Update the MAX_SEW.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/vsetvl/pr113248.c: New test.
Diffstat (limited to 'gcc/tree-vect-loop.cc')
0 files changed, 0 insertions, 0 deletions