fix scalar BB vectorization costing
authorRichard Biener <rguenther@suse.de>
Fri, 3 Jul 2020 09:28:53 +0000 (11:28 +0200)
committerRichard Biener <rguenther@suse.de>
Fri, 3 Jul 2020 10:54:12 +0000 (12:54 +0200)
commit9bc2c2347d5d782c7362efe180ab002759e296c8
tree3263bf670ab56e7388d6e0e9a38838abd539b1fc
parentbf628a97efaf11204ab02527b30ca71d7759ca37
fix scalar BB vectorization costing

We were costing the scalar pattern stmts rather than the scalar
original stmt and also not appropriately looking at the pattern
stmt for whether the stmt is vectorized.

2020-07-03  Richard Biener  <rguenther@suse.de>

* tree-vect-slp.c (vect_bb_slp_scalar_cost): Cost the
original non-pattern stmts, look at the pattern stmt
vectorization status.

* gcc.dg/vect/costmodel/x86_64/costmodel-vect-slp-2.c: New
testcase.
gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-slp-2.c [new file with mode: 0644]
gcc/tree-vect-slp.c