diff options
author | Ilya Enkovich <enkovich.gnu@gmail.com> | 2015-10-21 15:57:00 +0000 |
---|---|---|
committer | Ilya Enkovich <ienkovich@gcc.gnu.org> | 2015-10-21 15:57:00 +0000 |
commit | 6f9045f4e16df8791ae67e0508b61accc4c982c2 (patch) | |
tree | 9340e02338d4af72c0dc29692ea7986474164355 | |
parent | cbb5c732c20e385bf3d0bf04b533b22281a7dde2 (diff) | |
download | gcc-6f9045f4e16df8791ae67e0508b61accc4c982c2.zip gcc-6f9045f4e16df8791ae67e0508b61accc4c982c2.tar.gz gcc-6f9045f4e16df8791ae67e0508b61accc4c982c2.tar.bz2 |
omp-low.c (simd_clone_create): Set in_other_partition for created clones.
gcc/
* omp-low.c (simd_clone_create): Set in_other_partition
for created clones.
gcc/testsuite/
* gcc.dg/lto/simd-function_0.c: New test.
From-SVN: r229127
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/omp-low.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/lto/simd-function_0.c | 34 |
4 files changed, 45 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1c27b69..2971405 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-10-21 Ilya Enkovich <enkovich.gnu@gmail.com> + + * omp-low.c (simd_clone_create): Set in_other_partition + for created clones. + 2015-10-21 David Wohlferd <dw@LimeGreenSocks.com> * doc/extend.exp (Local Register Variables): Rewrite. diff --git a/gcc/omp-low.c b/gcc/omp-low.c index b444864..b71609b7 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -16318,6 +16318,8 @@ simd_clone_create (struct cgraph_node *old_node) DECL_STATIC_CONSTRUCTOR (new_decl) = 0; DECL_STATIC_DESTRUCTOR (new_decl) = 0; new_node = old_node->create_version_clone (new_decl, vNULL, NULL); + if (old_node->in_other_partition) + new_node->in_other_partition = 1; symtab->call_cgraph_insertion_hooks (new_node); } if (new_node == NULL) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7b3afbb..ed725ee 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2015-10-21 Ilya Enkovich <enkovich.gnu@gmail.com> + + * gcc.dg/lto/simd-function_0.c: New test. + 2015-10-21 Uros Bizjak <ubizjak@gmail.com> PR target/68018 diff --git a/gcc/testsuite/gcc.dg/lto/simd-function_0.c b/gcc/testsuite/gcc.dg/lto/simd-function_0.c new file mode 100644 index 0000000..cda31aa --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/simd-function_0.c @@ -0,0 +1,34 @@ +/* { dg-lto-do link } */ +/* { dg-require-effective-target avx2 } */ +/* { dg-lto-options { { -fopenmp-simd -O3 -ffast-math -mavx2 -flto -flto-partition=max } } } */ + +#define SIZE 4096 +float x[SIZE]; + + +#pragma omp declare simd +float +__attribute__ ((noinline)) +my_mul (float x, float y) { + return x * y; +} + +__attribute__ ((noinline)) +int foo () +{ + int i = 0; +#pragma omp simd safelen (16) + for (i = 0; i < SIZE; i++) + x[i] = my_mul ((float)i, 9932.3323); + return (int)x[0]; +} + +int main () +{ + int i = 0; + for (i = 0; i < SIZE; i++) + x[i] = my_mul ((float) i, 9932.3323); + foo (); + return (int)x[0]; +} + |