From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by sourceware.org (Postfix) with ESMTPS id B6485385828E for ; Sun, 10 Jul 2022 14:04:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B6485385828E X-IronPort-AV: E=McAfee;i="6400,9594,10403"; a="267556593" X-IronPort-AV: E=Sophos;i="5.92,260,1650956400"; d="scan'208";a="267556593" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jul 2022 07:04:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,260,1650956400"; d="scan'208";a="594607665" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by orsmga002.jf.intel.com with ESMTP; 10 Jul 2022 07:04:47 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Sun, 10 Jul 2022 07:04:47 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Sun, 10 Jul 2022 07:04:46 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Sun, 10 Jul 2022 07:04:46 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.174) 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; Sun, 10 Jul 2022 07:04:46 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LKgA6NI2Oj8q6U5nc0EiXlloDKurwZQmjPcygN/P5TXyzgccaaaxQawFFAoFCZw0vP1OlXLzqlk7iECumml1FJjdy2Ex4GDjV6I6HkPH6SImP8i+6hmlpiFjw0pDcp1W8BR4NPQU9Tyv5FaheUWFfagXmnCmXNPeA84UnSsm8dlLy9hUy1w/gge4nIzatt74C9bS3MyPiiJTYo/bPocSX9yjNBlN05eF4Qj86AzyeGlp0lS5ZMBRklqmKBQox05ag5kz6jMJRhklbl95+ElUA2OcrjERBoKWVe8jOug0ozLps9N5VmxA+JNu4jJoo6sYYlzGAxh7swkBVb6F3OYI8A== 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=H32r3pMftH+YqNjX3hEqAFN+8f8Rpg3kGI9qFBEKGrk=; b=dG7Tu/F/i6d+zh4dgA2oSNZEqHe83aZgKRTRgj7FRtbAM1tYTjCDP6alZ/VZtcJxFJsQU7cOE4hd/EInc9gh1BE06N8CVCk+jkcdYt7fn1Eib+rhkP+8FyIxIrzdA589wSp/ibrK7poWEqLlABQWEAa4FqNyvDLWfnxLQmxRfn3/g00F+omlv52DX/HIk/jok3OZO/p8Bk0pixi5BL+MuzR6QCDkrTC4girLLoVP8O7O/TTV0hYyUJuTp9qfb2jf8aUA8jxb32it9bB91VNUU6B/MeP5SbyCBK/4rgVpuEPPMtYTauttVqkRH8kc+VF8RjKTRtkaqrdIOIUMZUNw5g== 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 CY5PR11MB6463.namprd11.prod.outlook.com (2603:10b6:930:31::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.23; Sun, 10 Jul 2022 14:04:45 +0000 Received: from SJ0PR11MB5600.namprd11.prod.outlook.com ([fe80::4c02:690e:d343:7e42]) by SJ0PR11MB5600.namprd11.prod.outlook.com ([fe80::4c02:690e:d343:7e42%7]) with mapi id 15.20.5417.026; Sun, 10 Jul 2022 14:04:45 +0000 From: "Cui, Lili" To: Jan Hubicka CC: "gcc-patches@gcc.gnu.org" , "Liu, Hongtao" , "Lu, Hongjiu" 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: AQHYkSZEUKwuoKrhCUeY0MCbfcX1G61zDEmAgASY7zA= Date: Sun, 10 Jul 2022 14:04:45 +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: f252f543-c385-4715-b767-08da627d24bb x-ms-traffictypediagnostic: CY5PR11MB6463:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 5azrZNI0nbS8SiwC3l1knmKihPzzBAJFz6zr01dm/pvNvfkXx8WayvDWEcbwQLtOK31lIyT41dd2pwhKhp14/IOjp+eQ502znqe2G36TI9IFZjjyAko/0mSsRqjYSQGyHCZM0beq+KKQrmkMciKs4qvVXsxXbtoq0jrhPTLfiSXMMVaBlQeV7wBacj1ZWRxNIBE3x0debfzjPdhQ8vPq864xINBAJ0PiclYqM3bkp+SCxsvhweFlVw4jGv9s8icJ4H9+k0fU6aLvfFKmX62L3Mv0oN/F8co4sqboRtXttv5HfagPB6y1Te4TlMww5aDg5DSjs/G3ng1PQsdevbi9bd39CET9Owe68erQxqhMeu76LuYxUM9OgIj1oDtMbNtxAFANE8c90oAwqcgXyUxHxwFuqjx0hpnGGUYTK2fMsRNTZsNMCA/x47Djz9tstNY0cL1ueKzK4ssmMxeW4eVUP2M6rTNwBqg3JOr+BQGZpNm9pEfrvz7zFMYlgM6aT/ISatOevpZaWRbnnIYejdKhaBa74zctHokZYgeL5GY6hX+D7xCqYRuo2zLZsgWAF029foLSDvcrxgW/siHdD0AVn6P3SlVwoOjBCKa7fySJ3lXYhaA3UTOo+D9VaiJjocUHA3IA+FsLLqdme8MvLgK0UttOsrHNSOzUdj9NPRu4IJGqu2iJX4/NhPDDTBAxyfbSarHSjIOAu0LlyAusomUT/P+M1vcf8wQX8wGg8OgI9NN7H2VXKkr0l9X/03c3emuhAue28npGy4uGi+dvFtLFsyN8AXMm6qJtExwpw/aPGUw8LOhDDZtL9SHfvt7/oOdONh6aUe6TIdWxUxRz8YfkbdR7i6H4jYItAS9w6D6JLLI= 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)(39860400002)(396003)(366004)(346002)(376002)(136003)(54906003)(86362001)(76116006)(9686003)(316002)(6916009)(26005)(64756008)(66476007)(38100700002)(4326008)(66946007)(71200400001)(66556008)(8676002)(66446008)(186003)(38070700005)(83380400001)(478600001)(55016003)(6506007)(7696005)(107886003)(41300700001)(122000001)(5660300002)(8936002)(82960400001)(33656002)(52536014)(2906002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?0uL729VPf8RkIkJhAQYP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?= =?us-ascii?Q?ybS+GTUFCeUszran7kLbq2ZWgwmHeE9poMea5hU7y9ob73SkWpGp/gSkgn60?= =?us-ascii?Q?mwPv/C7ARPy+H2TiSF0LFPxz/Q/FOhWMgjNDRd93ZRgLLe3ZLMfgH5dZg6UT?= =?us-ascii?Q?tHYD5+xjUYe7y+1LlbehvZ1e1TCZaE2ENi2CLOUKC3HmkE1rkgP2whWfFOOt?= =?us-ascii?Q?9b2rs36VFq9PfSehVngupIB31Y97thjTFG9jrhfbvCNy3gietdn5f5qQjVjw?= =?us-ascii?Q?17dnUoHLKpT1fJ3vUAA8fsrdaebW+rtDAKWCxjQeQZnQpaZXkPKqUWkzHGOv?= =?us-ascii?Q?qDAgQX3vhBI/qaZsJ5RHaGNgP4I5CjUQ9QQl7iBCkg09ywqog39zYfXDFOxC?= =?us-ascii?Q?MNP0DBQBPutXILvNNihqSqlWSHjdfwwdvgBJ3+7OsUVuzF+BZMjw0vmOLhU2?= =?us-ascii?Q?lrk+ThgSuCCO83kKxV2cNWRg/oX8rwsnB2XAp4Soxio7br0lE4XIbuo8DG8l?= =?us-ascii?Q?apjO9toavbUZBYQF1A8niM3GmRDHJacxZSE9lkmPBwrrscRzRwgD6DbvD4HQ?= =?us-ascii?Q?6bV3b4X1DJNkUjrmJo5MEjLMosX0RPCuWdq3nf+u4Ujzh955pYjQ2u7mK/J5?= =?us-ascii?Q?8Lte3DD0wsHtVyB0cJuGX8dgbjBEO+4b+Hh/eh6DyY3Ht5Eq10bOcEpYeAEQ?= =?us-ascii?Q?nGxJLZyo7AIrfJel1DRZA2E/7T3MOHrxwJ4HLbEq?= 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: f252f543-c385-4715-b767-08da627d24bb X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Jul 2022 14:04:45.2437 (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: UNiUk2Ze2mSLIkeqmAO6QhaMk+kyyDRgvOXdGZoCLCOiUs4aG0O9dNvEuzWKmm2QIoHwOwsZrp4fpCk32U9ZAw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR11MB6463 X-OriginatorOrg: intel.com X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_SHORT, SPF_HELO_NONE, SPF_NONE, 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 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: Sun, 10 Jul 2022 14:04:51 -0000 > -----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. >=20 > 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. >=20 > 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. >=20 > The idea of checking that the actual sotre in question is paired with loa= d 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? Hi Honza, Really appreciate for the feedback. I found that eliminated_by_inlining_pro= b does eliminated the stmt 50% of the time, but the gap is still big.=20 SRA cannot split callee's parameter for "Do not decompose non-BLKmode param= eters in a way that would create a BLKmode parameter. Especially for pass-b= y-reference (hence, pointer type parameters), it's not worth it." Critical inline function information Caller: GetVirtualPixelsFromNexus size: 541 time: 484.08 e->freq: 0.83 Callee: SetPixelCacheNexusPixels nonspec time: 46.60 time : 36.18 size: 87 Since the insns number 87 of callee function is bigger than inline_insns_au= to (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, = which means callee's time should be at least 72.61, but callee's time is 4= 6.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=3D8= 3665), that you tried changing it to 8, but that increases the gzip code s= ize by 2.5KB. so I want to add a heuristic hit for it. Thanks, Lili. >=20 > Honza