From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by sourceware.org (Postfix) with ESMTPS id 207193858D39 for ; Mon, 18 Jul 2022 22:38:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 207193858D39 X-IronPort-AV: E=McAfee;i="6400,9594,10412"; a="287078161" X-IronPort-AV: E=Sophos;i="5.92,282,1650956400"; d="scan'208";a="287078161" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jul 2022 15:38:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,282,1650956400"; d="scan'208";a="572595951" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga006.jf.intel.com with ESMTP; 18 Jul 2022 15:38:33 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Mon, 18 Jul 2022 15:38:33 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Mon, 18 Jul 2022 15:38:33 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.108) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Mon, 18 Jul 2022 15:38:33 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WREHaFnWt7QDkyriI36kLSHcjCYGpbTHqe6NATL5xhGZycbx7O2mQ6VM6nrFOgXid4vun9CNXx8bC9DJB5GebwwPm13M8CiIxOKtK5t481+bC1YT9mcMFYD0Ysm61D8GWCWa/3lcWZyY80TTPYyw6U6pgr0xXOJNIs6Qu7dP1kPX6itKy7KpEQqzB6BMxKxs8PnGF+HxGYm08zeXnzYWPuB+yFQLJEFjPjtCnFtphtcdkKDeBB6QKoNs8DXoxKCowqn3uEMi1MhZQneU4TIQ8t9WLgU2MHjVblR19f/emD48OGu2xbyCaKFpCAOgHbxbICSJMwSqQF/pluS6fbOF3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=jdNA7GL9dH8Cw48NQc9zqbPvscc+JxYRhb0leIwttZo=; b=cpin0BTHTZjWuj3BjSjTrYmA+HqyRFhdi+mZ3u5vNPvKci4gz2ogbycKMhok59RSup66bZnngxETy7odFYy4PNe+L0P3p1dM2sZYO5uBaR6reZrfqZ0ongPD5PWpNzsnUkuaLqptR6azrI39cBZXK8ihByjqNnTVJ/waiW8R75O6+PnaVBGl+YIvnyMVpiIB0iU8HhtXJ3RfQBPuVPravQm3D7mPaZP8SCup40vzl5l6PxsOS2pBtVtM5C0i7zi6lJ0Ne/6azIrp9WvABnA8W4eK4tEYVqLi4HDr1eG5BfjIaxi3lMzI3QAWPVPFpR6tatxDAVx/zs2PDl1wABxKrw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from SJ0PR11MB5600.namprd11.prod.outlook.com (2603:10b6:a03:3ab::16) by DM6PR11MB3948.namprd11.prod.outlook.com (2603:10b6:5:191::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.20; Mon, 18 Jul 2022 22:38:31 +0000 Received: from SJ0PR11MB5600.namprd11.prod.outlook.com ([fe80::4c02:690e:d343:7e42]) by SJ0PR11MB5600.namprd11.prod.outlook.com ([fe80::4c02:690e:d343:7e42%8]) with mapi id 15.20.5438.023; Mon, 18 Jul 2022 22:38:31 +0000 From: "Cui, Lili" To: Jan Hubicka CC: "Lu, Hongjiu" , "Liu, Hongtao" , "gcc-patches@gcc.gnu.org" Subject: RE: [PATCH] Add a heuristic for eliminate redundant load and store in inline pass. Thread-Topic: [PATCH] Add a heuristic for eliminate redundant load and store in inline pass. Thread-Index: AQHYkSZEUKwuoKrhCUeY0MCbfcX1G61zDEmAgASY7zCADSYhoA== Date: Mon, 18 Jul 2022 22:38:30 +0000 Message-ID: References: <20220706105043.27652-1-lili.cui@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.500.17 dlp-product: dlpe-windows dlp-reaction: no-action x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: cebef04b-c564-435f-6bc8-08da690e3d97 x-ms-traffictypediagnostic: DM6PR11MB3948:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 13TFmbI/4T910dxOu9RadQlrnMtIDKZXR+2wlo3TSNr5zCnob2hFtgitB0DjGv0lZ0nyPrz9OSZyWc8qvg4j3ho8I1gEJHAeTNaPrqXpwIqpY0Ua20MVgAovf6pWNTB6pAeeM2Nmla7R8L/0iaDyo1a88VCPGAckA7+YSf/0zBZOUfT3t+W8C2Bo2LKkZ3AymBuyLQcdDhW2NBBu7O9JaYEMwLaT2xsNwhPuxqhyRDPlMAlf20EOds2tcSYTKw24sabi3iuvRASBTBex3GIHtEMbKPi+1AhuXuEC1LJHlnmTdrPjvDttYdtpUdXyvDdbozaqYVS012taBZo0Cwf6I2W8AxRu4C4j80CbnJ/zpQFVfc0JJQpbzBrGwLE0CCq3oAgcvsDMdN7oVmr0TNzJn0XmBXKR0B4veb3qY3qnc/QYIkbwTtAmnUeTwn2NjbxNh5GXm9vO9W3vz5GMyX+nmvI2VSImtRswIoK5gAM3xkOR7/VZgEWiVC/kwi1zpM0sGqn7bf5dnD5uDkI/uJe6hm3bJR8e6gavo7afgqcR6ef6xYmsJpCqYddcAs9kC9iK8vCNw8STPis3UG6L0029hiqoyLwuuHDu9pIxwxPijyuaqh+d7sa3pl04oYuR/srquxqHfMLUMLV8G/2rUZ1ikQBvspGf/SKw0+DLoKKCSVDarme6WVT3gF33hXdypQ7PREF6pjHLI9nZh2xClGZ85wVQaUXSxfdq1nAtUfRlzms4sXgx+RRbUyukUnR/FnMu5gqy7wcSZjdoES3vMp8osEYlnBq9ylKUbusjESv0LUaBNEiWX4Ud/mhaqpItdiB4O42mTGIaRNO369TngId8H1/G22RjbZ2ep6o34RmmG6IcPPW1Mml3J8WBhMapp58a x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR11MB5600.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(396003)(39860400002)(376002)(346002)(136003)(366004)(55016003)(9686003)(83380400001)(186003)(122000001)(41300700001)(5660300002)(966005)(26005)(2906002)(71200400001)(478600001)(64756008)(76116006)(66476007)(4326008)(8676002)(66446008)(66946007)(66556008)(52536014)(33656002)(8936002)(86362001)(38100700002)(53546011)(54906003)(7696005)(82960400001)(316002)(6916009)(6506007)(38070700005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?yDqmD5/FlMj7Vzfe5O4NXH/U/2xkOsj8kfqB5CXB4TPRXjrR0+YebHn+Cyc3?= =?us-ascii?Q?RE6VQ8512JbHKPO5GtCzwF84C8Beli0bE3sSHx2iDGiCcCzIMrS85+HtWh3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dozMJCHSaV8cVQK6jUrp8Cq?= =?us-ascii?Q?bWTwN3ZV3CcYtdgjDA8y5fb+8ZUDNdZcMlL41cg7alN8tzGLxXS+jq1rhs9C?= =?us-ascii?Q?I6jJ+Nm9kKa2mcK5wJDX9NxU1rSjMt/unALXh8Bi6taTP/rfvJzGVa9YtvCB?= =?us-ascii?Q?j0E3yN8xl5GqMblw+JZBJ7ZSU3poY0LI9pIH6BbUjXHLZue+sjVc0mpvjnJe?= =?us-ascii?Q?YuvNSasFIYG9tPONyeISNk445hALFKinM7vU5I8ihSDllUF7qxSrlZrJCqJn?= =?us-ascii?Q?eQUe8sKnSnhftz2ElQOQWUpNaW3WUliYpL5zVKNxSRjMkFovlvb8u16CoDzJ?= =?us-ascii?Q?PBsOS50WlLo6r4Dk6kdAoZsw+yr5x6NGYNrUmyqhSgl/XuCP6I/x9FltC+NC?= =?us-ascii?Q?nlmvQLzJpynx4Hr+gzxP4EUTTD3YBvDfVOXWDFfrzZD3eA2XDRsp7JaDx0Vt?= =?us-ascii?Q?qdffwxoNQQdgN8KQlmtw/SgO4rjrabuu3cF4y5ZP+p547Krj928wPk3Tduk8?= =?us-ascii?Q?kbCPc5MKqnM54QAoIIcjmCbIcQaULnMOnz6mtafS+lUqhoI0XLIoB7TidfJN?= =?us-ascii?Q?x1/m7CaPXjlBNK+CEGUqvf7aVmKhFJVGSk/mxFUT?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR11MB5600.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: cebef04b-c564-435f-6bc8-08da690e3d97 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Jul 2022 22:38:30.9826 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 6MJm0ehIKd38oE3wZha/QB/IGhP0gUeMPehoTx2CpVUdwpCMYdPB7VhrZ+mhKDZzrJVkl+vzyZyJw8dz61n4Tw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3948 X-OriginatorOrg: intel.com X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_SHORT, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP 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: Mon, 18 Jul 2022 22:38:46 -0000 Hi Honza, Gentle ping https://gcc.gnu.org/pipermail/gcc-patches/2022-July/597891.htm= l Thanks, Lili. > -----Original Message----- > From: Gcc-patches = On > Behalf Of Cui, Lili via Gcc-patches > Sent: Sunday, July 10, 2022 10:05 PM > To: Jan Hubicka > Cc: Lu, Hongjiu ; Liu, Hongtao > ; gcc-patches@gcc.gnu.org > Subject: RE: [PATCH] Add a heuristic for eliminate redundant load and sto= re > in inline pass. >=20 >=20 > > -----Original Message----- > > From: Jan Hubicka This is interesting idea. > > Basically we want to guess if inlining will > > make SRA and or strore->load propagation possible. I think the > > solution using INLINE_HINT may be bit too trigger happy, since it is > > very common that this happens and with -O3 the hints are taken quite > sriously. > > > > We already have mechanism to predict this situaiton by simply > > expeciting that stores to addresses pointed to by function parameter > > will be eliminated by 50%. See eliminated_by_inlining_prob. > > > > I was thinking that we may combine it with a knowledge that the > > parameter points to caller local memory (which is done by llvm's > > heuristics) which can be added to IPA predicates. > > > > The idea of checking that the actual sotre in question is paired with > > load at caller side is bit harder: one needs to invent representation > > for such conditions. So I wonder how much extra help we need for > > critical inlning to happen at imagemagics? >=20 > Hi Honza, >=20 > Really appreciate for the feedback. I found that eliminated_by_inlining_p= rob > does eliminated the stmt 50% of the time, but the gap is still big. > SRA cannot split callee's parameter for "Do not decompose non-BLKmode > parameters in a way that would create a BLKmode parameter. Especially for > pass-by-reference (hence, pointer type parameters), it's not worth it." >=20 > Critical inline function information >=20 > Caller: GetVirtualPixelsFromNexus > size: 541 > time: 484.08 > e->freq: 0.83 >=20 > Callee: SetPixelCacheNexusPixels > nonspec time: 46.60 > time : 36.18 > size: 87 >=20 >=20 > Since the insns number 87 of callee function is bigger than inline_insns_= auto > (30) and there is no hint, so inline depends on "big_speedup_p (e)". 484.= 08 > (caller_time) * 0.15 (param_inline_min_speedup =3D=3D 15) =3D 72.61, w= hich > means callee's time should be at least 72.61, but callee's time is 46.60,= so we > need to lower param_inline_min_speedup to 3 or 4. I checked the > history(https://gcc.gnu.org/bugzilla/show_bug.cgi?format=3Dmultiple&id=3D= 8366 > 5), that you tried changing it to 8, but that increases the gzip code si= ze by > 2.5KB. so I want to add a heuristic hit for it. >=20 > Thanks, > Lili. > > > > Honza