From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id 88FAB3945060 for ; Sat, 3 Oct 2020 18:03:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 88FAB3945060 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rguenther@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 69E1DAD03; Sat, 3 Oct 2020 18:03:01 +0000 (UTC) Date: Sat, 03 Oct 2020 20:02:58 +0200 User-Agent: K-9 Mail for Android In-Reply-To: <20201003084126.GA2176@tucnak> References: <20200911092952.GM18149@tucnak> <20200913082922.GF21814@tucnak> <20200928195000.GA6647@localhost.localdomain> <20200930093255.GK2176@tucnak> <20200930112144.GA97062@localhost.localdomain> <20200930113911.GM2176@tucnak> <20200930132408.GA146714@localhost.localdomain> <20201002084633.GV2176@tucnak> <20201002142112.GA176646@localhost.localdomain> <20201003084126.GA2176@tucnak> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH] options: Save and restore opts_set for Optimization and Target options To: Jakub Jelinek , Stefan Schulze Frielinghaus CC: gcc-patches@gcc.gnu.org, Richard Earnshaw , "Joseph S. Myers" From: Richard Biener Message-ID: <3915B76C-F3F2-452C-8ED8-488D2FC8706D@suse.de> X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Sat, 03 Oct 2020 18:03:04 -0000 On October 3, 2020 10:41:26 AM GMT+02:00, Jakub Jelinek wrote: >On Fri, Oct 02, 2020 at 04:21:12PM +0200, Stefan Schulze Frielinghaus >via Gcc-patches wrote: >> > > Sure, no problem at all=2E In that case I stop to investigate >further and >> > > wait for you=2E >> >=20 >> > Here is a patch that implements that=2E >> >=20 >> > Can you please check if it fixes the s390x regressions that I >couldn't >> > reproduce in a cross? >>=20 >> Bootstrapped and regtested on S/390=2E Now all tattr-*=2Ec test cases r= un >> successfully with the patch=2E All other tests remain the same=2E > >I've now also successfully tested it on >{x86_64,i686,armv7hl,aarch64,powerpc64le,s390x=2E Ok for trunk? OK=2E=20 Richard=2E=20 >> > 2020-10-02 Jakub Jelinek >> >=20 >> > * opth-gen=2Eawk: For variables referenced in Mask and InverseMask, >> > don't use the explicit_mask bitmask array, but add separate >> > explicit_mask_* members with the same types as the variables=2E >> > * optc-save-gen=2Eawk: Save, restore, compare and hash the separate >> > explicit_mask_* members=2E >> >=20 >> > --- gcc/opth-gen=2Eawk=2Ejj 2020-09-14 09:04:35=2E866854351 +0200 >> > +++ gcc/opth-gen=2Eawk 2020-10-01 21:52:30=2E855122749 +0200 >> > @@ -209,6 +209,7 @@ n_target_int =3D 0; >> > n_target_enum =3D 0; >> > n_target_other =3D 0; >> > n_target_explicit =3D n_extra_target_vars; >> > +n_target_explicit_mask =3D 0; >> > =20 >> > for (i =3D 0; i < n_target_save; i++) { >> > if (target_save_decl[i] ~ "^((un)?signed +)?int +[_" alnum "]+$") >> > @@ -240,6 +241,12 @@ if (have_save) { >> > var_save_seen[name]++; >> > n_target_explicit++; >> > otype =3D var_type_struct(flags[i]) >> > + >> > + if (opt_args("Mask", flags[i]) !=3D "" \ >> > + || opt_args("InverseMask", flags[i])) >> > + var_target_explicit_mask[n_target_explicit_mask++] \ >> > + =3D otype "explicit_mask_" name; >> > + >> > if (otype ~ "^((un)?signed +)?int *$") >> > var_target_int[n_target_int++] =3D otype "x_" name; >> > =20 >> > @@ -259,6 +266,8 @@ if (have_save) { >> > } else { >> > var_target_int[n_target_int++] =3D "int x_target_flags"; >> > n_target_explicit++; >> > + var_target_explicit_mask[n_target_explicit_mask++] \ >> > + =3D "int explicit_mask_target_flags"; >> > } >> > =20 >> > for (i =3D 0; i < n_target_other; i++) { >> > @@ -281,8 +290,12 @@ for (i =3D 0; i < n_target_char; i++) { >> > print " " var_target_char[i] ";"; >> > } >> > =20 >> > -print " /* " n_target_explicit " members */"; >> > -print " unsigned HOST_WIDE_INT explicit_mask[" int >((n_target_explicit + 63) / 64) "];"; >> > +print " /* " n_target_explicit - n_target_explicit_mask " members >*/"; >> > +print " unsigned HOST_WIDE_INT explicit_mask[" int >((n_target_explicit - n_target_explicit_mask + 63) / 64) "];"; >> > + >> > +for (i =3D 0; i < n_target_explicit_mask; i++) { >> > + print " " var_target_explicit_mask[i] ";"; >> > +} >> > =20 >> > print "};"; >> > print ""; >> > --- gcc/optc-save-gen=2Eawk=2Ejj 2020-09-16 10:06:23=2E018093486 +020= 0 >> > +++ gcc/optc-save-gen=2Eawk 2020-10-01 21:48:10=2E933868862 +0200 >> > @@ -516,6 +516,10 @@ if (have_save) { >> > =20 >> > var_save_seen[name]++; >> > otype =3D var_type_struct(flags[i]) >> > + if (opt_args("Mask", flags[i]) !=3D "" \ >> > + || opt_args("InverseMask", flags[i])) >> > + var_target_explicit_mask[name] =3D 1; >> > + >> > if (otype ~ "^((un)?signed +)?int *$") >> > var_target_int[n_target_int++] =3D name; >> > =20 >> > @@ -545,6 +549,7 @@ if (have_save) { >> > } >> > } else { >> > var_target_int[n_target_int++] =3D "target_flags"; >> > + var_target_explicit_mask["target_flags"] =3D 1; >> > } >> > =20 >> > have_assert =3D 0; >> > @@ -608,6 +613,10 @@ for (i =3D 0; i < n_extra_target_vars; i++ >> > } >> > =20 >> > for (i =3D 0; i < n_target_other; i++) { >> > + if (var_target_other[i] in var_target_explicit_mask) { >> > + print " ptr->explicit_mask_" var_target_other[i] " =3D >opts_set->x_" var_target_other[i] ";"; >> > + continue; >> > + } >> > print " if (opts_set->x_" var_target_other[i] ") mask |=3D >HOST_WIDE_INT_1U << " j ";"; >> > j++; >> > if (j =3D=3D 64) { >> > @@ -630,6 +639,10 @@ for (i =3D 0; i < n_target_enum; i++) { >> > } >> > =20 >> > for (i =3D 0; i < n_target_int; i++) { >> > + if (var_target_int[i] in var_target_explicit_mask) { >> > + print " ptr->explicit_mask_" var_target_int[i] " =3D >opts_set->x_" var_target_int[i] ";"; >> > + continue; >> > + } >> > print " if (opts_set->x_" var_target_int[i] ") mask |=3D >HOST_WIDE_INT_1U << " j ";"; >> > j++; >> > if (j =3D=3D 64) { >> > @@ -739,6 +752,10 @@ for (i =3D 0; i < n_extra_target_vars; i++ >> > } >> > =20 >> > for (i =3D 0; i < n_target_other; i++) { >> > + if (var_target_other[i] in var_target_explicit_mask) { >> > + print " opts_set->x_" var_target_other[i] " =3D >ptr->explicit_mask_" var_target_other[i] ";"; >> > + continue; >> > + } >> > if (j =3D=3D 64) { >> > print " mask =3D ptr->explicit_mask[" k "];"; >> > k++; >> > @@ -761,6 +778,10 @@ for (i =3D 0; i < n_target_enum; i++) { >> > } >> > =20 >> > for (i =3D 0; i < n_target_int; i++) { >> > + if (var_target_int[i] in var_target_explicit_mask) { >> > + print " opts_set->x_" var_target_int[i] " =3D >ptr->explicit_mask_" var_target_int[i] ";"; >> > + continue; >> > + } >> > if (j =3D=3D 64) { >> > print " mask =3D ptr->explicit_mask[" k "];"; >> > k++; >> > @@ -1058,6 +1079,20 @@ print " for (size_t i =3D 0; i < sizeof ( >> > print " if (ptr1->explicit_mask[i] !=3D ptr2->explicit_mask[i])"; >> > print " return false;" >> > =20 >> > +for (i =3D 0; i < n_target_other; i++) { >> > + if (var_target_other[i] in var_target_explicit_mask) { >> > + print " if (ptr1->explicit_mask_" var_target_other[i] " !=3D >ptr2->explicit_mask_" var_target_other[i] ")"; >> > + print " return false;"; >> > + } >> > +} >> > + >> > +for (i =3D 0; i < n_target_int; i++) { >> > + if (var_target_int[i] in var_target_explicit_mask) { >> > + print " if (ptr1->explicit_mask_" var_target_int[i] " !=3D >ptr2->explicit_mask_" var_target_int[i] ")"; >> > + print " return false;"; >> > + } >> > +} >> > + >> > print " return true;"; >> > =20 >> > print "}"; >> > @@ -1088,6 +1123,17 @@ for (i =3D 0; i < n_target_val; i++) { >> > } >> > print " for (size_t i =3D 0; i < sizeof (ptr->explicit_mask) / >sizeof (ptr->explicit_mask[0]); i++)"; >> > print " hstate=2Eadd_hwi (ptr->explicit_mask[i]);"; >> > + >> > +for (i =3D 0; i < n_target_other; i++) { >> > + if (var_target_other[i] in var_target_explicit_mask) >> > + print " hstate=2Eadd_hwi (ptr->explicit_mask_" >var_target_other[i] ");"; >> > +} >> > + >> > +for (i =3D 0; i < n_target_int; i++) { >> > + if (var_target_int[i] in var_target_explicit_mask) >> > + print " hstate=2Eadd_hwi (ptr->explicit_mask_" var_target_int[i] >");"; >> > +} >> > + >> > print " return hstate=2Eend ();"; >> > print "}"; >> > =20 >> >=20 > > Jakub