diff options
author | Tom de Vries <tom@codesourcery.com> | 2015-08-24 13:14:17 +0000 |
---|---|---|
committer | Tom de Vries <vries@gcc.gnu.org> | 2015-08-24 13:14:17 +0000 |
commit | 6be5c241bbf8f3b6cec45f0b1074156822a96359 (patch) | |
tree | e8ba4654c7ecc7f4b815ad5cbf25b654f1dd4526 /libgomp | |
parent | 7373d132e1f364cb3ee2a045b6319a866f1e7d86 (diff) | |
download | gcc-6be5c241bbf8f3b6cec45f0b1074156822a96359.tar.gz |
Optimize expand_omp_for_static_chunk for chunk_size one
2015-08-24 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/65468
* omp-low.c (expand_omp_for_static_chunk): Remove inner loop if
chunk_size is one.
* gcc.dg/gomp/static-chunk-size-one.c: New test.
* testsuite/libgomp.c/static-chunk-size-one.c: New test.
From-SVN: r227124
Diffstat (limited to 'libgomp')
-rw-r--r-- | libgomp/ChangeLog | 5 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/static-chunk-size-one.c | 23 |
2 files changed, 28 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index bd9111b86a9..43aaa524c2a 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,8 @@ +2015-08-24 Tom de Vries <tom@codesourcery.com> + + PR tree-optimization/65468 + * testsuite/libgomp.c/static-chunk-size-one.c: New test. + 2015-08-24 Joost VandeVondele <vondele@gnu.gcc.org> PR libgomp/66761 diff --git a/libgomp/testsuite/libgomp.c/static-chunk-size-one.c b/libgomp/testsuite/libgomp.c/static-chunk-size-one.c new file mode 100644 index 00000000000..9ed7b83625a --- /dev/null +++ b/libgomp/testsuite/libgomp.c/static-chunk-size-one.c @@ -0,0 +1,23 @@ +extern void abort (); + +int +bar () +{ + int a = 0, i; + +#pragma omp parallel for num_threads (3) reduction (+:a) schedule(static, 1) + for (i = 0; i < 10; i++) + a += i; + + return a; +} + +int +main (void) +{ + int res; + res = bar (); + if (res != 45) + abort (); + return 0; +} |