public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Hongtao Liu <crazylht@gmail.com>
To: "Kewen.Lin" <linkw@linux.ibm.com>
Cc: liuhongt <hongtao.liu@intel.com>, GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Adjust testcase for O2 vectorization.
Date: Mon, 18 Oct 2021 12:47:33 +0800	[thread overview]
Message-ID: <CAMZc-bw9hO2GyckvhB5VMjRG4KRqtWSrz5eLvqcFOytxENgmww@mail.gmail.com> (raw)
In-Reply-To: <83dd5945-9f20-b966-a050-0d22742e9c14@linux.ibm.com>

On Fri, Oct 15, 2021 at 3:11 PM Kewen.Lin via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> on 2021/10/14 下午6:56, Kewen.Lin via Gcc-patches wrote:
> > Hi Hongtao,
> >
> > on 2021/10/14 下午3:11, liuhongt wrote:
> >> Hi Kewen:
> >>   Cound you help to verify if this patch fix those regressions
> >> for rs6000 port.
> >>
> >
> > The ppc64le run just finished, there are still some regresssions:
> >
> > NA->XPASS: c-c++-common/Wstringop-overflow-2.c  -Wc++-compat   (test for warnings, line 194)
> > NA->XPASS: c-c++-common/Wstringop-overflow-2.c  -Wc++-compat   (test for warnings, line 212)
> > NA->XPASS: c-c++-common/Wstringop-overflow-2.c  -Wc++-compat   (test for warnings, line 296)
> > NA->XPASS: c-c++-common/Wstringop-overflow-2.c  -Wc++-compat   (test for warnings, line 314)
> > NA->FAIL: gcc.dg/Wstringop-overflow-21-novec.c (test for excess errors)
> > NA->FAIL: gcc.dg/Wstringop-overflow-21-novec.c  (test for warnings, line 18)
> > NA->FAIL: gcc.dg/Wstringop-overflow-21-novec.c  (test for warnings, line 29)
> > NA->FAIL: gcc.dg/Wstringop-overflow-21-novec.c  (test for warnings, line 45)
> > NA->FAIL: gcc.dg/Wstringop-overflow-21-novec.c  (test for warnings, line 55)
> > NA->FAIL: gcc.dg/Wstringop-overflow-76-novec.c note (test for warnings, line 104)
> > NA->FAIL: gcc.dg/Wstringop-overflow-76-novec.c note (test for warnings, line 137)
> > NA->FAIL: gcc.dg/Wstringop-overflow-76-novec.c note (test for warnings, line 19)
> > NA->FAIL: gcc.dg/Wstringop-overflow-76-novec.c note (test for warnings, line 39)
> > NA->FAIL: gcc.dg/Wstringop-overflow-76-novec.c note (test for warnings, line 56)
> > NA->FAIL: gcc.dg/Wstringop-overflow-76-novec.c note (test for warnings, line 70)
> > NA->FAIL: gcc.dg/Wstringop-overflow-76-novec.c (test for excess errors)
> > NA->FAIL: gcc.dg/Wstringop-overflow-76-novec.c  (test for warnings, line 116)
> > NA->FAIL: gcc.dg/Wstringop-overflow-76-novec.c  (test for warnings, line 131)
> > NA->FAIL: gcc.dg/Wstringop-overflow-76-novec.c  (test for warnings, line 146)
> > NA->FAIL: gcc.dg/Wstringop-overflow-76-novec.c  (test for warnings, line 33)
> > NA->FAIL: gcc.dg/Wstringop-overflow-76-novec.c  (test for warnings, line 50)
> > NA->FAIL: gcc.dg/Wstringop-overflow-76-novec.c  (test for warnings, line 64)
> > NA->FAIL: gcc.dg/Wstringop-overflow-76-novec.c  (test for warnings, line 78)
> > NA->FAIL: gcc.dg/Wstringop-overflow-76-novec.c  (test for warnings, line 97)
> > PASS->FAIL: c-c++-common/Wstringop-overflow-2.c  -std=gnu++14 (test for excess errors)
> > NA->FAIL: c-c++-common/Wstringop-overflow-2.c  -std=gnu++14  (test for warnings, line 229)
> > NA->FAIL: c-c++-common/Wstringop-overflow-2.c  -std=gnu++14  (test for warnings, line 230)
> > NA->FAIL: c-c++-common/Wstringop-overflow-2.c  -std=gnu++14  (test for warnings, line 331)
> > NA->FAIL: c-c++-common/Wstringop-overflow-2.c  -std=gnu++14  (test for warnings, line 332)
> > // omitting -std=gnu++17, -std=gnu++2a, -std=gnu++98
> >
> > I'll have a look and get back to you tomorrow.
> >
>
> The failure c-c++-common/Wstringop-overflow-2.c is due to that the
> current proc check_vect_slp_vnqihi_store_usage is made as "cache"
> but it can vary for different input patterns.  For rs6000 the test
> for v2qi fails, the cached test result makes v4qi check fail
> unexpectedly (should pass).  I adjusted caching for the following users
> check_effective_target_vect_slp_v*_store, also refactored a bit.
> One trivial change is to add one new argument macro then we can just
> compile the corresponding foo* function instead of all, hope it helps
> to make the debugging outputs compact.
>
> For the failure Wstringop-overflow-76-novec.c, there is one typo
> comparing to the original Wstringop-overflow-76.c.  Guess it failed
> on x86 too?  It would be surprising if it passes on x86.
> As to the failure Wstringop-overflow-21-novec.c, I confirmed it's
> just noise, patching typos caused this failure.
Thanks for the explanation for  those failures and the typo, i'll
adjust the patch.
>
> One new round ppc64le testing just finished with below diff and all
> previous regressions are fixed without any new regressions.
>
>
> diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-76-novec.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-76-novec.c
> index d000b587a65..1132348c5f4 100644
> --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-76-novec.c
> +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-76-novec.c
> @@ -82,7 +82,7 @@ void max_d8_p (char *q, int i)
>  struct A3_5
>  {
>    char a3[3];  // { dg-message "at offset 3 into destination object 'a3' of size 3" "pr??????" { xfail *-*-* } }
> -  char a5[5];
> +  char a5[5];  // { dg-message "at offset 5 into destination object 'a5' of size 5" "note" }
>  };
>
>  void max_A3_A5 (int i, struct A3_5 *pa3_5)
> diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
> index 530c5769614..8736b908ec7 100644
> --- a/gcc/testsuite/lib/target-supports.exp
> +++ b/gcc/testsuite/lib/target-supports.exp
> @@ -7584,12 +7584,13 @@ proc check_effective_target_vect_element_align_preferred { } {
>  # Return zero if the desirable pattern isn't found.
>  # It's used by Warray-bounds/Wstringop-overflow testcases which are
>  # regressed by O2 vectorization, refer to PR102697/PR102462/PR102706
> -proc check_vect_slp_vnqihi_store_usage { pattern } {
> +proc check_vect_slp_vnqihi_store_usage { pattern macro } {
>      global tool
>
> -    return [check_cached_effective_target slp_vnqihi_store_usage {
> -      set result [check_compile slp_vnqihi_store_usage assembly {
> +    set result [check_compile slp_vnqihi_store_usage assembly {
>           char a[16] __attribute__ ((aligned (16)));
> +         short b[4] __attribute__((aligned(8)));
> +         #ifdef TEST_V8QI
>           void
>           foo ()
>           {
> @@ -7602,7 +7603,7 @@ proc check_vect_slp_vnqihi_store_usage { pattern } {
>               a[6] = 6;
>               a[7] = 7;
>           }
> -
> +         #elif TEST_V16QI
>           void
>           foo1 ()
>           {
> @@ -7623,7 +7624,7 @@ proc check_vect_slp_vnqihi_store_usage { pattern } {
>               a[14] = 14;
>               a[15] = 15;
>           }
> -
> +         #elif TEST_V4QI
>           void
>           foo2 ()
>           {
> @@ -7632,22 +7633,21 @@ proc check_vect_slp_vnqihi_store_usage { pattern } {
>               a[2] = 2;
>               a[3] = 3;
>           }
> -
> +         #elif TEST_V2QI
>           void
>           foo3 ()
>           {
>               a[0] = 0;
>               a[1] = 1;
>           }
> -
> -         short b[4] __attribute__((aligned(8)));
> +         #elif TEST_V2HI
>           void
>           foo4 ()
>           {
>               b[0] = 0;
>               b[1] = 1;
>           }
> -
> +         #elif TEST_V4HI
>           void
>           foo5 ()
>           {
> @@ -7656,57 +7656,69 @@ proc check_vect_slp_vnqihi_store_usage { pattern } {
>               b[2] = 2;
>               b[3] = 3;
>           }
> +         #endif
>
> -      } "-O2 -fopt-info-all" ]
> +      } "-O2 -fopt-info-all -D$macro" ]
>
>        # Get compiler emitted messages and delete generated file.
>        set lines [lindex $result 0]
>        set output [lindex $result 1]
>        remote_file build delete $output
>
> -      # Capture the vectorized info of v2qi, set it to zero if not found.
> -       if { ![regexp $pattern $lines whole val] } then {
> -         set val 0
> +      # Check pattern exits in lines, set it to zero if not found.
> +      if { [regexp $pattern $lines] } then {
> +        return 1
>        }
>
> -      return $val
> -    }]
> +      return 0
>  }
>
>  # Return the true if target support vectorization of v2qi store.
>  proc check_effective_target_vect_slp_v2qi_store { } {
>      set pattern {add new stmt: MEM <vector\(2\) char>}
> -    return [expr { [check_vect_slp_vnqihi_store_usage $pattern ] != 0 }]
> +    set macro "TEST_V2QI"
> +    return [check_cached_effective_target vect_slp_v2qi_store {
> +           expr [check_vect_slp_vnqihi_store_usage $pattern $macro] }]
>  }
>
>  # Return the true if target support vectorization of v4qi store.
>  proc check_effective_target_vect_slp_v4qi_store { } {
>      set pattern {add new stmt: MEM <vector\(4\) char>}
> -    return [expr { [check_vect_slp_vnqihi_store_usage $pattern ] != 0 }]
> +    set macro "TEST_V4QI"
> +    return [check_cached_effective_target vect_slp_v4qi_store {
> +           expr [check_vect_slp_vnqihi_store_usage $pattern $macro ] }]
>  }
>
> -# Return the true if target support vectorization of v2qi store.
> +# Return the true if target support vectorization of v8qi store.
>  proc check_effective_target_vect_slp_v8qi_store { } {
>      set pattern {add new stmt: MEM <vector\(8\) char>}
> -    return [expr { [check_vect_slp_vnqihi_store_usage $pattern ] != 0 }]
> +    set macro "TEST_V8QI"
> +    return [check_cached_effective_target_vect_slp_v8qi_store {
> +           expr [check_vect_slp_vnqihi_store_usage $pattern $macro ] }]
>  }
>
> -# Return the true if target support vectorization of v4qi store.
> +# Return the true if target support vectorization of v16qi store.
>  proc check_effective_target_vect_slp_v16qi_store { } {
>      set pattern {add new stmt: MEM <vector\(16\) char>}
> -    return [expr { [check_vect_slp_vnqihi_store_usage $pattern ] != 0 }]
> +    set macro "TEST_V16QI"
> +    return [check_cached_effective_target_vect_slp_v16qi_store {
> +           expr [check_vect_slp_vnqihi_store_usage $pattern $macro ] }]
>  }
>
>  # Return the true if target support vectorization of v2hi store.
>  proc check_effective_target_vect_slp_v2hi_store { } {
>      set pattern {add new stmt: MEM <vector\(2\) short int>}
> -    return [expr { [check_vect_slp_vnqihi_store_usage $pattern ] != 0 }]
> +    set macro "TEST_V2HI"
> +    return [check_cached_effective_target_vect_slp_v2hi_store {
> +           expr [check_vect_slp_vnqihi_store_usage $pattern $macro ] }]
>  }
>
> -# Return the true if target support vectorization of v2hi store.
> +# Return the true if target support vectorization of v4hi store.
>  proc check_effective_target_vect_slp_v4hi_store { } {
>      set pattern {add new stmt: MEM <vector\(4\) short int>}
> -    return [expr { [check_vect_slp_vnqihi_store_usage $pattern ] != 0 }]
> +    set macro "TEST_V4HI"
> +    return [check_cached_effective_target_vect_slp_v4hi_store {
> +           expr [check_vect_slp_vnqihi_store_usage $pattern $macro ] }]
>  }
>
>
>
> BR,
> Kewen



-- 
BR,
Hongtao

  reply	other threads:[~2021-10-18  4:40 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-11  2:47 [PATCH] rs6000/test: Adjust some cases due to O2 vect [PR102658] Kewen.Lin
2021-10-11 15:30 ` Segher Boessenkool
2021-10-11 16:23   ` Martin Sebor
2021-10-11 17:43     ` Segher Boessenkool
2021-10-11 20:07       ` Martin Sebor
2021-10-12  2:31         ` Hongtao Liu
2021-10-12 15:49           ` Martin Sebor
2021-10-12 16:18             ` Segher Boessenkool
2021-10-12 17:15               ` Martin Sebor
2021-10-12 17:45                 ` Jeff Law
2021-10-12 18:01                 ` Segher Boessenkool
2021-10-13  3:34             ` Hongtao Liu
2021-10-13  6:29               ` Hongtao Liu
2021-10-13  7:43                 ` Kewen.Lin
2021-10-13 14:36                   ` Martin Sebor
2021-10-14  7:11                   ` [PATCH] Adjust testcase for O2 vectorization liuhongt
2021-10-14  7:52                     ` Bernhard Reutner-Fischer
2021-10-14 10:56                     ` Kewen.Lin
2021-10-15  7:11                       ` Kewen.Lin
2021-10-18  4:47                         ` Hongtao Liu [this message]
2021-10-15 15:37                     ` Martin Sebor
2021-10-18  4:38                       ` Hongtao Liu
2021-10-18 15:11                         ` Martin Sebor
2021-10-19  9:03                           ` liuhongt
2021-10-20 11:34                             ` Christophe Lyon
2021-10-21  1:20                               ` Hongtao Liu
2021-10-21  2:06                                 ` Hongtao Liu
2021-10-21  2:07                                   ` Hongtao Liu
2021-10-12 18:11         ` [PATCH] rs6000/test: Adjust some cases due to O2 vect [PR102658] Segher Boessenkool

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMZc-bw9hO2GyckvhB5VMjRG4KRqtWSrz5eLvqcFOytxENgmww@mail.gmail.com \
    --to=crazylht@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hongtao.liu@intel.com \
    --cc=linkw@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).