From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nikam.ms.mff.cuni.cz (nikam.ms.mff.cuni.cz [195.113.20.16]) by sourceware.org (Postfix) with ESMTPS id 236473858419 for ; Thu, 7 Oct 2021 15:25:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 236473858419 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ucw.cz Authentication-Results: sourceware.org; spf=none smtp.mailfrom=kam.mff.cuni.cz Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 05B3328099A; Thu, 7 Oct 2021 17:25:25 +0200 (CEST) Date: Thu, 7 Oct 2021 17:25:24 +0200 From: Jan Hubicka To: Martin Jambor Cc: Xionghu Luo , GCC Patches Subject: Re: [PATCH 2/4] ipa-cp: Propagation boost for recursion generated values Message-ID: <20211007152524.GE67653@kam.mff.cuni.cz> References: <3068c6c4ee451244031d8198d663de6e614f28f9.1629805719.git.mjambor@suse.cz> <20211006154937.GB64649@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2021 15:25:27 -0000 > Hi, > > > > If you boost every self fed value by factor of 6, I wonder how quickly > > we run into exponential explosion of the cost (since the frequency > > should be close to 1 and 6^9=10077696.... > > The factor of six is applied once for an entire SCC, so we'd reach this > huge number only if there was a chain of nine different recursive > functions - with this patch we assume each one will recurse six times, > so the result is indeed a huge execution count estimate. > > The constant is not used for the "self generated" values like those in > exchange, those are handled by the else branch below. For those we > expect the recursion happens 8 times, because that is how many values we > generate, but the boost is different depending on the recursion depth. > > > > > I think it would be more robust to simply assume that the job will > >distribute evenly across the clones. How hard is to implement that? > > This is not an update of counters. The code tries to estimate execution > time improvement that is will be possible in callees if we clone for > this particular value and so is based on call graph edge frequencies (so > that if in a callee we can save 5 units of time and the frequency is 5, > we estimate we will save 25). The code has the advantage that it is > universal for both situations when profile feedback is and is not > available. I guess the patch is OK then. Thanks, Honza > > Martin >