aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop.c
diff options
context:
space:
mode:
authorTom de Vries <tom@codesourcery.com>2015-08-01 08:29:29 +0000
committerTom de Vries <vries@gcc.gnu.org>2015-08-01 08:29:29 +0000
commit805134b9170b4ac563189c24b35fa4dc09853569 (patch)
tree0353ecb04dbb4fcc695e28eb9c4d13e340815664 /gcc/tree-vect-loop.c
parentfaf4ac3218fdf7d316d7bd8da121029ba60f0099 (diff)
downloadgcc-805134b9170b4ac563189c24b35fa4dc09853569.zip
gcc-805134b9170b4ac563189c24b35fa4dc09853569.tar.gz
gcc-805134b9170b4ac563189c24b35fa4dc09853569.tar.bz2
Allow non-overflow ops in reductions
2015-08-01 Tom de Vries <tom@codesourcery.com> * tree.c (operation_can_overflow, operation_no_trapping_overflow): New function. * tree.h (operation_can_overflow, operation_no_trapping_overflow): Declare. * tree-vect-loop.c (vect_is_simple_reduction_1): Use operation_no_trapping_overflow. Allow non-overflow operations. * graphite-sese-to-poly.c (is_reduction_operation_p): Allow non-overflow operations. * gcc.dg/autopar/reduc-2char.c (init_arrays): Mark with attribute optimize ("-ftree-parallelize-loops=0"). Add successful scans for 2 detected reductions. Add xfail scans for 3 detected reductions. * gcc.dg/autopar/reduc-2short.c: Same. * gcc.dg/autopar/reduc-8.c (init_arrays): Mark with attribute optimize ("-ftree-parallelize-loops=0"). Add successful scans for 2 detected reductions. * gcc.dg/vect/trapv-vect-reduc-4.c: Update scan to match vectorized min and max reductions. From-SVN: r226463
Diffstat (limited to 'gcc/tree-vect-loop.c')
-rw-r--r--gcc/tree-vect-loop.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index c31bfbd..59c75af 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -2615,7 +2615,7 @@ vect_is_simple_reduction_1 (loop_vec_info loop_info, gimple phi,
}
else if (INTEGRAL_TYPE_P (type) && check_reduction)
{
- if (TYPE_OVERFLOW_TRAPS (type))
+ if (!operation_no_trapping_overflow (type, code))
{
/* Changing the order of operations changes the semantics. */
if (dump_enabled_p ())
@@ -2624,7 +2624,9 @@ vect_is_simple_reduction_1 (loop_vec_info loop_info, gimple phi,
" (overflow traps): ");
return NULL;
}
- if (need_wrapping_integral_overflow && !TYPE_OVERFLOW_WRAPS (type))
+ if (need_wrapping_integral_overflow
+ && !TYPE_OVERFLOW_WRAPS (type)
+ && operation_can_overflow (code))
{
/* Changing the order of operations changes the semantics. */
if (dump_enabled_p ())