From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id A47273858D38; Wed, 14 Jun 2023 09:22:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A47273858D38 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id A682122526; Wed, 14 Jun 2023 09:22:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1686734529; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Bs6X3zWs360GoAGj5+NfmSZUjseTgtB390y3aNHEEX4=; b=ZPG+UPqyrcxHn5ULS3rGfWG4bBVq7kVdiDx9wIRqFHB66Y4ozEmcTFQKLSVo+Pz0rFgj0i hHu1WMcH8gL/M5WSoZ9Aln/DpssA7YBTS/9IErOzLjxc/bfC8KkXombjdRtJOZ0PGg8xqA FV3OFf8TZfKN7BQhgRb/Pia4RqaOYCk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1686734529; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Bs6X3zWs360GoAGj5+NfmSZUjseTgtB390y3aNHEEX4=; b=Ys6btewe0cDEDJwyRfudFznSrugZKR5XZcxlz8WGqFG4SqNRXNKlnZRq6IIFbdpo5+krCv qDplctI3/dTsrNAw== 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 8954C2C141; Wed, 14 Jun 2023 09:22:09 +0000 (UTC) Date: Wed, 14 Jun 2023 09:22:09 +0000 (UTC) From: Richard Biener To: Richard Sandiford cc: Jiufu Guo , Segher Boessenkool , gcc-patches@gcc.gnu.org, dje.gcc@gmail.com, linkw@gcc.gnu.org, bergner@linux.ibm.com, jeffreyalaw@gmail.com Subject: Re: [PATCH] rs6000: replace '(const_int 0)' to 'unspec:BLK [(const_int 0)]' for stack_tie In-Reply-To: Message-ID: References: <20230613122335.2108620-1-guojiufu@linux.ibm.com> <20230613183320.GU19790@gate.crashing.org> <7no7liadru.fsf@ltcden2-lp1.aus.stglabs.ibm.com> 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 List-Id: On Wed, 14 Jun 2023, Richard Sandiford wrote: > Richard Biener writes: > > AFAIU this special instruction is only supposed to prevent > > code motion (of stack memory accesses?) across this instruction? > > I'd say a > > > > (may_clobber (mem:BLK (reg:DI 1 1))) > > > > might be more to the point? I've used "may_clobber" which doesn't > > exist since I'm not sure whether a clobber is considered a kill. > > The docs say "Represents the storing or possible storing of an > > unpredictable..." - what is it? Storing or possible storing? > > I'd also understood it to be either. As in, it is a may-clobber > that can be used for must-clobber. Alternatively: the value stored > is unpredictable, and can therefore be the same as the current value. > > I think the main difference between: > > (clobber (mem:BLK ?)) > > and > > (set (mem:BLK ?) (unspec:BLK ?)) > > is that the latter must happen for correctness (unless something > that understands the unspec proves otherwise) whereas a clobber > can validly be dropped. So for something like stack_tie, a set > seems more correct than a clobber. How can a clobber be validly dropped? For the case of stack memory if there's no stack use after it it could be elided and I suppose the clobber itself can be moved. But then the function return is a stack use as well. Btw, with the same reason the (set (mem:...)) could be removed, no? Or is the (unspec:) SET_SRC having implicit side-effects that prevents the removal (so rs6000 could have its stack_tie removed)? That said, I fail to see how a clobber is special here. Richard. > Thanks, > Richard > -- Richard Biener SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, Germany; GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman; HRB 36809 (AG Nuernberg)