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 C9A4F3839C5E for ; Thu, 19 May 2022 14:27:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C9A4F3839C5E Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id BD06F1FA5D; Thu, 19 May 2022 14:27:28 +0000 (UTC) Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (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 B63692C141; Thu, 19 May 2022 14:27:28 +0000 (UTC) Date: Thu, 19 May 2022 14:27:28 +0000 (UTC) From: Richard Biener To: Jakub Jelinek cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Fix OMP CAS expansion with separate condition In-Reply-To: Message-ID: References: <20220513102302.1FBE213446@imap2.suse-dmz.suse.de> User-Agent: Alpine 2.22 (LSU 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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, 19 May 2022 14:27:31 -0000 On Thu, 19 May 2022, Jakub Jelinek wrote: > On Thu, May 19, 2022 at 02:13:33PM +0000, Richard Biener wrote: > > > Though, depending on what exactly you allow or disallow, maybe even > > > the im != 0 might not be acceptable. > > > Oh, and if COND_EXPRs can only use some limited set of comparisons, we might > > > need to adjust e.g. arith_overflow_check_p and various other spots in > > > tree-ssa-math-opts.cc and other passes. > > > > With the changes I have in the queue the !cond_stmt path should be > > effectively dead code (though I don't remove such immediately). > > > > Not sure what you think the issue with arith_overflow_check_p would be? > > Note this is only about COND_EXPRs in gimple assignments. > > Just that there will be more dead code in the compiler. > At least tree-ssa-math-opts.cc in various spots (but I think phiopt too and > other spots I've touched too) are looking for all 3 kinds of comparisons, > GIMPLE_CONDs, comparisons in COND_EXPR first operand and assignments > with tcc_comparison rhs codes and deal with all 3. If we restrict what > can appear in COND_EXPR first operand in gimple assignments, perhaps we'll > need to only deal with the first and last case and not the COND_EXPR ones. Ah, yeah - there will be followup cleanup opportunities like shaving off 5% of gimple-match.cc when I'm happy with a required phiopt adjustment. Richard.