]> git.ipfire.org Git - thirdparty/gcc.git/commit
VECT: Support loop len control on EXTRACT_LAST vectorization
authorJuzhe-Zhong <juzhe.zhong@rivai.ai>
Mon, 21 Aug 2023 10:59:55 +0000 (18:59 +0800)
committerPan Li <pan2.li@intel.com>
Tue, 22 Aug 2023 06:30:16 +0000 (14:30 +0800)
commitc27f06260b248062c3b22f3963858ce3e1ee1882
treef082207a12e182e0878e8abe97af466a21d27adb
parent710d54f4c5af4b347f4556ca84cec636da7944d4
VECT: Support loop len control on EXTRACT_LAST vectorization

Hi, @Richi and @Richard, base on previous disscussion, I simpily fix issuses for
powerpc and s390 with your suggestions:

-  machine_mode len_load_mode = get_len_load_store_mode
-    (loop_vinfo->vector_mode, true).require ();
-  machine_mode len_store_mode = get_len_load_store_mode
-    (loop_vinfo->vector_mode, false).require ();
+  machine_mode len_load_mode, len_store_mode;
+  if (!get_len_load_store_mode (loop_vinfo->vector_mode, true)
+        .exists (&len_load_mode))
+    return false;
+  if (!get_len_load_store_mode (loop_vinfo->vector_mode, false)
+        .exists (&len_store_mode))
+    return false;

Co-Authored-By: Kewen.Lin <linkw@linux.ibm.com>
gcc/ChangeLog:

* tree-vect-loop.cc (vect_verify_loop_lens): Add exists check.
(vectorizable_live_operation): Add live vectorization for length loop
control.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/partial/live-1.c: New test.
* gcc.target/riscv/rvv/autovec/partial/live_run-1.c: New test.
gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/live-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/live_run-1.c [new file with mode: 0644]
gcc/tree-vect-loop.cc