From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 05071385800A for ; Thu, 4 Nov 2021 07:48:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 05071385800A Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id ACCEE1FD51; Thu, 4 Nov 2021 07:48:04 +0000 (UTC) Received: from murzim.suse.de (murzim.suse.de [10.160.4.192]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 83B172C14A; Thu, 4 Nov 2021 07:48:04 +0000 (UTC) Date: Thu, 4 Nov 2021 08:48:04 +0100 (CET) From: Richard Biener To: Jiufu Guo cc: gcc-patches@gcc.gnu.org, amker.cheng@gmail.com, wschmidt@linux.ibm.com, segher@kernel.crashing.org, dje.gcc@gmail.com, jlaw@tachyum.com Subject: Re: [PATCH] Check number of iterations for test cases pr101145 In-Reply-To: <7ek0hoe6wv.fsf@pike.rch.stglabs.ibm.com> Message-ID: <988424on-o4n-1q89-5891-5s3pop51p6s4@fhfr.qr> References: <20211101025446.55538-1-guojiufu@linux.ibm.com> <7etugudkgq.fsf@pike.rch.stglabs.ibm.com> <104r7n2s-nsn9-3466-r558-57npns34p471@fhfr.qr> <7ek0hoe6wv.fsf@pike.rch.stglabs.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Nov 2021 07:48:07 -0000 On Thu, 4 Nov 2021, Jiufu Guo wrote: > Richard Biener writes: > > > On Wed, 3 Nov 2021, Jiufu Guo wrote: > > > >> Richard Biener writes: > >> > >> > On Mon, 1 Nov 2021, Jiufu Guo wrote: > >> > > >> >> PR101145 is supporting if the number of iterations can be calculated > >> >> for the 'until wrap' condition. Current test cases are checking if > >> >> the loop can be vectorized, if a loop can be vectorized then the number > >> >> of interations is known. While it would be better to check the loop's > >> >> number of iterations directly. This patch updates the test cases > >> >> accordingly. > >> >> > >> >> Bootstrap and regtest pass on ppc,ppc64le and x86_64. > >> >> Is this ok for trunk? > >> > > >> > Not sure - the motivation was to make the loop vectorizable so > >> > a vectorized check is strictly more powerful. What's the problem > >> > with the existing test? > >> > >> Thanks, Richard! > >> > >> The problem of current tests is that some targets do not support > >> vectorization on some types, like "vector(8) unsigned char" on > >> Solaris/SPARC, "vector long long" on Power7: > >> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102946 > >> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102069 > >> > >> On those targets, the "number of iterations" was calculated for > >> the loops in the test cases, while the loops are not vectorized. > > > > I see, but can you add appropriate target selectors for the > > vectorization then and keep those scans? I'm not sure why you > > return the final IV value from the functions rather than > > testing correct data in a[], that will complicate selecting the > > targets that can vectorize things. There is vect_char_add and > > vect_long_long you could require in addition to vect_int. > > Thanks Richard, > > The final IV would be the index of last iteration, test test cases > are checking if it is just wrap around max/min of the index type. > > I updated the patch accordingly. OK. Thanks, Richard. > BR, > Jiufu > > > -------------------- > [PATCH] Update dg-require-effective-target for pr101145 cases > > For test cases pr101145*.c, some types are not able to be > vectorized on some targets. This patch updates > dg-require-effective-target according to test cases. > > gcc/testsuite/ChangeLog: > > * gcc.dg/vect/pr101145_1.c: Update case. > * gcc.dg/vect/pr101145_2.c: Update case. > * gcc.dg/vect/pr101145_3.c: Update case. > > --- > gcc/testsuite/gcc.dg/vect/pr101145_1.c | 2 +- > gcc/testsuite/gcc.dg/vect/pr101145_2.c | 2 +- > gcc/testsuite/gcc.dg/vect/pr101145_3.c | 2 +- > 3 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/gcc/testsuite/gcc.dg/vect/pr101145_1.c b/gcc/testsuite/gcc.dg/vect/pr101145_1.c > index 9332b2c4257..24a9da63e88 100644 > --- a/gcc/testsuite/gcc.dg/vect/pr101145_1.c > +++ b/gcc/testsuite/gcc.dg/vect/pr101145_1.c > @@ -1,4 +1,4 @@ > -/* { dg-require-effective-target vect_int } */ > +/* { dg-require-effective-target vect_char_add } */ > /* { dg-additional-options "-O3" } */ > #define TYPE signed char > #define MIN -128 > diff --git a/gcc/testsuite/gcc.dg/vect/pr101145_2.c b/gcc/testsuite/gcc.dg/vect/pr101145_2.c > index fa2c6be689a..9091f606066 100644 > --- a/gcc/testsuite/gcc.dg/vect/pr101145_2.c > +++ b/gcc/testsuite/gcc.dg/vect/pr101145_2.c > @@ -1,4 +1,4 @@ > -/* { dg-require-effective-target vect_int } */ > +/* { dg-require-effective-target vect_char_add } */ > /* { dg-additional-options "-O3" } */ > #define TYPE unsigned char > #define MIN 0 > diff --git a/gcc/testsuite/gcc.dg/vect/pr101145_3.c b/gcc/testsuite/gcc.dg/vect/pr101145_3.c > index 9f43c82593f..001e5f38a46 100644 > --- a/gcc/testsuite/gcc.dg/vect/pr101145_3.c > +++ b/gcc/testsuite/gcc.dg/vect/pr101145_3.c > @@ -1,4 +1,4 @@ > -/* { dg-require-effective-target vect_int } */ > +/* { dg-require-effective-target vect_long_long } */ > /* { dg-additional-options "-O3" } */ > #define TYPE int * > #define MIN ((TYPE)0) > -- Richard Biener SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany; GF: Ivo Totev; HRB 36809 (AG Nuernberg)