public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Adjust testcase for O2 vectorization enabling.
@ 2021-10-11  5:19 liuhongt
  2021-10-11 12:09 ` H.J. Lu
  0 siblings, 1 reply; 5+ messages in thread
From: liuhongt @ 2021-10-11  5:19 UTC (permalink / raw)
  To: gcc-patches

gcc/testsuite/ChangeLog:

	PR middle-end/102669
	* gnat.dg/unroll1.adb: Add -fno-tree-vectorize.
---
 gcc/testsuite/gnat.dg/unroll1.adb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/testsuite/gnat.dg/unroll1.adb b/gcc/testsuite/gnat.dg/unroll1.adb
index 34d8a8f3f38..8b732dd8f44 100644
--- a/gcc/testsuite/gnat.dg/unroll1.adb
+++ b/gcc/testsuite/gnat.dg/unroll1.adb
@@ -1,5 +1,5 @@
 -- { dg-do compile }
--- { dg-options "-O2 -funroll-all-loops -fdump-rtl-loop2_unroll-details -fdump-tree-cunrolli-details" }
+-- { dg-options "-O2 -funroll-all-loops -fno-tree-vectorize -fdump-rtl-loop2_unroll-details -fdump-tree-cunrolli-details" }
 
 package body Unroll1 is
 
-- 
2.18.1


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

* Re: [PATCH] Adjust testcase for O2 vectorization enabling.
  2021-10-11  5:19 [PATCH] Adjust testcase for O2 vectorization enabling liuhongt
@ 2021-10-11 12:09 ` H.J. Lu
  0 siblings, 0 replies; 5+ messages in thread
From: H.J. Lu @ 2021-10-11 12:09 UTC (permalink / raw)
  To: liuhongt; +Cc: GCC Patches, Hongtao Liu

On Sun, Oct 10, 2021 at 10:19 PM liuhongt <hongtao.liu@intel.com> wrote:
>
> gcc/testsuite/ChangeLog:
>
>         PR middle-end/102669
>         * gnat.dg/unroll1.adb: Add -fno-tree-vectorize.
> ---
>  gcc/testsuite/gnat.dg/unroll1.adb | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gcc/testsuite/gnat.dg/unroll1.adb b/gcc/testsuite/gnat.dg/unroll1.adb
> index 34d8a8f3f38..8b732dd8f44 100644
> --- a/gcc/testsuite/gnat.dg/unroll1.adb
> +++ b/gcc/testsuite/gnat.dg/unroll1.adb
> @@ -1,5 +1,5 @@
>  -- { dg-do compile }
> --- { dg-options "-O2 -funroll-all-loops -fdump-rtl-loop2_unroll-details -fdump-tree-cunrolli-details" }
> +-- { dg-options "-O2 -funroll-all-loops -fno-tree-vectorize -fdump-rtl-loop2_unroll-details -fdump-tree-cunrolli-details" }
>
>  package body Unroll1 is

Should no-unroll pragma work with -ftree-vectorize?


-- 
H.J.

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

* Re: [PATCH] Adjust testcase for O2 vectorization enabling
  2021-10-11  2:22   ` Kewen.Lin
@ 2021-10-11  2:39     ` Hongtao Liu
  0 siblings, 0 replies; 5+ messages in thread
From: Hongtao Liu @ 2021-10-11  2:39 UTC (permalink / raw)
  To: Kewen.Lin; +Cc: Hongtao Liu, GCC Patches

On Mon, Oct 11, 2021 at 10:23 AM Kewen.Lin via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> Hi Hongtao,
>
> on 2021/10/11 上午10:10, liuhongt via Gcc-patches wrote:
> > libgomp/ChangeLog:
> >
> >       * testsuite/libgomp.graphite/force-parallel-8.c: Add -fno-tree-vectorize.
> > ---
> >  libgomp/testsuite/libgomp.graphite/force-parallel-8.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libgomp/testsuite/libgomp.graphite/force-parallel-8.c b/libgomp/testsuite/libgomp.graphite/force-parallel-8.c
> > index f9e07039172..0f3d138cebd 100644
> > --- a/libgomp/testsuite/libgomp.graphite/force-parallel-8.c
> > +++ b/libgomp/testsuite/libgomp.graphite/force-parallel-8.c
> > @@ -1,4 +1,4 @@
> > -/* { dg-additional-options "-fdisable-tree-thread1 -fdisable-tree-vrp-thread1" } */
> > +/* { dg-additional-options "-fdisable-tree-thread1 -fdisable-tree-vrp-thread1 -fno-tree-vectorize" } */
> >
> >  #define N 1500
> >
> >
>
> Thanks for doing this!
>
> This issue was observed in rs6000 specific PR102658 as well.
>
> I've looked into it a bit, it's caused by the "conditional store replacement" which
> is originally disabled without vectorization as below code.
>
>   /* If either vectorization or if-conversion is disabled then do
>      not sink any stores.  */
>   if (param_max_stores_to_sink == 0
>       || (!flag_tree_loop_vectorize && !flag_tree_slp_vectorize)
>       || !flag_tree_loop_if_convert)
>     return false;
>
> The new change makes the innermost loop look like
>
> for (int c1 = 0; c1 <= 1499; c1 += 1) {
>   if (c1 <= 500) {
>      S_10(c0, c1);
>   } else {
>       S_9(c0, c1);
>   }
>   S_11(c0, c1);
> }
>
> and can not be splitted as:
>
> for (int c1 = 0; c1 <= 500; c1 += 1)
>   S_10(c0, c1);
>
> for (int c1 = 501; c1 <= 1499; c1 += 1)
>   S_9(c0, c1);
>
> So instead of disabling vectorization, could we just disable this cs replacement
> with parameter "--param max-stores-to-sink=0"?
>
> I tested this proposal on ppc64le, it should work as well.
>
> What do you think of it?
I can confirm it also works for x86, I'll adjust the patch.
Thank you for the analysis.
>
> BR,
> Kewen



-- 
BR,
Hongtao

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

* Re: [PATCH] Adjust testcase for O2 vectorization enabling
  2021-10-11  2:10 ` [PATCH] Adjust testcase " liuhongt
@ 2021-10-11  2:22   ` Kewen.Lin
  2021-10-11  2:39     ` Hongtao Liu
  0 siblings, 1 reply; 5+ messages in thread
From: Kewen.Lin @ 2021-10-11  2:22 UTC (permalink / raw)
  To: Hongtao Liu; +Cc: gcc-patches, H.J. Lu, Richard Biener

Hi Hongtao,

on 2021/10/11 上午10:10, liuhongt via Gcc-patches wrote:
> libgomp/ChangeLog:
> 
> 	* testsuite/libgomp.graphite/force-parallel-8.c: Add -fno-tree-vectorize.
> ---
>  libgomp/testsuite/libgomp.graphite/force-parallel-8.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libgomp/testsuite/libgomp.graphite/force-parallel-8.c b/libgomp/testsuite/libgomp.graphite/force-parallel-8.c
> index f9e07039172..0f3d138cebd 100644
> --- a/libgomp/testsuite/libgomp.graphite/force-parallel-8.c
> +++ b/libgomp/testsuite/libgomp.graphite/force-parallel-8.c
> @@ -1,4 +1,4 @@
> -/* { dg-additional-options "-fdisable-tree-thread1 -fdisable-tree-vrp-thread1" } */
> +/* { dg-additional-options "-fdisable-tree-thread1 -fdisable-tree-vrp-thread1 -fno-tree-vectorize" } */
>  
>  #define N 1500
>  
> 

Thanks for doing this!

This issue was observed in rs6000 specific PR102658 as well.

I've looked into it a bit, it's caused by the "conditional store replacement" which
is originally disabled without vectorization as below code.

  /* If either vectorization or if-conversion is disabled then do
     not sink any stores.  */
  if (param_max_stores_to_sink == 0
      || (!flag_tree_loop_vectorize && !flag_tree_slp_vectorize)
      || !flag_tree_loop_if_convert)
    return false;

The new change makes the innermost loop look like

for (int c1 = 0; c1 <= 1499; c1 += 1) {
  if (c1 <= 500) {
     S_10(c0, c1);
  } else {
      S_9(c0, c1);
  }
  S_11(c0, c1);
} 

and can not be splitted as:

for (int c1 = 0; c1 <= 500; c1 += 1)
  S_10(c0, c1);

for (int c1 = 501; c1 <= 1499; c1 += 1)
  S_9(c0, c1);

So instead of disabling vectorization, could we just disable this cs replacement
with parameter "--param max-stores-to-sink=0"?

I tested this proposal on ppc64le, it should work as well.

What do you think of it?

BR,
Kewen

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

* [PATCH] Adjust testcase for O2 vectorization enabling
  2021-10-09 21:36 [PATCH] Adjust more testcases " H.J. Lu
@ 2021-10-11  2:10 ` liuhongt
  2021-10-11  2:22   ` Kewen.Lin
  0 siblings, 1 reply; 5+ messages in thread
From: liuhongt @ 2021-10-11  2:10 UTC (permalink / raw)
  To: gcc-patches

libgomp/ChangeLog:

	* testsuite/libgomp.graphite/force-parallel-8.c: Add -fno-tree-vectorize.
---
 libgomp/testsuite/libgomp.graphite/force-parallel-8.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libgomp/testsuite/libgomp.graphite/force-parallel-8.c b/libgomp/testsuite/libgomp.graphite/force-parallel-8.c
index f9e07039172..0f3d138cebd 100644
--- a/libgomp/testsuite/libgomp.graphite/force-parallel-8.c
+++ b/libgomp/testsuite/libgomp.graphite/force-parallel-8.c
@@ -1,4 +1,4 @@
-/* { dg-additional-options "-fdisable-tree-thread1 -fdisable-tree-vrp-thread1" } */
+/* { dg-additional-options "-fdisable-tree-thread1 -fdisable-tree-vrp-thread1 -fno-tree-vectorize" } */
 
 #define N 1500
 
-- 
2.18.1


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

end of thread, other threads:[~2021-10-11 12:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-11  5:19 [PATCH] Adjust testcase for O2 vectorization enabling liuhongt
2021-10-11 12:09 ` H.J. Lu
  -- strict thread matches above, loose matches on Subject: below --
2021-10-09 21:36 [PATCH] Adjust more testcases " H.J. Lu
2021-10-11  2:10 ` [PATCH] Adjust testcase " liuhongt
2021-10-11  2:22   ` Kewen.Lin
2021-10-11  2:39     ` Hongtao Liu

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).