From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-eopbgr770091.outbound.protection.outlook.com [40.107.77.91]) by sourceware.org (Postfix) with ESMTPS id ECA25384C005 for ; Sun, 6 Sep 2020 07:43:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org ECA25384C005 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g9lLZaeSHtcUYjDG4ddPrAkjoiBCX0edneOc6u2zByK97Bq/09x7laIyNFiEMrwecEDuTnVOF4Z+EBZctaBDlUyc2/Uao9EQ9hocraWcKw08BpkwiWM7O/jiRdl6E8O8fSvtXXK6sm/HZcj3PojDLtYbipcGcWPJNGgktVDl6kNznSigjPHfVyqpzQ2S5ApKZyT7D2PF11dh1H4l4dS/BkfutsJqNJVSv5L8vqyGeSX8OhYS/egAlwWWnv6xyvaAoYAXglY3chjKdTEn5jJ7Z3+jDDarhN5Bng6/PkCYuYXQOLsoHklUSX1mOckQVgBylDSI17wj7U8iJ4gf+9HfUw== 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-SenderADCheck; bh=N7xYmwc4YXoLfFwuN6WpfXjK2tCwicOQoryQI47sPtI=; b=mJuFI0zk0UpEfci4IlsWyJqrOXyDAAdbsLQtB9ppM9WGIJS5oMSFfByu+R0/kSNVTvIYtX3Ns48WDcZkKSkx0Lrp1jAgTEnc4bajnyIJq/lehf9AuE/K9fna+6C06GvmTxB6eew3E4DUoqMoLLaY60RPeZbsSphNYqalpHjl1sLZ+jVgEShJpZmAsfM4qum2K1ZVNmhcJXe6DYtk6l9hpJgeMUTzWrTKSvX5CG62jSC8DLd+UbyLTEJ/58nsKdCRoOEUebx3hgGzTg+X7kgjUb7O+kNKDUOgP2nFf5YQ1KmD3/LOTQ3pR38BHrgocvZTbpQD7lYxerLCqihhl3GKKg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amperecomputing.com; dmarc=pass action=none header.from=amperecomputing.com; dkim=pass header.d=amperecomputing.com; arc=none Received: from BYAPR01MB5464.prod.exchangelabs.com (2603:10b6:a03:129::28) by BYAPR01MB3845.prod.exchangelabs.com (2603:10b6:a02:83::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3348.15; Sun, 6 Sep 2020 07:42:59 +0000 Received: from BYAPR01MB5464.prod.exchangelabs.com ([fe80::44db:c140:1b6d:b023]) by BYAPR01MB5464.prod.exchangelabs.com ([fe80::44db:c140:1b6d:b023%7]) with mapi id 15.20.3348.017; Sun, 6 Sep 2020 07:42:57 +0000 From: Gary Oblock To: "gcc@gcc.gnu.org" Subject: Re: A couple GIMPLE questions Thread-Topic: A couple GIMPLE questions Thread-Index: AQHWg9grzzkuoY26rku2acneeykihalbJoIAgAATlkM= Date: Sun, 6 Sep 2020 07:42:57 +0000 Message-ID: References: , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [69.181.250.88] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6547c5ef-b975-4bac-ce9e-08d85238792e x-ms-traffictypediagnostic: BYAPR01MB3845: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: FnaoW/bAekXMxCt79bFX7Pea+NFkJsY1UfmwVnXqtw6B3SX6tlEVwAEdxsgfY1+NpBrXqVVtCMyKc1TXyKKQOD1uPxfxoM8rHIjuTuuk5i8eFNdOJNkqsZ7oaim43hjKWagoXS/8Vpi5Ri7dMWOu1g2HB49OclH9eNausneZE2i349wecF26aWCBHAQ1lsL5PJhLf+MoDXWDEME/xsqCQkIVWOya9pOnNwz5ktZ6pHkw3yRO2lyPfQoI59pUeiOLdEUCMxbwF0GtacluSTjuMyGLY9E58lIXx4aS6qDfXBP1cKCU+klGOUtj4AsTZcvFPcVGEkUrqQPIM6fr462R6w== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR01MB5464.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(39830400003)(346002)(376002)(136003)(366004)(66476007)(33656002)(66946007)(8936002)(2906002)(19627405001)(3480700007)(71200400001)(76116006)(66446008)(8676002)(26005)(64756008)(66556008)(186003)(7696005)(6916009)(5660300002)(52536014)(86362001)(55016002)(9686003)(316002)(6506007)(478600001)(53546011)(83380400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: fkcj7XMcdbhENANyzQMOS1CmiMQHZngcvBFNGgorhC+t6TLPL1ommVv/EEuEt0yOa3jWJRz5C3/1Xg7p3J+lhE9+vZhpHpD+F5bkc/cxBhErRR+gyud5EbRT72XChZ4PMcUoAYKijEXQTxp1EAl3qNb/INY+tw1rzcv75VpIUVfBoGytTEKpapmL16GCgm/xLyF/ZVIcCFQqx0lwnMuWdqN3bFufNKkhwd0DOimNTUAtJvEgdmxAP2Uvp97YfCRq76Axgwj2FpWN9bJMP/RCGWx2yd1iDL3awzv/zW6EmoORjidVRpiMc69vgjFqyFWqQeQBhB7fnsRHOe/0d1BY45Pg+UYXEvJpX+132IRNr6TOrb6wZuhX5akRGdCBxzYV6qCu60xKGu1FepVexya+SN6/QeDp5dNrI4c+27HUORwU6Q+Pv3L9p5XuPDsQkArmAEU53+UUzb2eHsz7C48l3jCpuL6Z4uOGJaEG+c+XfF+IITEKZ3Z/mmTIzvaE0YBB2K1FrbMwWwei5vVfCRIXGJXON9OMgoEzlw+reDBlUeKsXGq/ko02l5CsAyEv2ktVMMRFaLJ+hsLAGHtTkmf019AwRMIJODkKX2I/GkbUn4fO4cUlj/E1VadJz9/SU4ZN9tWcRNcTMzykF37cwDHpqA== x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: amperecomputing.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR01MB5464.prod.exchangelabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6547c5ef-b975-4bac-ce9e-08d85238792e X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Sep 2020 07:42:57.5273 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: yLAaBBPsYAd6HVe4Z5DJ+c6qxStkRF7q8uacnnPoEacqMq1JXRWnE3b7+RHTK6w/eyqJrKzNuJ96E3bqoZM7rL9oCqj7RupmdCt+DHdX9u8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR01MB3845 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, HTML_MESSAGE, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, TXREP, T_SPF_PERMERROR autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: Sun, 06 Sep 2020 07:43:05 -0000 >Could you please get rid of this when posting on public mailing lists? No, I have no control over that but I'll give the email of our corporate IT if you want to complain to them... ________________________________ From: Marc Glisse Sent: Saturday, September 5, 2020 11:29 PM To: Gary Oblock Cc: gcc@gcc.gnu.org Subject: Re: A couple GIMPLE questions [EXTERNAL EMAIL NOTICE: This email originated from an external sender. Plea= se be mindful of safe email handling and proprietary information protection= practices.] On Sat, 5 Sep 2020, Gary Oblock via Gcc wrote: > First off one of the questions just me being curious but > second is quite serious. Note, this is GIMPLE coming > into my optimization and not something I've modified. > > Here's the C code: > > type_t * > do_comp( type_t *data, size_t len) > { > type_t *res; > type_t *x =3D min_of_x( data, len); > type_t *y =3D max_of_y( data, len); > > res =3D y; > if ( x < y ) res =3D 0; > return res; > } > > And here's the resulting GIMPLE: > > ;; Function do_comp.constprop (do_comp.constprop.0, funcdef_no=3D5, decl_= uid=3D4392, cgraph_uid=3D3, symbol_order=3D68) (executed once) > > do_comp.constprop (struct type_t * data) > { > struct type_t * res; > struct type_t * x; > struct type_t * y; > size_t len; > > [local count: 1073741824]: > > [local count: 1073741824]: > x_2 =3D min_of_x (data_1(D), 10000); > y_3 =3D max_of_y (data_1(D), 10000); > if (x_2 < y_3) > goto ; [29.00%] > else > goto ; [71.00%] > > [local count: 311385128]: > > [local count: 1073741824]: > # res_4 =3D PHI > return res_4; > > } > > The silly question first. In the "if" stmt how does GCC > get those probabilities? Which it shows as 29.00% and > 71.00%. I believe they should both be 50.00%. See the profile_estimate pass dump. One branch makes the function return NULL, which makes gcc guess that it may be a bit less likely than the other. Those are heuristics, which are tuned to help on average, but of course they are sometimes wrong. > The serious question is what is going on with this phi? > res_4 =3D PHI > > This makes zero sense practicality wise to me and how is > it supposed to be recognized and used? Note, I really do > need to transform the "0B" into something else for my > structure reorganization optimization. That's not a question? Are you asking why PHIs exist at all? They are the standard way to represent merging in SSA representations. You can iterate on the PHIs of a basic block, etc. > CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, i= s for the sole use of the intended recipient(s) and contains information th= at is confidential and proprietary to Ampere Computing or its subsidiaries.= It is to be used solely for the purpose of furthering the parties' busines= s relationship. Any unauthorized review, copying, or distribution of this e= mail (or any attachments thereto) is strictly prohibited. If you are not th= e intended recipient, please contact the sender immediately and permanently= delete the original and any copies of this email and any attachments there= to. Could you please get rid of this when posting on public mailing lists? -- Marc Glisse