diff options
author | Alejandro Martinez <alejandro.martinezvicente@arm.com> | 2019-06-03 09:13:32 +0000 |
---|---|---|
committer | Alejandro Martinez <alejandro@gcc.gnu.org> | 2019-06-03 09:13:32 +0000 |
commit | bcde3345ea97aef36f5b4e29f09f71bcd41879b2 (patch) | |
tree | a37c040cad49749087ab467c78458e04f08ef665 /gcc/tree-vect-slp.c | |
parent | 961dce6b9d495ebdb3a0b98bf0d15bb8f062ff00 (diff) | |
download | gcc-bcde3345ea97aef36f5b4e29f09f71bcd41879b2.zip gcc-bcde3345ea97aef36f5b4e29f09f71bcd41879b2.tar.gz gcc-bcde3345ea97aef36f5b4e29f09f71bcd41879b2.tar.bz2 |
Fix ICE in vect_slp_analyze_node_operations_1
This patch fixes bug 90681. It was caused by trying to SLP vectorize a non
groupped load. We've fixed it by tweaking a bit the implementation: mark
masked loads as not vectorizable, but support them as an special case. Then
the detect them in the test for normal non-groupped loads that was already
there.
From-SVN: r271856
Diffstat (limited to 'gcc/tree-vect-slp.c')
-rw-r--r-- | gcc/tree-vect-slp.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index 884db33..930cd797 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -661,6 +661,7 @@ vect_build_slp_tree_1 (unsigned char *swap, machine_mode optab_op2_mode; machine_mode vec_mode; stmt_vec_info first_load = NULL, prev_first_load = NULL; + bool load_p = false; /* For every stmt in NODE find its def stmt/s. */ stmt_vec_info stmt_info; @@ -714,13 +715,16 @@ vect_build_slp_tree_1 (unsigned char *swap, if (gcall *call_stmt = dyn_cast <gcall *> (stmt)) { rhs_code = CALL_EXPR; - if ((gimple_call_internal_p (call_stmt) - && (!vectorizable_internal_fn_p - (gimple_call_internal_fn (call_stmt)))) - || gimple_call_tail_p (call_stmt) - || gimple_call_noreturn_p (call_stmt) - || !gimple_call_nothrow_p (call_stmt) - || gimple_call_chain (call_stmt)) + + if (gimple_call_internal_p (stmt, IFN_MASK_LOAD)) + load_p = true; + else if ((gimple_call_internal_p (call_stmt) + && (!vectorizable_internal_fn_p + (gimple_call_internal_fn (call_stmt)))) + || gimple_call_tail_p (call_stmt) + || gimple_call_noreturn_p (call_stmt) + || !gimple_call_nothrow_p (call_stmt) + || gimple_call_chain (call_stmt)) { if (dump_enabled_p ()) dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, @@ -732,7 +736,10 @@ vect_build_slp_tree_1 (unsigned char *swap, } } else - rhs_code = gimple_assign_rhs_code (stmt); + { + rhs_code = gimple_assign_rhs_code (stmt); + load_p = TREE_CODE_CLASS (rhs_code) == tcc_reference; + } /* Check the operation. */ if (i == 0) @@ -899,7 +906,7 @@ vect_build_slp_tree_1 (unsigned char *swap, } /* Grouped access. */ else { - if (TREE_CODE_CLASS (rhs_code) == tcc_reference) + if (load_p) { /* Not grouped load. */ if (dump_enabled_p ()) |