From patchwork Mon Oct 28 22:51:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dehao Chen X-Patchwork-Id: 286691 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 7272D2C00DC for ; Tue, 29 Oct 2013 09:51:20 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:cc:content-type; q=dns; s=default; b=sfYbA4Uid1exjwPhqYZa34NDQvFptcsB00tqwG+Djci FBVmyMbPInjW6bvIr9WSJLP5RqqPCtQSaLtfeNr1I/3O2lKHmDr0gRZoJvKXhsht R7Uq1yIN/OuIHlM6ubsSLyvaXMue73ZoS2rArDXuUG/wHlwYVqJ4MHF28mgxI5mI = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:cc:content-type; s=default; bh=U6qJsfnJ8j3ElsXJF0tDIhJ9zBs=; b=GevYuCyMBD+Bhj6ra Y7KqA64B7Xs9cq+uyG6LX9FN6qaBwaMbh+NbXTiDjscXZIcDa1ZMKPRYwMfkSAok JIMrbKqvVXjkyhsOfxm/hz41AiftgIs7rEh+losAlehsHat/SSRoF9g0lqGyeBoc HRatJOKtKv09Qv/y6DMk0E3Ujs= Received: (qmail 7530 invoked by alias); 28 Oct 2013 22:51:12 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 7515 invoked by uid 89); 28 Oct 2013 22:51:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.5 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ie0-f182.google.com Received: from mail-ie0-f182.google.com (HELO mail-ie0-f182.google.com) (209.85.223.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 28 Oct 2013 22:51:10 +0000 Received: by mail-ie0-f182.google.com with SMTP id as1so12671914iec.27 for ; Mon, 28 Oct 2013 15:51:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to:cc :content-type; bh=A/uFoG84CW9Dp4dAUubIz1jPd2X1KjFTWvK6vO9IDRc=; b=XmrYBnJWzq47HK1mZkuL37y+ElU7sFr/S5kBPfIhtsm4ftyfvPpnljP0IqO3c0aZNi m2NfP3lz7fctpws3gaithdMYdVnZ8g1rizxX1BI3Q2wzyf5lJLJ6AKN96MuqtSzRZe1s rV6pIC2lM43lAm05eTBgJ9Ez6UKIQwPJ3GDaOwUAiFXN6nFX9aKnzRcoe1X+khmHevjr G9m+XAl5oVwVPDlU/XlTzaeGMDB3yufO1tVzEdq7mauHz/4Aqg6Yzbx0GezMH6x29fO+ GdSzRii5+gcebr7vd9muUx05VDLLC9x+YdEaZsYb6PFyjFkCqYZQO20SzwQU5Ohnok/D iBPw== X-Gm-Message-State: ALoCoQmMIhhNNrdjqJDbbL3SzaZRhO9YTdJZArYiyW8u9ngQsvG7/b/XLen821Cug5O6APO2wF1AHWIo5qRaaligCSawG2rtwlSMxgCYVS+p7bD/wNwnVbkAW4c6MU6kCrC7Xn6ITUsjRpKv6260FtyDqSTbO7Bttm8BHPT0lqGUFg1c3Pu6A6Oz74IOyzmHWJU7ZUW0EKQcl/IpOvs5FnCQWHFlH9tjbw== MIME-Version: 1.0 X-Received: by 10.50.87.33 with SMTP id u1mr10360447igz.42.1383000669118; Mon, 28 Oct 2013 15:51:09 -0700 (PDT) Received: by 10.64.9.133 with HTTP; Mon, 28 Oct 2013 15:51:09 -0700 (PDT) Date: Mon, 28 Oct 2013 15:51:09 -0700 Message-ID: Subject: [GOOGLE] Don't update the callee count if caller is not resolved node From: Dehao Chen To: GCC Patches Cc: David Li X-IsSubscribed: yes This patch changes to no update callee count if caller count is not a resolved node (in LIPO mode) during AutoFDO compilation. This is because AutoFDO will have the same edge counts for all unresolved nodes. Original update method will lead to multi-update of the callee. Bootstrapped and testing on going. OK for google-4_8 if test is OK? Thanks, Dehao Index: gcc/ipa-inline-transform.c =================================================================== --- gcc/ipa-inline-transform.c (revision 204131) +++ gcc/ipa-inline-transform.c (working copy) @@ -169,6 +169,15 @@ clone_inlined_nodes (struct cgraph_edge *e, bool d else { struct cgraph_node *n; + if (flag_auto_profile && L_IPO_COMP_MODE + && cgraph_pre_profiling_inlining_done) + { + struct cgraph_node *caller = e->caller; + if (caller->global.inlined_to) + caller = caller->global.inlined_to; + if (cgraph_lipo_get_resolved_node (caller->symbol.decl) != caller) + update_original = false; + } n = cgraph_clone_node (e->callee, e->callee->symbol.decl, e->count, e->frequency, update_original, vNULL, true);