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 34DBA3858018; Tue, 8 Mar 2022 14:51:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 34DBA3858018 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 relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 1AD971F898; Tue, 8 Mar 2022 14:51:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1646751095; 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=242uEtmS6yewN91gM8gyGt0iJkXO/o1G0nlmSY27/gY=; b=Ju1NunVUVxHAtEsGq1oXfuKupzUAXkPhvhylBDSE1vCSHFnjeJ2uM7Z3NlKmSJ8p6Bn8yt B15T0u6LyKcajSIdTUflZhrbAVznI5GSOgmecAkbAmU3Lw+dUW7+BwqnwBgIjuHeKThbTL aBg1gst4MBRi1FQFWM1xDUu0HG7CvTk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1646751095; 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=242uEtmS6yewN91gM8gyGt0iJkXO/o1G0nlmSY27/gY=; b=AEoMjUQ8lWCcEOKxDNUhxeEzaiaAzRemU0Vo9uaiw8aO3mcDdqzNoL9wzFDvZ80CB6f8qm kFHA+k3BuYI6PbCQ== Received: from suse.cz (virgil.suse.cz [10.100.13.50]) (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 0A1DBA3B89; Tue, 8 Mar 2022 14:51:35 +0000 (UTC) From: Martin Jambor To: Erick Ochoa Cc: gcc@gcc.gnu.org Subject: Re: Question on updating function body on specialized functions In-Reply-To: References: User-Agent: Notmuch/0.34.1 (https://notmuchmail.org) Emacs/27.2 (x86_64-suse-linux-gnu) Date: Tue, 08 Mar 2022 15:51:34 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-5.0 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.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Mar 2022 14:51:37 -0000 Hi Erik, On Tue, Mar 08 2022, Erick Ochoa via Gcc wrote: > Hi, > > I have one function (F) that has been specialized for two different calling > contexts (F1 and F2) and two late SIMPLE_IPA_PASSes (A and B). Pass A > changes some MEM_REFs such that the type of MEM_REF is compatible with the > type of the first operand of the expression. Pass A changes both F1 and F2. > I have printed the function bodies of both F1 and F2 during Pass A and > everything looks correct. Pass B uses these changes. > > However I noticed this interesting behaviour: > > 1. If I fix F1 first and then F2, then pass B will see F2 correctly but > some of F1 MEM_REFs will be incorrect. > 2. If I fix F2 first and then F1, then pass B will see F1 correctly but > some of F2 MEM_REFs will be incorrect. > I try to avoid SIMPLE_IPA_PASSes and so would have to look how exactly they fit into the big picture. Also, I am not sure what you mean by "incorrect" above (modified when you'd not have expected it to be)? > My question is do different specialized functions share the same trees? How > would I then change the bodies of specialized functions? Virtual clones are, until they are "materialized." But it a simple IPA pass it does not really make sense to create virtual clones, does it? Do you create your clones with create_version_clone_with_body? Martin