Handle non-overflow reductions in graphite
2015-07-21 Tom de Vries <tom@codesourcery.com>
* graphite-sese-to-poly.c (is_reduction_operation_p): Allow operations
that do not overflow.
---
gcc/graphite-sese-to-poly.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
@@ -2614,8 +2614,19 @@ 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))
+ {
+ if (INTEGRAL_TYPE_P (type)
+ && TYPE_OVERFLOW_WRAPS (type))
+ return true;
+
+ if (no_overflow_tree_code (code, type))
+ return true;
+
+ return false;
+ }
+
+ return false;
}
/* Returns true when PHI contains an argument ARG. */
--
1.9.1