diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-05-29 08:21:17 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-05-29 08:21:17 +0000 |
commit | 32afb7481b917202765a05af5d89eb6e59bb95be (patch) | |
tree | 41ae1c0457832a11e435f1b4253c957229a17904 /gcc/testsuite/gcc.dg | |
parent | e6949193ae4ec66a1e51d0059ff70cdf52a89453 (diff) | |
download | gcc-32afb7481b917202765a05af5d89eb6e59bb95be.tar.gz |
2013-05-29 Richard Biener <rguenther@suse.de>
* tree-vect-slp.c (vect_bb_slp_scalar_cost): New function
computing scalar cost offsetted by stmts that are kept live
by scalar uses.
(vect_bb_vectorization_profitable_p): Use vect_bb_slp_scalar_cost
for computation of scalar cost.
* gcc.dg/vect/bb-slp-32.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@199402 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/bb-slp-32.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-32.c b/gcc/testsuite/gcc.dg/vect/bb-slp-32.c new file mode 100644 index 00000000000..df8008396a0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/bb-slp-32.c @@ -0,0 +1,23 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target vect_int } */ +/* { dg-additional-options "-fvect-cost-model" } */ + +void bar (int *); +int foo (int *p) +{ + int x[4]; + int tem0, tem1, tem2, tem3; + tem0 = p[0] + 1; + x[0] = tem0; + tem1 = p[1] + 2; + x[1] = tem1; + tem2 = p[2] + 3; + x[2] = tem2; + tem3 = p[3] + 4; + x[3] = tem3; + bar (x); + return tem0 + tem1 + tem2 + tem3; +} + +/* { dg-final { scan-tree-dump "vectorization is not profitable" "slp" } } */ +/* { dg-final { cleanup-tree-dump "slp" } } */ |