]> git.ipfire.org Git - thirdparty/gcc.git/commit
RISC-V: Bugfix for max_sew_overlap_and_next_ratio_valid_for_prev_sew_p[pr117483]
authorxuli <xuli1@eswincomputing.com>
Tue, 12 Nov 2024 02:31:28 +0000 (02:31 +0000)
committerKito Cheng <kito.cheng@sifive.com>
Wed, 9 Apr 2025 14:15:14 +0000 (22:15 +0800)
commit6cd78e383a98553482811f10318ff3da9a101d38
tree37cdeea712018605d271affda177ac24acc7c776
parentcdb987e977e03ba78a8a0e094967a5121e01f2ce
RISC-V: Bugfix for max_sew_overlap_and_next_ratio_valid_for_prev_sew_p[pr117483]

This patch fixs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117483

If prev and next satisfy the following rules, we should forbid the case
(next.get_sew() < prev.get_sew() && (!next.get_ta() || !next.get_ma()))
in the compatible function max_sew_overlap_and_next_ratio_valid_for_prev_sew_p.
Otherwise, the tail elements of next will be polluted.

DEF_SEW_LMUL_RULE (ge_sew, ratio_and_ge_sew, ratio_and_ge_sew,
 max_sew_overlap_and_next_ratio_valid_for_prev_sew_p,
 always_false, use_max_sew_and_lmul_with_next_ratio)

Passed the rv64gcv full regression test.

Signed-off-by: Li Xu <xuli1@eswincomputing.com>
PR target/117483

gcc/ChangeLog:

* config/riscv/riscv-vsetvl.cc: Fix bug.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/pr117483.c: New test.
gcc/config/riscv/riscv-vsetvl.cc
gcc/testsuite/gcc.target/riscv/pr117483.c [new file with mode: 0644]