public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Martin Sebor <msebor@gmail.com>
To: liuhongt <hongtao.liu@intel.com>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Adjust testcase for O2 vectorization.
Date: Fri, 15 Oct 2021 09:37:05 -0600	[thread overview]
Message-ID: <61ff5da7-a7af-40b6-85cc-fa230da6a33a@gmail.com> (raw)
In-Reply-To: <20211014071141.71871-1-hongtao.liu@intel.com>

On 10/14/21 1:11 AM, liuhongt wrote:
> Hi Kewen:
>    Cound you help to verify if this patch fix those regressions
> for rs6000 port.
> 
> As discussed in [1], this patch add xfail/target selector to those
> testcases, also make a copy of them so that they can be tested w/o
> vectorization.

Just to make sure I understand what's happening with the tests:
the new -N-novec.c tests consist of just the casses xfailed due
to vectorizartion in the corresponding -N.c tests?  Or are there
some other differences (e.g., new cases in them, etc.)?  I'd
hope to eventually remove the -novec.c tests once all warnings
behave as expected with vectorization as without it (maybe
keeping just one case both ways as a sanity check).

For the target-supports selectors, I confess I don't know enough
about vectorization to find their names quite intuitive enough
to know when to use each.  For instance, for vect_slp_v4qi_store:

+# 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 }]
+}

When should this selector be used?  In cases involving 4-byte
char stores?  Only naturally aligned 4-bytes stores (i.e., on
a 4 byte boundary, as the check_vect_slp_vnqihi_store_usage
suggests?) Or 4-byte stores of any types (e.g., four chars
as well as two 16-bit shorts), etc.?

Hopefully once all the warnings handle vectorization we won't
need to use them, but until then it would be good to document
this in more detail in the .exp file.

Finally, thank you for adding comments to the xfailed tests
referencing the corresponding bugs!  Can you please mention
the PR in the comment in each of the new xfails?  Like so:

index 7d29b5f48c7..cb687c69324 100644
--- a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
+++ b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
@@ -189,8 +189,9 @@ void ga1__ (void)

    struct A1 a = { 1 };
    a.a[0] = 0;
+  // O2 vectorization regress Wstringop-overflow case (1), refer to 
pr102462.
    a.a[1] = 1;                    // { dg-warning 
"\\\[-Wstringop-overflow" }
-  a.a[2] = 2;                    // { dg-warning 
"\\\[-Wstringop-overflow" "" { xfail { i?86-*-* x86_64-*-* } } }
+  a.a[2] = 2;                    // { dg-warning 
"\\\[-Wstringop-overflow" "pr102462" { xfail { vect_slp_v2qi_store } } }
            ^^^^^^^^
            PR in dg-warning comment.

This should make it easier to deal with the XFAILs once
the warnings have improved to handle vectorization.

Martin

  parent reply	other threads:[~2021-10-15 15:37 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
2021-10-15 15:37                     ` Martin Sebor [this message]
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=61ff5da7-a7af-40b6-85cc-fa230da6a33a@gmail.com \
    --to=msebor@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hongtao.liu@intel.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).