This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix PR86557

The following fixes the vectorizer part of PR86557, vectorizing
of EXACT_DIV_EXPR.  The x86 backend still lacks arithmetic DImode
right shift support for vectors without AVX512.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.


2018-07-18  Richard Biener  <>

	PR tree-optimization/86557
	* tree-vect-patterns.c (vect_recog_divmod_pattern): Also handle

diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c
index 4c22afd2b5f..0f63ccf87bb 100644
--- a/gcc/tree-vect-patterns.c
+++ b/gcc/tree-vect-patterns.c
@@ -2684,6 +2684,7 @@ vect_recog_divmod_pattern (stmt_vec_info stmt_vinfo, tree *type_out)
   switch (rhs_code)
     case TRUNC_DIV_EXPR:
+    case EXACT_DIV_EXPR:
     case TRUNC_MOD_EXPR:
@@ -2730,7 +2731,8 @@ vect_recog_divmod_pattern (stmt_vec_info stmt_vinfo, tree *type_out)
       cond = build2 (LT_EXPR, boolean_type_node, oprnd0,
 		     build_int_cst (itype, 0));
-      if (rhs_code == TRUNC_DIV_EXPR)
+      if (rhs_code == TRUNC_DIV_EXPR
+	  || rhs_code == EXACT_DIV_EXPR)
 	  tree var = vect_recog_temp_ssa_var (itype, NULL);
 	  tree shift;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]