]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Finish vectorizer pattern proper COND_EXPR transition
authorRichard Biener <rguenther@suse.de>
Fri, 25 Oct 2024 11:42:08 +0000 (13:42 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Sat, 26 Oct 2024 12:15:23 +0000 (14:15 +0200)
The following tries to finish building proper GIMPLE COND_EXPRs
in vectorizer pattern recognition.

* tree-vect-patterns.cc (vect_recog_divmod_pattern): Build
separate comparion pattern for the condition of a COND_EXPR
pattern.

gcc/tree-vect-patterns.cc

index d4c7793bb5aaed6b4830219448854598156e1331..d9fe4937858391096dc35bc2b6e77460da0b07fe 100644 (file)
@@ -4933,8 +4933,11 @@ vect_recog_divmod_pattern (vec_info *vinfo,
          return pattern_stmt;
        }
 
-      cond = build2 (LT_EXPR, boolean_type_node, oprnd0,
-                    build_int_cst (itype, 0));
+      cond = vect_recog_temp_ssa_var (boolean_type_node, NULL);
+      def_stmt = gimple_build_assign (cond, LT_EXPR, oprnd0,
+                                     build_int_cst (itype, 0));
+      append_pattern_def_seq (vinfo, stmt_vinfo, def_stmt,
+                             truth_type_for (vectype), itype);
       if (rhs_code == TRUNC_DIV_EXPR
          || rhs_code == EXACT_DIV_EXPR)
        {