diff options
author | Richard Biener <rguenther@suse.de> | 2023-11-06 12:43:11 +0100 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2023-11-06 14:06:01 +0100 |
commit | 3cc9ad41db87fb85b13a56bff1f930c258542a70 (patch) | |
tree | 84ce7033686d67f9fc8ec4de56ce4613a42a227f /gcc/tree-vectorizer.h | |
parent | 9d1bf1d0b7a14ef741e967e0ab3ead35ec8e5f4e (diff) | |
download | gcc-3cc9ad41db87fb85b13a56bff1f930c258542a70.zip gcc-3cc9ad41db87fb85b13a56bff1f930c258542a70.tar.gz gcc-3cc9ad41db87fb85b13a56bff1f930c258542a70.tar.bz2 |
tree-optimization/112404 - two issues with SLP of .MASK_LOAD
The following fixes an oversight in vect_check_scalar_mask when
the mask is external or constant. When doing BB vectorization
we need to provide a group_size, best via an overload accepting
the SLP node as argument.
When fixed we then run into the issue that we have not analyzed
alignment of the .MASK_LOADs because they were not identified
as loads by vect_gather_slp_loads. Fixed by reworking the
detection.
PR tree-optimization/112404
* tree-vectorizer.h (get_mask_type_for_scalar_type): Declare
overload with SLP node argument.
* tree-vect-stmts.cc (get_mask_type_for_scalar_type): Implement it.
(vect_check_scalar_mask): Use it.
* tree-vect-slp.cc (vect_gather_slp_loads): Properly identify
loads also for nodes with children, like .MASK_LOAD.
* tree-vect-loop.cc (vect_analyze_loop_2): Look at the
representative for load nodes and check whether it is a grouped
access before looking for load-lanes support.
* gfortran.dg/pr112404.f90: New testcase.
Diffstat (limited to 'gcc/tree-vectorizer.h')
-rw-r--r-- | gcc/tree-vectorizer.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 254d172..d2ddc2e 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -2207,6 +2207,7 @@ extern tree get_related_vectype_for_scalar_type (machine_mode, tree, extern tree get_vectype_for_scalar_type (vec_info *, tree, unsigned int = 0); extern tree get_vectype_for_scalar_type (vec_info *, tree, slp_tree); extern tree get_mask_type_for_scalar_type (vec_info *, tree, unsigned int = 0); +extern tree get_mask_type_for_scalar_type (vec_info *, tree, slp_tree); extern tree get_same_sized_vectype (tree, tree); extern bool vect_chooses_same_modes_p (vec_info *, machine_mode); extern bool vect_get_loop_mask_type (loop_vec_info); |