VECT: Fix bug of multiple-rgroup for length is counting elements
commit16df2790a58ebbeb949ffb790ebee7f6ed31936d
authorJu-Zhe Zhong <juzhe.zhong@rivai.ai>
Mon, 22 May 2023 08:35:37 +0000 (22 16:35 +0800)
committerPan Li <pan2.li@intel.com>
Mon, 22 May 2023 08:35:37 +0000 (22 16:35 +0800)
tree0b6aa3924ca1fe3f841bcc52d8783a160526c2f6
parent7b0986acf20ebe261221b800b6196acbf87f5ca2
VECT: Fix bug of multiple-rgroup for length is counting elements

Address comments from Richard that splits the patch of fixing
multiple-rgroup
handling of length counting elements.

This patch is fixing issue of handling multiple-rgroup of length is
counting elements

Before this patch, multiple rgroup run fail:
FAIL: gcc.target/riscv/rvv/autovec/partial/multiple_rgroup_run-1.c
execution test
FAIL: gcc.target/riscv/rvv/autovec/partial/multiple_rgroup_run-2.c
execution test
FAIL: gcc.target/riscv/rvv/autovec/partial/multiple_rgroup_run-1.c
execution test
FAIL: gcc.target/riscv/rvv/autovec/partial/multiple_rgroup_run-2.c
execution test
FAIL: gcc.target/riscv/rvv/autovec/partial/multiple_rgroup_run-1.c
execution test
FAIL: gcc.target/riscv/rvv/autovec/partial/multiple_rgroup_run-2.c
execution test
FAIL: gcc.target/riscv/rvv/autovec/partial/multiple_rgroup_run-2.c
execution test
FAIL: gcc.target/riscv/rvv/autovec/partial/multiple_rgroup_run-1.c
execution test
FAIL: gcc.target/riscv/rvv/autovec/partial/multiple_rgroup_run-1.c
execution test
FAIL: gcc.target/riscv/rvv/autovec/partial/multiple_rgroup_run-2.c
execution test
FAIL: gcc.target/riscv/rvv/autovec/partial/multiple_rgroup_run-1.c
execution test
FAIL: gcc.target/riscv/rvv/autovec/partial/multiple_rgroup_run-2.c
execution test
FAIL: gcc.target/riscv/rvv/autovec/partial/multiple_rgroup_run-1.c
execution test

After this patch, These tests are all passed.

gcc/ChangeLog:

* tree-vect-loop.cc (vect_get_loop_len): Fix issue for
multiple-rgroup of length.
* tree-vect-stmts.cc (vectorizable_store): Ditto.
(vectorizable_load): Ditto.
* tree-vectorizer.h (vect_get_loop_len): Ditto.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/partial/multiple_rgroup-1.c: New
test.
* gcc.target/riscv/rvv/autovec/partial/multiple_rgroup-1.h: New
test.
* gcc.target/riscv/rvv/autovec/partial/multiple_rgroup-2.c: New
test.
* gcc.target/riscv/rvv/autovec/partial/multiple_rgroup-2.h: New
test.
* gcc.target/riscv/rvv/autovec/partial/multiple_rgroup_run-1.c:
New test.
* gcc.target/riscv/rvv/autovec/partial/multiple_rgroup_run-2.c:
New test.
gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/multiple_rgroup-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/multiple_rgroup-1.h [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/multiple_rgroup-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/multiple_rgroup-2.h [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/multiple_rgroup_run-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/multiple_rgroup_run-2.c [new file with mode: 0644]
gcc/tree-vect-loop.cc
gcc/tree-vect-stmts.cc
gcc/tree-vectorizer.h