Commit 03b9e8e4 by Jakub Jelinek Committed by Jakub Jelinek

re PR tree-optimization/59617 ([vectorizer] ICE in vectorizable_mask_load_store…

re PR tree-optimization/59617 ([vectorizer] ICE in vectorizable_mask_load_store with AVX-512F's gathers enabled.)

	PR target/59617
	* config/i386/i386.c (ix86_vectorize_builtin_gather): Uncomment
	AVX512F gather builtins.
	* tree-vect-stmts.c (vectorizable_mask_load_store): For now punt
	on gather decls with INTEGER_TYPE masktype.
	(vectorizable_load): For INTEGER_TYPE masktype, put the INTEGER_CST
	directly into the builtin rather than hoisting it before loop.

From-SVN: r206585
parent 19e51b40
2014-01-13 Jakub Jelinek <jakub@redhat.com> 2014-01-13 Jakub Jelinek <jakub@redhat.com>
PR target/59617
* config/i386/i386.c (ix86_vectorize_builtin_gather): Uncomment
AVX512F gather builtins.
* tree-vect-stmts.c (vectorizable_mask_load_store): For now punt
on gather decls with INTEGER_TYPE masktype.
(vectorizable_load): For INTEGER_TYPE masktype, put the INTEGER_CST
directly into the builtin rather than hoisting it before loop.
PR tree-optimization/59387 PR tree-optimization/59387
* tree-scalar-evolution.c: Include gimple-fold.h and gimplify-me.h. * tree-scalar-evolution.c: Include gimple-fold.h and gimplify-me.h.
(scev_const_prop): If folded_casts and type has undefined overflow, (scev_const_prop): If folded_casts and type has undefined overflow,
......
...@@ -36565,9 +36565,6 @@ ix86_vectorize_builtin_gather (const_tree mem_vectype, ...@@ -36565,9 +36565,6 @@ ix86_vectorize_builtin_gather (const_tree mem_vectype,
case V8SImode: case V8SImode:
code = si ? IX86_BUILTIN_GATHERSIV8SI : IX86_BUILTIN_GATHERALTDIV8SI; code = si ? IX86_BUILTIN_GATHERSIV8SI : IX86_BUILTIN_GATHERALTDIV8SI;
break; break;
#if 0
/* FIXME: Commented until vectorizer can work with (mask_type != src_type)
PR59617. */
case V8DFmode: case V8DFmode:
if (TARGET_AVX512F) if (TARGET_AVX512F)
code = si ? IX86_BUILTIN_GATHER3ALTSIV8DF : IX86_BUILTIN_GATHER3DIV8DF; code = si ? IX86_BUILTIN_GATHER3ALTSIV8DF : IX86_BUILTIN_GATHER3DIV8DF;
...@@ -36592,7 +36589,6 @@ ix86_vectorize_builtin_gather (const_tree mem_vectype, ...@@ -36592,7 +36589,6 @@ ix86_vectorize_builtin_gather (const_tree mem_vectype,
else else
return NULL_TREE; return NULL_TREE;
break; break;
#endif
default: default:
return NULL_TREE; return NULL_TREE;
} }
...@@ -1813,6 +1813,17 @@ vectorizable_mask_load_store (gimple stmt, gimple_stmt_iterator *gsi, ...@@ -1813,6 +1813,17 @@ vectorizable_mask_load_store (gimple stmt, gimple_stmt_iterator *gsi,
"gather index use not simple."); "gather index use not simple.");
return false; return false;
} }
tree arglist = TYPE_ARG_TYPES (TREE_TYPE (gather_decl));
tree masktype
= TREE_VALUE (TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (arglist))));
if (TREE_CODE (masktype) == INTEGER_TYPE)
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"masked gather with integer mask not supported.");
return false;
}
} }
else if (tree_int_cst_compare (nested_in_vect_loop else if (tree_int_cst_compare (nested_in_vect_loop
? STMT_VINFO_DR_STEP (stmt_info) ? STMT_VINFO_DR_STEP (stmt_info)
...@@ -5761,6 +5772,7 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, ...@@ -5761,6 +5772,7 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
{ {
mask = build_int_cst (TREE_TYPE (masktype), -1); mask = build_int_cst (TREE_TYPE (masktype), -1);
mask = build_vector_from_val (masktype, mask); mask = build_vector_from_val (masktype, mask);
mask = vect_init_vector (stmt, mask, masktype, NULL);
} }
else if (SCALAR_FLOAT_TYPE_P (TREE_TYPE (masktype))) else if (SCALAR_FLOAT_TYPE_P (TREE_TYPE (masktype)))
{ {
...@@ -5771,10 +5783,10 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, ...@@ -5771,10 +5783,10 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
real_from_target (&r, tmp, TYPE_MODE (TREE_TYPE (masktype))); real_from_target (&r, tmp, TYPE_MODE (TREE_TYPE (masktype)));
mask = build_real (TREE_TYPE (masktype), r); mask = build_real (TREE_TYPE (masktype), r);
mask = build_vector_from_val (masktype, mask); mask = build_vector_from_val (masktype, mask);
mask = vect_init_vector (stmt, mask, masktype, NULL);
} }
else else
gcc_unreachable (); gcc_unreachable ();
mask = vect_init_vector (stmt, mask, masktype, NULL);
scale = build_int_cst (scaletype, gather_scale); scale = build_int_cst (scaletype, gather_scale);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment