aboutsummaryrefslogtreecommitdiff
path: root/gcc/graphite-sese-to-poly.c
diff options
context:
space:
mode:
authorvries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>2015-08-01 08:29:29 +0000
committervries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>2015-08-01 08:29:29 +0000
commit5955834f8d62c6f1d5f3921c6fd6c5e56032639b (patch)
tree0353ecb04dbb4fcc695e28eb9c4d13e340815664 /gcc/graphite-sese-to-poly.c
parent4691a5303dc8ea741d6c05262a7bb0a4245742e6 (diff)
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@226463 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/graphite-sese-to-poly.c')
-rw-r--r--gcc/graphite-sese-to-poly.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index c583f167157..fdcc790336c 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -2614,8 +2614,11 @@ is_reduction_operation_p (gimple stmt)
if (FLOAT_TYPE_P (type))
return flag_associative_math;
- return (INTEGRAL_TYPE_P (type)
- && TYPE_OVERFLOW_WRAPS (type));
+ if (ANY_INTEGRAL_TYPE_P (type))
+ return (TYPE_OVERFLOW_WRAPS (type)
+ || !operation_can_overflow (code));
+
+ return false;
}
/* Returns true when PHI contains an argument ARG. */