Commit a6524bba by Richard Biener Committed by Richard Biener

re PR tree-optimization/56118 (Piecewise vector / complex initialization from…

re PR tree-optimization/56118 (Piecewise vector / complex initialization from constants not combined)

2015-11-10  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/56118
	* tree-vect-slp.c (vect_bb_vectorization_profitable_p): Make equal
	cost favor vectorized version.

	* gcc.target/i386/pr56118.c: New testcase.

From-SVN: r230091
parent 3204ac98
2015-11-10 Richard Biener <rguenther@suse.de>
PR tree-optimization/56118
* tree-vect-slp.c (vect_bb_vectorization_profitable_p): Make equal
cost favor vectorized version.
2015-11-10 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* config/aarch64/aarch64.md (<neg_not_op><mode>cc): New define_expand.
2015-11-10 Richard Biener <rguenther@suse.de>
PR tree-optimization/56118
* gcc.target/i386/pr56118.c: New testcase.
2015-11-10 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* gcc.target/aarch64/cond_op_imm_1.c: New test.
......
/* { dg-do compile } */
/* { dg-options "-O3 -msse2" } */
#include <emmintrin.h>
__m128d f()
{
__m128d r={3,4};
r[0]=1;
r[1]=2;
return r;
}
/* We want to "vectorize" this to a aligned vector load from the
constant pool. */
/* { dg-final { scan-assembler "movapd" } } */
......@@ -2317,9 +2317,12 @@ vect_bb_vectorization_profitable_p (bb_vec_info bb_vinfo)
dump_printf (MSG_NOTE, " Scalar cost of basic block: %d\n", scalar_cost);
}
/* Vectorization is profitable if its cost is less than the cost of scalar
version. */
if (vec_outside_cost + vec_inside_cost >= scalar_cost)
/* Vectorization is profitable if its cost is more than the cost of scalar
version. Note that we err on the vector side for equal cost because
the cost estimate is otherwise quite pessimistic (constant uses are
free on the scalar side but cost a load on the vector side for
example). */
if (vec_outside_cost + vec_inside_cost > scalar_cost)
return false;
return true;
......
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