aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-alias.h
diff options
context:
space:
mode:
authorPan Li <pan2.li@intel.com>2024-05-16 09:58:13 +0800
committerPan Li <pan2.li@intel.com>2024-05-16 20:25:31 +0800
commit57f8a2f67c1536be23231808ab00613ab69193ed (patch)
treef6e763ad94328a1947d62c63e97741acc6c59732 /gcc/tree-ssa-alias.h
parentd4dee347b3fe1982bab26485ff31cd039c9df010 (diff)
downloadgcc-57f8a2f67c1536be23231808ab00613ab69193ed.zip
gcc-57f8a2f67c1536be23231808ab00613ab69193ed.tar.gz
gcc-57f8a2f67c1536be23231808ab00613ab69193ed.tar.bz2
Vect: Support loop len in vectorizable early exit
This patch adds early break auto-vectorization support for target which use length on partial vectorization. Consider this following example: unsigned vect_a[802]; unsigned vect_b[802]; void test (unsigned x, int n) { for (int i = 0; i < n; i++) { vect_b[i] = x + i; if (vect_a[i] > x) break; vect_a[i] = x; } } We use VCOND_MASK_LEN to simulate the generate (mask && i < len + bias). And then the IR of RVV looks like below: ... _87 = .SELECT_VL (ivtmp_85, POLY_INT_CST [32, 32]); _55 = (int) _87; ... mask_patt_6.13_69 = vect_cst__62 < vect__3.12_67; vec_len_mask_72 = .VCOND_MASK_LEN (mask_patt_6.13_69, { -1, ... }, \ {0, ... }, _87, 0); if (vec_len_mask_72 != { 0, ... }) goto <bb 6>; [5.50%] else goto <bb 7>; [94.50%] The below tests are passed for this patch: 1. The riscv fully regression tests. 2. The x86 bootstrap tests. 3. The x86 fully regression tests. gcc/ChangeLog: * tree-vect-loop.cc (vect_gen_loop_len_mask): New func to gen the loop len mask. * tree-vect-stmts.cc (vectorizable_early_exit): Invoke the vect_gen_loop_len_mask for 1 or more stmt(s). * tree-vectorizer.h (vect_gen_loop_len_mask): New func decl for vect_gen_loop_len_mask. Signed-off-by: Pan Li <pan2.li@intel.com>
Diffstat (limited to 'gcc/tree-ssa-alias.h')
0 files changed, 0 insertions, 0 deletions