diff options
author | Richard Biener <rguenther@suse.de> | 2022-04-29 11:54:45 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2022-05-03 09:45:29 +0200 |
commit | dfae0c5a29f336cdab234b28999f9ba9dc20a4d0 (patch) | |
tree | 30bb68a006f76d568ab2629ae021a5eece84574a | |
parent | 941cdc8b6d29f9fe494fdd244e96a5e5aa08ba32 (diff) | |
download | gcc-dfae0c5a29f336cdab234b28999f9ba9dc20a4d0.zip gcc-dfae0c5a29f336cdab234b28999f9ba9dc20a4d0.tar.gz gcc-dfae0c5a29f336cdab234b28999f9ba9dc20a4d0.tar.bz2 |
tree-optimization/105394 - vector lowering of compares
The following fixes missing handling of non-integer mode but
masked (SVE or MVE) compares in vector lowering by using the
appropriate mask element width to extract the components and
adjust the index.
2022-04-29 Richard Biener <rguenther@suse.de>
PR tree-optimization/105394
* tree-vect-generic.cc (expand_vector_condition): Adjust
comp_width for non-integer mode masks as well.
-rw-r--r-- | gcc/tree-vect-generic.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/tree-vect-generic.cc b/gcc/tree-vect-generic.cc index 8b7227e..e5bd9dc 100644 --- a/gcc/tree-vect-generic.cc +++ b/gcc/tree-vect-generic.cc @@ -1122,6 +1122,9 @@ expand_vector_condition (gimple_stmt_iterator *gsi, bitmap dce_ssa_names) tree atype = build_nonstandard_integer_type (prec, 1); a = gimplify_build1 (gsi, VIEW_CONVERT_EXPR, atype, a); } + else if (!a_is_comparison + && VECTOR_BOOLEAN_TYPE_P (TREE_TYPE (a))) + comp_width = vector_element_bits_tree (TREE_TYPE (a)); int nunits = nunits_for_known_piecewise_op (type); vec_alloc (v, nunits); @@ -1148,7 +1151,7 @@ expand_vector_condition (gimple_stmt_iterator *gsi, bitmap dce_ssa_names) build_zero_cst (TREE_TYPE (a))); } else - aa = tree_vec_extract (gsi, cond_type, a, width, index); + aa = tree_vec_extract (gsi, cond_type, a, comp_width, comp_index); result = gimplify_build3 (gsi, COND_EXPR, inner_type, aa, bb, cc); if (!CONSTANT_CLASS_P (result)) constant_p = false; |