From 414fef4e668856edb8ca885525679c5d5e691fd1 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Thu, 8 Feb 2018 12:53:19 +0000 Subject: [PATCH] re PR target/84278 (claims initv4sfv2sf is available but inits through stack) 2018-02-08 Richard Biener PR tree-optimization/84278 * tree-vect-stmts.c (vectorizable_store): When looking for smaller vector types to perform grouped strided loads/stores make sure the mode is supported by the target. (vectorizable_load): Likewise. * gcc.target/i386/pr84278.c: New testcase. From-SVN: r257483 --- gcc/ChangeLog | 8 ++++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/i386/pr84278.c | 18 ++++++++++++++++++ gcc/tree-vect-stmts.c | 4 ++++ 4 files changed, 35 insertions(+) create mode 100644 gcc/testsuite/gcc.target/i386/pr84278.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ef2f46ef0d7..4d65b9435a5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2018-02-08 Richard Biener + + PR tree-optimization/84278 + * tree-vect-stmts.c (vectorizable_store): When looking for + smaller vector types to perform grouped strided loads/stores + make sure the mode is supported by the target. + (vectorizable_load): Likewise. + 2018-02-08 Wilco Dijkstra * config/aarch64/aarch64.c (aarch64_components_for_bb): diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c2eb50f453c..5146f7ba612 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-02-08 Richard Biener + + PR tree-optimization/84278 + * gcc.target/i386/pr84278.c: New testcase. + 2018-02-08 Wilco Dijkstra PR rtl-optimization/84068 diff --git a/gcc/testsuite/gcc.target/i386/pr84278.c b/gcc/testsuite/gcc.target/i386/pr84278.c new file mode 100644 index 00000000000..31e6288af05 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr84278.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -msse2" } */ + +float A[1024]; +float B[1024]; +int s; + +void foo(void) +{ + int i; + for (i = 0; i < 128; i++) + { + B[i*2+0] = A[i*s+0]; + B[i*2+1] = A[i*s+1]; + } +} + +/* { dg-final { scan-assembler-not "\(%.sp\)" } } */ diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index 64a728eb129..c5085ca9c0a 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -6510,6 +6510,7 @@ vectorizable_store (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt, machine_mode vmode; if (!mode_for_vector (elmode, group_size).exists (&vmode) || !VECTOR_MODE_P (vmode) + || !targetm.vector_mode_supported_p (vmode) || (convert_optab_handler (vec_extract_optab, TYPE_MODE (vectype), vmode) == CODE_FOR_nothing)) @@ -6528,6 +6529,7 @@ vectorizable_store (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt, element size stores. */ if (mode_for_vector (elmode, lnunits).exists (&vmode) && VECTOR_MODE_P (vmode) + && targetm.vector_mode_supported_p (vmode) && (convert_optab_handler (vec_extract_optab, vmode, elmode) != CODE_FOR_nothing)) @@ -7573,6 +7575,7 @@ vectorizable_load (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt, machine_mode vmode; if (mode_for_vector (elmode, group_size).exists (&vmode) && VECTOR_MODE_P (vmode) + && targetm.vector_mode_supported_p (vmode) && (convert_optab_handler (vec_init_optab, TYPE_MODE (vectype), vmode) != CODE_FOR_nothing)) @@ -7598,6 +7601,7 @@ vectorizable_load (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt, element loads of the original vector type. */ if (mode_for_vector (elmode, lnunits).exists (&vmode) && VECTOR_MODE_P (vmode) + && targetm.vector_mode_supported_p (vmode) && (convert_optab_handler (vec_init_optab, vmode, elmode) != CODE_FOR_nothing)) { -- 2.30.2