]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Finish vectorizer pattern proper COND_EXPR transition
authorRichard Biener <rguenther@suse.de>
Fri, 25 Oct 2024 12:20:23 +0000 (14:20 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Sat, 26 Oct 2024 12:15:23 +0000 (14:15 +0200)
This fixes up vect_recog_ctz_ffs_pattern.

* tree-vect-patterns.cc (vect_recog_ctz_ffs_pattern): Create
a separate pattern stmt for the comparison in the generated
COND_EXPR.

gcc/tree-vect-patterns.cc

index d9fe4937858391096dc35bc2b6e77460da0b07fe..46aa3129bb305e4919da77aadc47801bdb66c99a 100644 (file)
@@ -2072,8 +2072,11 @@ vect_recog_ctz_ffs_pattern (vec_info *vinfo, stmt_vec_info stmt_vinfo,
       tree ret_var = vect_recog_temp_ssa_var (lhs_type, NULL);
       rhs_oprnd = gimple_call_arg (call_stmt, 0);
       rhs_type = TREE_TYPE (rhs_oprnd);
-      tree cmp = build2_loc (loc, NE_EXPR, boolean_type_node,
-                            rhs_oprnd, build_zero_cst (rhs_type));
+      tree cmp = vect_recog_temp_ssa_var (boolean_type_node, NULL);
+      pattern_stmt = gimple_build_assign (cmp, NE_EXPR, rhs_oprnd,
+                                         build_zero_cst (rhs_type));
+      append_pattern_def_seq (vinfo, stmt_vinfo, pattern_stmt,
+                             truth_type_for (vec_type), rhs_type);
       pattern_stmt = gimple_build_assign (ret_var, COND_EXPR, cmp,
                                          new_var,
                                          build_int_cst (lhs_type, val));