diff options
author | Juzhe-Zhong <juzhe.zhong@rivai.ai> | 2023-11-03 14:41:13 +0800 |
---|---|---|
committer | Pan Li <pan2.li@intel.com> | 2023-11-03 19:26:20 +0800 |
commit | 60034ecf25597bd515f8152ea85832ff95a7563b (patch) | |
tree | 28c3426a499e2930ed58978872d85a4459ebe63d | |
parent | c0cf9b78573d3d353f22e5dd1c32fecdbca703b8 (diff) | |
download | gcc-60034ecf25597bd515f8152ea85832ff95a7563b.zip gcc-60034ecf25597bd515f8152ea85832ff95a7563b.tar.gz gcc-60034ecf25597bd515f8152ea85832ff95a7563b.tar.bz2 |
VECT: Support SLP for MASK_LEN_GATHER_LOAD with dummy mask
This patch fixes following FAILs for RVV:
FAIL: gcc.dg/vect/vect-gather-1.c -flto -ffat-lto-objects scan-tree-dump vect "Loop contains only SLP stmts"
FAIL: gcc.dg/vect/vect-gather-1.c scan-tree-dump vect "Loop contains only SLP stmts"
Bootstrap on X86 and regtest passed.
Ok for trunk ?
PR tree-optimization/111721
gcc/ChangeLog:
* tree-vect-slp.cc (vect_get_and_check_slp_defs): Support SLP for dummy mask -1.
* tree-vect-stmts.cc (vectorizable_load): Ditto.
-rw-r--r-- | gcc/tree-vect-slp.cc | 5 | ||||
-rw-r--r-- | gcc/tree-vect-stmts.cc | 5 |
2 files changed, 5 insertions, 5 deletions
diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc index 43d742e..6b8a7b6 100644 --- a/gcc/tree-vect-slp.cc +++ b/gcc/tree-vect-slp.cc @@ -759,9 +759,8 @@ vect_get_and_check_slp_defs (vec_info *vinfo, unsigned char swap, if ((dt == vect_constant_def || dt == vect_external_def) && !GET_MODE_SIZE (vinfo->vector_mode).is_constant () - && (TREE_CODE (type) == BOOLEAN_TYPE - || !can_duplicate_and_interleave_p (vinfo, stmts.length (), - type))) + && TREE_CODE (type) != BOOLEAN_TYPE + && !can_duplicate_and_interleave_p (vinfo, stmts.length (), type)) { if (dump_enabled_p ()) dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc index 799b4ab..d374907 100644 --- a/gcc/tree-vect-stmts.cc +++ b/gcc/tree-vect-stmts.cc @@ -9805,6 +9805,7 @@ vectorizable_load (vec_info *vinfo, tree mask = NULL_TREE, mask_vectype = NULL_TREE; int mask_index = -1; + slp_tree slp_op = NULL; if (gassign *assign = dyn_cast <gassign *> (stmt_info->stmt)) { scalar_dest = gimple_assign_lhs (assign); @@ -9841,7 +9842,7 @@ vectorizable_load (vec_info *vinfo, mask_index = vect_slp_child_index_for_operand (call, mask_index); if (mask_index >= 0 && !vect_check_scalar_mask (vinfo, stmt_info, slp_node, mask_index, - &mask, NULL, &mask_dt, &mask_vectype)) + &mask, &slp_op, &mask_dt, &mask_vectype)) return false; } @@ -10026,7 +10027,7 @@ vectorizable_load (vec_info *vinfo, { if (slp_node && mask - && !vect_maybe_update_slp_op_vectype (SLP_TREE_CHILDREN (slp_node)[0], + && !vect_maybe_update_slp_op_vectype (slp_op, mask_vectype)) { if (dump_enabled_p ()) |