+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.
--- /dev/null
+/* { 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" } } */
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;