This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Allow non-overflow ops in vect_is_simple_reduction_1
- From: Tom de Vries <Tom_deVries at mentor dot com>
- To: "gcc-patches at gnu dot org" <gcc-patches at gnu dot org>
- Date: Sun, 26 Jul 2015 18:49:09 +0200
- Subject: Re: [PATCH] Allow non-overflow ops in vect_is_simple_reduction_1
- Authentication-results: sourceware.org; auth=none
- References: <55B24E1F dot 1070705 at mentor dot com>
On 24/07/15 16:39, Tom de Vries wrote:
Hi,
this patch allows parallelization and vectorization of reduction
operators that are guaranteed to not overflow (such as min and max
operators), independent of the overflow behaviour of the type.
Bootstrapped and reg-tested on x86_64.
OK for trunk?
Thanks,
- Tom
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(-)
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index c583f16..531c848 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -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