public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix PR tree-optimization/71179
@ 2016-05-20  2:13 Kugan Vivekanandarajah
  2016-05-20  9:30 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Kugan Vivekanandarajah @ 2016-05-20  2:13 UTC (permalink / raw)
  To: gcc-patches; +Cc: Richard Biener

[-- Attachment #1: Type: text/plain, Size: 732 bytes --]

Hi,

We don’t allow vector type for integer. Likewise I am also disallowing
the floating point vector type in transforming repeated addition to
multiplication.

This can be relaxed. I will send a separate patch to allow integer and
floating point vectorization later.

Bootstrapped and regression tested on x86-64-linux-gnu with no new regressions.

Is this OK for trunk?

Thanks,
Kugan

gcc/testsuite/ChangeLog:

2016-05-20  Kugan Vivekanandarajah  <kugan.vivekanandarajah@linaro.org>

    * gcc.dg/tree-ssa/pr71179.c: New test.

gcc/ChangeLog:

2016-05-20  Kugan Vivekanandarajah  <kugan.vivekanandarajah@linaro.org>

    * tree-ssa-reassoc.c (transform_add_to_multiply): Disallow float
VECTOR type.

[-- Attachment #2: pr71179.txt --]
[-- Type: text/plain, Size: 949 bytes --]

diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr71179.c b/gcc/testsuite/gcc.dg/tree-ssa/pr71179.c
index e69de29..885c643 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr71179.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr71179.c
@@ -0,0 +1,10 @@
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -ffast-math" } */
+
+typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__));
+
+__m128 foo (__m128 a)
+{
+  return a + a;
+}
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c
index 3b5f36b..0c25a8c 100644
--- a/gcc/tree-ssa-reassoc.c
+++ b/gcc/tree-ssa-reassoc.c
@@ -1769,7 +1769,8 @@ transform_add_to_multiply (gimple *stmt, vec<operand_entry *> *ops)
   bool changed = false;
 
   if (!INTEGRAL_TYPE_P (TREE_TYPE ((*ops)[0]->op))
-      && !flag_unsafe_math_optimizations)
+      && (!SCALAR_FLOAT_TYPE_P (TREE_TYPE ((*ops)[0]->op))
+	  || !flag_unsafe_math_optimizations))
     return false;
 
   /* Look for repeated operands.  */

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix PR tree-optimization/71179
  2016-05-20  2:13 [PATCH] Fix PR tree-optimization/71179 Kugan Vivekanandarajah
@ 2016-05-20  9:30 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2016-05-20  9:30 UTC (permalink / raw)
  To: Kugan Vivekanandarajah; +Cc: gcc-patches

On Fri, May 20, 2016 at 4:13 AM, Kugan Vivekanandarajah
<kugan.vivekanandarajah@linaro.org> wrote:
> Hi,
>
> We don’t allow vector type for integer. Likewise I am also disallowing
> the floating point vector type in transforming repeated addition to
> multiplication.
>
> This can be relaxed. I will send a separate patch to allow integer and
> floating point vectorization later.
>
> Bootstrapped and regression tested on x86-64-linux-gnu with no new regressions.
>
> Is this OK for trunk?

Ok.

Thanks,
Richard.

> Thanks,
> Kugan
>
> gcc/testsuite/ChangeLog:
>
> 2016-05-20  Kugan Vivekanandarajah  <kugan.vivekanandarajah@linaro.org>
>
>     * gcc.dg/tree-ssa/pr71179.c: New test.
>
> gcc/ChangeLog:
>
> 2016-05-20  Kugan Vivekanandarajah  <kugan.vivekanandarajah@linaro.org>
>
>     * tree-ssa-reassoc.c (transform_add_to_multiply): Disallow float
> VECTOR type.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-20  9:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-20  2:13 [PATCH] Fix PR tree-optimization/71179 Kugan Vivekanandarajah
2016-05-20  9:30 ` Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).