Message ID | 2f57b5b5-3894-29b4-0e20-725bf273b496@suse.cz |
---|---|
State | New |
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D96D53858006 for <patchwork@sourceware.org>; Thu, 14 Oct 2021 07:50:40 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 4EA713858414 for <gcc-patches@gcc.gnu.org>; Thu, 14 Oct 2021 07:49:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4EA713858414 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 04A8E20289; Thu, 14 Oct 2021 07:49:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1634197771; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vRPegsiAJbAJWV9BqC7na4H0MPC1PM7xwB5oQ+N9oQI=; b=CvVNx2IESObvk8S4sgv/YYLJkAK4u1j1ZJdxh+P4ZAnwq9kucNx+iNZo8wy84hERPvWNDh jCu2cyDDUaRAdbkavXEyNoL2iW0LSO7IYIoDbBHBNdKiRJzuy0mGMgTsxlaELlfi/rRVnA SE383Kt63hQQyLDVlrtLso7EeU7go1g= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1634197771; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vRPegsiAJbAJWV9BqC7na4H0MPC1PM7xwB5oQ+N9oQI=; b=tbqA7R8Ukn7Y44w3LGQa+pe9g3B6Ry4jYH19uxx/lDVsqOMeCgzOoCivqLs/ykCHzYNWpf N49ws9v0YSPLl5Dg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id E215D13D3F; Thu, 14 Oct 2021 07:49:30 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id IN0KNgrhZ2HAJgAAMHmgww (envelope-from <mliska@suse.cz>); Thu, 14 Oct 2021 07:49:30 +0000 Message-ID: <2f57b5b5-3894-29b4-0e20-725bf273b496@suse.cz> Date: Thu, 14 Oct 2021 09:49:30 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.2 From: =?utf-8?q?Martin_Li=C5=A1ka?= <mliska@suse.cz> Subject: [PATCH] rs6000: Remove unnecessary option manipulation. To: gcc-patches@gcc.gnu.org Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> |
Series |
rs6000: Remove unnecessary option manipulation.
|
|
Commit Message
Martin Liška
Oct. 14, 2021, 7:49 a.m. UTC
Hello. There's follow up flag handling simplification based on 4ab51fa0e1705201420d87b601bd92bc643b3d52. Patch can bootstrap on ppc64le-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin gcc/ChangeLog: * config/rs6000/rs6000.c (rs6000_override_options_after_change): Do not set flag_rename_registers, it's already default behavior. Use EnabledBy for unroll_only_small_loops. * config/rs6000/rs6000.opt: Use EnabledBy for unroll_only_small_loops. --- gcc/config/rs6000/rs6000.c | 7 +------ gcc/config/rs6000/rs6000.opt | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-)
Comments
Hi Martin, On 10/14/21 2:49 AM, Martin Liška wrote: > Hello. > > There's follow up flag handling simplification based on > 4ab51fa0e1705201420d87b601bd92bc643b3d52. > > Patch can bootstrap on ppc64le-linux-gnu and survives regression tests. > > Ready to be installed? > Thanks, > Martin > > gcc/ChangeLog: > > * config/rs6000/rs6000.c (rs6000_override_options_after_change): > Do not set flag_rename_registers, it's already default behavior. > Use EnabledBy for unroll_only_small_loops. > * config/rs6000/rs6000.opt: Use EnabledBy for > unroll_only_small_loops. > --- > gcc/config/rs6000/rs6000.c | 7 +------ > gcc/config/rs6000/rs6000.opt | 2 +- > 2 files changed, 2 insertions(+), 7 deletions(-) > > diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c > index acba4d9f26c..40146179e06 100644 > --- a/gcc/config/rs6000/rs6000.c > +++ b/gcc/config/rs6000/rs6000.c > @@ -3472,13 +3472,8 @@ rs6000_override_options_after_change (void) > /* Explicit -funroll-loops turns -munroll-only-small-loops off, and > turns -frename-registers on. */ > if ((OPTION_SET_P (flag_unroll_loops) && flag_unroll_loops) > - || (OPTION_SET_P (flag_unroll_all_loops) > - && flag_unroll_all_loops)) > + || (OPTION_SET_P (flag_unroll_all_loops && flag_unroll_all_loops))) Looks like you got your parentheses wrong here. Thanks, Bill > { > - if (!OPTION_SET_P (unroll_only_small_loops)) > - unroll_only_small_loops = 0; > - if (!OPTION_SET_P (flag_rename_registers)) > - flag_rename_registers = 1; > if (!OPTION_SET_P (flag_cunroll_grow_size)) > flag_cunroll_grow_size = 1; > } > diff --git a/gcc/config/rs6000/rs6000.opt b/gcc/config/rs6000/rs6000.opt > index 9d7878f144a..faeb7423ca7 100644 > --- a/gcc/config/rs6000/rs6000.opt > +++ b/gcc/config/rs6000/rs6000.opt > @@ -546,7 +546,7 @@ Target Undocumented Var(rs6000_optimize_swaps) Init(1) Save > Analyze and remove doubleword swaps from VSX computations. > > munroll-only-small-loops > -Target Undocumented Var(unroll_only_small_loops) Init(0) Save > +Target Undocumented Var(unroll_only_small_loops) Init(0) Save EnabledBy(funroll-loops) > ; Use conservative small loop unrolling. > > mpower9-misc
On 10/14/21 17:10, Bill Schmidt via Gcc-patches wrote:
> Looks like you got your parentheses wrong here.
Whoops, thanks for the heads up.
I'm testing this fixed version.
P.S. Next time, please CC me.
Thanks,
Martin
On 10/15/21 17:24, Martin Liška wrote:
> P.S. Next time, please CC me.
All right, I tested the updated patch and it works fine
on ppc64le-linux-gnu.
May I install it?
Thanks,
Martin
Hi Martin, On 10/19/21 3:53 AM, Martin Liška wrote: > On 10/15/21 17:24, Martin Liška wrote: >> P.S. Next time, please CC me. > > All right, I tested the updated patch and it works fine > on ppc64le-linux-gnu. > > May I install it? I'm not a maintainer, so can't approve -- CCing those who can. Thanks! Bill > Thanks, > Martin
Hi! On Thu, Oct 14, 2021 at 09:49:30AM +0200, Martin Liška wrote: > gcc/ChangeLog: > * config/rs6000/rs6000.c (rs6000_override_options_after_change): > Do not set flag_rename_registers, it's already default behavior. It defaults to *off*? frename-registers Common Var(flag_rename_registers) Optimization EnabledBy(funroll-loops) Perform a register renaming optimization pass. > Use EnabledBy for unroll_only_small_loops. > * config/rs6000/rs6000.opt: Use EnabledBy for > unroll_only_small_loops. > --- > gcc/config/rs6000/rs6000.c | 7 +------ > gcc/config/rs6000/rs6000.opt | 2 +- > 2 files changed, 2 insertions(+), 7 deletions(-) > > diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c > index acba4d9f26c..40146179e06 100644 > --- a/gcc/config/rs6000/rs6000.c > +++ b/gcc/config/rs6000/rs6000.c > @@ -3472,13 +3472,8 @@ rs6000_override_options_after_change (void) > /* Explicit -funroll-loops turns -munroll-only-small-loops off, and > turns -frename-registers on. */ > if ((OPTION_SET_P (flag_unroll_loops) && flag_unroll_loops) > - || (OPTION_SET_P (flag_unroll_all_loops) > - && flag_unroll_all_loops)) > + || (OPTION_SET_P (flag_unroll_all_loops && flag_unroll_all_loops))) That doesn't do what the changelog said, and it is not obvious at all that this is correct? Maybe this works with the current implementation of that macro (I assume you tested it works :-) ), but that is not something you can depend on. This expands to global_options_set.x_flag_unroll_all_loops && flag_unroll_all_loops just like the previous code did, but that one was obvious, and this is not. > { > - if (!OPTION_SET_P (unroll_only_small_loops)) > - unroll_only_small_loops = 0; > - if (!OPTION_SET_P (flag_rename_registers)) > - flag_rename_registers = 1; > if (!OPTION_SET_P (flag_cunroll_grow_size)) > flag_cunroll_grow_size = 1; > } > diff --git a/gcc/config/rs6000/rs6000.opt b/gcc/config/rs6000/rs6000.opt > index 9d7878f144a..faeb7423ca7 100644 > --- a/gcc/config/rs6000/rs6000.opt > +++ b/gcc/config/rs6000/rs6000.opt > @@ -546,7 +546,7 @@ Target Undocumented Var(rs6000_optimize_swaps) Init(1) > Save > Analyze and remove doubleword swaps from VSX computations. > > munroll-only-small-loops > -Target Undocumented Var(unroll_only_small_loops) Init(0) Save > +Target Undocumented Var(unroll_only_small_loops) Init(0) Save > EnabledBy(funroll-loops) Your patches cannot apply. Please send them non-wordwrapped. This isn't the endpoint of the changes here I hope? The macro games make everything less readable (so, harder to change) and more fragile. Segher
On Fri, Oct 15, 2021 at 05:24:32PM +0200, Martin Liška wrote: > On 10/14/21 17:10, Bill Schmidt via Gcc-patches wrote: > >Looks like you got your parentheses wrong here. > > Whoops, thanks for the heads up. > > I'm testing this fixed version. Please start a new thread for every new patch (series). I missed this one like this, instead I reviewed the older one. [-- Attachment #2: 0001-rs6000-Remove-unnecessary-option-manipulation.patch --] [-- Type: text/x-patch, Encoding: base64, Size: 2.6K --] Don't encode as non-text. Don't use x-anything if you can help it, it is meaningless in email. Use git send-email, it makes everything work :-) Segher
On 10/19/21 16:23, Segher Boessenkool wrote: > On Fri, Oct 15, 2021 at 05:24:32PM +0200, Martin Liška wrote: >> On 10/14/21 17:10, Bill Schmidt via Gcc-patches wrote: >>> Looks like you got your parentheses wrong here. >> >> Whoops, thanks for the heads up. >> >> I'm testing this fixed version. > > Please start a new thread for every new patch (series). I missed this > one like this, instead I reviewed the older one. Is it really best practice. My impression is that patch review (iterating over a patch) happens in the same thread (in most cases). It's caused by discussion in between sender reviewers. > > [-- Attachment #2: 0001-rs6000-Remove-unnecessary-option-manipulation.patch --] > [-- Type: text/x-patch, Encoding: base64, Size: 2.6K --] Meh :) If I need a reply to somebody's questions, I always attach patch as an attachment. And I can't likely influence how Thunderbird is going to mark it. > > Don't encode as non-text. Don't use x-anything if you can help it, it > is meaningless in email. > > Use git send-email, it makes everything work :-) I know. Anyway, sending updated version of the patch. Cheers, Martin > > > Segher >
@Segher: PING On 10/19/21 16:43, Martin Liška wrote: > On 10/19/21 16:23, Segher Boessenkool wrote: >> On Fri, Oct 15, 2021 at 05:24:32PM +0200, Martin Liška wrote: >>> On 10/14/21 17:10, Bill Schmidt via Gcc-patches wrote: >>>> Looks like you got your parentheses wrong here. >>> >>> Whoops, thanks for the heads up. >>> >>> I'm testing this fixed version. >> >> Please start a new thread for every new patch (series). I missed this >> one like this, instead I reviewed the older one. > > Is it really best practice. My impression is that patch review (iterating over > a patch) happens in the same thread (in most cases). It's caused by discussion > in between sender reviewers. > >> >> [-- Attachment #2: 0001-rs6000-Remove-unnecessary-option-manipulation.patch --] >> [-- Type: text/x-patch, Encoding: base64, Size: 2.6K --] > > Meh :) If I need a reply to somebody's questions, I always attach patch as an attachment. > And I can't likely influence how Thunderbird is going to mark it. > >> >> Don't encode as non-text. Don't use x-anything if you can help it, it >> is meaningless in email. >> >> Use git send-email, it makes everything work :-) > > I know. > > Anyway, sending updated version of the patch. > > Cheers, > Martin > >> >> >> Segher >>
On Tue, Oct 19, 2021 at 04:43:40PM +0200, Martin Liška wrote: > On 10/19/21 16:23, Segher Boessenkool wrote: > >On Fri, Oct 15, 2021 at 05:24:32PM +0200, Martin Liška wrote: > >>On 10/14/21 17:10, Bill Schmidt via Gcc-patches wrote: > >>>Looks like you got your parentheses wrong here. > >> > >>Whoops, thanks for the heads up. > >> > >>I'm testing this fixed version. > > > >Please start a new thread for every new patch (series). I missed this > >one like this, instead I reviewed the older one. > > Is it really best practice. My impression is that patch review (iterating > over > a patch) happens in the same thread (in most cases). It's caused by > discussion > in between sender reviewers. Yes, it is best practice. It is impossible to juggle multiple versions of a patch at once and not have some fall on the floor. > >[-- Attachment #2: > >0001-rs6000-Remove-unnecessary-option-manipulation.patch --] > >[-- Type: text/x-patch, Encoding: base64, Size: 2.6K --] > > Meh :) If I need a reply to somebody's questions, I always attach patch as > an attachment. > And I can't likely influence how Thunderbird is going to mark it. You should not use base64. This is documented. Patches in the archive will not show up either that way. > Anyway, sending updated version of the patch. Not in a reply please. If nothing else, this makes it hard for other people to apply your patches (to test them out, or to actually commit them upstream). Segher
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index acba4d9f26c..40146179e06 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -3472,13 +3472,8 @@ rs6000_override_options_after_change (void) /* Explicit -funroll-loops turns -munroll-only-small-loops off, and turns -frename-registers on. */ if ((OPTION_SET_P (flag_unroll_loops) && flag_unroll_loops) - || (OPTION_SET_P (flag_unroll_all_loops) - && flag_unroll_all_loops)) + || (OPTION_SET_P (flag_unroll_all_loops && flag_unroll_all_loops))) { - if (!OPTION_SET_P (unroll_only_small_loops)) - unroll_only_small_loops = 0; - if (!OPTION_SET_P (flag_rename_registers)) - flag_rename_registers = 1; if (!OPTION_SET_P (flag_cunroll_grow_size)) flag_cunroll_grow_size = 1; } diff --git a/gcc/config/rs6000/rs6000.opt b/gcc/config/rs6000/rs6000.opt index 9d7878f144a..faeb7423ca7 100644 --- a/gcc/config/rs6000/rs6000.opt +++ b/gcc/config/rs6000/rs6000.opt @@ -546,7 +546,7 @@ Target Undocumented Var(rs6000_optimize_swaps) Init(1) Save Analyze and remove doubleword swaps from VSX computations. munroll-only-small-loops -Target Undocumented Var(unroll_only_small_loops) Init(0) Save +Target Undocumented Var(unroll_only_small_loops) Init(0) Save EnabledBy(funroll-loops) ; Use conservative small loop unrolling. mpower9-misc