Commit 603cca93 by Richard Biener Committed by Richard Biener

re PR middle-end/68852 (ICE in vect_is_simple_use (tree-vect-stmts.c:8750) using -O3)

2015-12-14  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/68852
	* tree-vectorizer.h (struct _slp_tree): Add def_type member.
	(SLP_TREE_DEF_TYPE): New accessor.
	* tree-vect-stmts.c (vect_is_simple_use): Remove BB vectorization
	hack.
	* tree-vect-slp.c (vect_create_new_slp_node): Initialize
	SLP_TREE_DEF_TYPE.
	(vect_build_slp_tree): When a node is to be built up from scalars
	do not push a NULL as child but instead set its def_type to
	vect_external_def.
	(vect_analyze_slp_cost_1): Check for child def-type instead
	of NULL.
	(vect_detect_hybrid_slp_stmts): Likewise.
	(vect_bb_slp_scalar_cost): Likewise.
	(vect_get_slp_defs): Likewise.
	(vect_slp_analyze_node_operations): Likewise.  Before
	processing node push the children def-types to the underlying
	stmts vinfo and restore it afterwards.
	(vect_schedule_slp_instance): Likewise.
	(vect_slp_analyze_bb_1): Do not mark stmts not in SLP instances
	as not vectorizable.

	* g++.dg/torture/pr68852.C: New testcase.

From-SVN: r231619
parent 60f2b864
2015-12-14 Richard Biener <rguenther@suse.de> 2015-12-14 Richard Biener <rguenther@suse.de>
PR tree-optimization/68852
* tree-vectorizer.h (struct _slp_tree): Add def_type member.
(SLP_TREE_DEF_TYPE): New accessor.
* tree-vect-stmts.c (vect_is_simple_use): Remove BB vectorization
hack.
* tree-vect-slp.c (vect_create_new_slp_node): Initialize
SLP_TREE_DEF_TYPE.
(vect_build_slp_tree): When a node is to be built up from scalars
do not push a NULL as child but instead set its def_type to
vect_external_def.
(vect_analyze_slp_cost_1): Check for child def-type instead
of NULL.
(vect_detect_hybrid_slp_stmts): Likewise.
(vect_bb_slp_scalar_cost): Likewise.
(vect_get_slp_defs): Likewise.
(vect_slp_analyze_node_operations): Likewise. Before
processing node push the children def-types to the underlying
stmts vinfo and restore it afterwards.
(vect_schedule_slp_instance): Likewise.
(vect_slp_analyze_bb_1): Do not mark stmts not in SLP instances
as not vectorizable.
2015-12-14 Richard Biener <rguenther@suse.de>
PR tree-optimization/68775 PR tree-optimization/68775
* tree-vect-slp.c (vect_build_slp_tree): Make sure to apply * tree-vect-slp.c (vect_build_slp_tree): Make sure to apply
a operand swapping even if replacing the op with scalars. a operand swapping even if replacing the op with scalars.
2015-12-14 Richard Biener <rguenther@suse.de>
PR tree-optimization/68852
* g++.dg/torture/pr68852.C: New testcase.
2015-12-14 Alexander Monakov <amonakov@ispras.ru> 2015-12-14 Alexander Monakov <amonakov@ispras.ru>
* gcc.dg/builtin-return-1.c: Correct effective-target test. * gcc.dg/builtin-return-1.c: Correct effective-target test.
......
/* { dg-do compile } */
struct A {
double x, y, z, w;
A() {}
A(double, double p2, double p3, double) : y(p2), z(p3) {}
void m_fn1();
};
struct B {
double x, y;
};
struct D : A {
D() {}
D(double p1, double p2, double p3, double p4) : A(p1, p2, p3, p4) {}
};
class C {
public:
float _11, _12, _13, _14;
float _21, _22, _23, _24;
float _31, _32, _33, _34;
float _41, _42, _43, _44;
D m_fn2(B p1) {
double z(p1.x + _43);
return *this * D(p1.x, p1.y, z, 1);
}
int ProjectRectBounds_next;
B __trans_tmp_3;
int m_fn3(int) {
B a, b;
D c[1];
b = __trans_tmp_3;
c[2] = m_fn2(b);
c[3] = m_fn2(a);
c[ProjectRectBounds_next].m_fn1();
}
D operator*(D p1) {
D d;
d.x = p1.x * _11 + p1.y * _21 + p1.z * _31 + _41;
d.y = p1.x * _12 + p1.y * _22 + p1.z * _32 + _42;
d.z = p1.x * _13 + p1.y * _23 + p1.z * _33 + _43;
d.w = p1.x * _14 + p1.y * _24 + p1.z * _34 + _44;
return d;
}
};
void fn1() {
C e;
int f = e.m_fn3(f);
}
...@@ -8649,10 +8649,7 @@ vect_is_simple_use (tree operand, vec_info *vinfo, ...@@ -8649,10 +8649,7 @@ vect_is_simple_use (tree operand, vec_info *vinfo,
else else
{ {
stmt_vec_info stmt_vinfo = vinfo_for_stmt (*def_stmt); stmt_vec_info stmt_vinfo = vinfo_for_stmt (*def_stmt);
if (is_a <bb_vec_info> (vinfo) && !STMT_VINFO_VECTORIZABLE (stmt_vinfo)) *dt = STMT_VINFO_DEF_TYPE (stmt_vinfo);
*dt = vect_external_def;
else
*dt = STMT_VINFO_DEF_TYPE (stmt_vinfo);
} }
if (dump_enabled_p ()) if (dump_enabled_p ())
......
...@@ -107,6 +107,8 @@ struct _slp_tree { ...@@ -107,6 +107,8 @@ struct _slp_tree {
unsigned int vec_stmts_size; unsigned int vec_stmts_size;
/* Whether the scalar computations use two different operators. */ /* Whether the scalar computations use two different operators. */
bool two_operators; bool two_operators;
/* The DEF type of this node. */
enum vect_def_type def_type;
}; };
...@@ -139,6 +141,7 @@ typedef struct _slp_instance { ...@@ -139,6 +141,7 @@ typedef struct _slp_instance {
#define SLP_TREE_NUMBER_OF_VEC_STMTS(S) (S)->vec_stmts_size #define SLP_TREE_NUMBER_OF_VEC_STMTS(S) (S)->vec_stmts_size
#define SLP_TREE_LOAD_PERMUTATION(S) (S)->load_permutation #define SLP_TREE_LOAD_PERMUTATION(S) (S)->load_permutation
#define SLP_TREE_TWO_OPERATORS(S) (S)->two_operators #define SLP_TREE_TWO_OPERATORS(S) (S)->two_operators
#define SLP_TREE_DEF_TYPE(S) (S)->def_type
......
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