From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4734 invoked by alias); 26 Sep 2011 07:39:56 -0000 Received: (qmail 4598 invoked by uid 22791); 26 Sep 2011 07:39:55 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,MSGID_MULTIPLE_AT,SPF_SOFTFAIL,TW_OV X-Spam-Check-By: sourceware.org Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Mon, 26 Sep 2011 07:39:42 +0000 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Mon, 26 Sep 2011 08:39:39 +0100 Received: from jiangningsh02 ([10.1.255.212]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 26 Sep 2011 08:39:37 +0100 From: "Jiangning Liu" To: "'Richard Guenther'" Cc: References: <4e3762ed.030d440a.1143.2af2SMTPIN_ADDED@mx.google.com> <4e72add8.c9d0e30a.142a.ffffe60eSMTPIN_ADDED@mx.google.com> In-Reply-To: Subject: RE: A case that PRE optimization hurts performance Date: Mon, 26 Sep 2011 08:34:00 -0000 Message-ID: <000901cc7c1f$6eab6b20$4c024160$@liu@arm.com> MIME-Version: 1.0 X-MC-Unique: 111092608393901701 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2011-09/txt/msg00304.txt.bz2 > > * Without PRE, > > > > Path1: > > =A0 =A0 =A0 =A0movl =A0 =A0$2, %eax > > =A0 =A0 =A0 =A0cmpl =A0 =A0$1, %eax > > =A0 =A0 =A0 =A0je =A0 =A0 =A0.L3 > > > > Path2: > > =A0 =A0 =A0 =A0movb =A0 =A0$3, %al > > =A0 =A0 =A0 =A0cmpl =A0 =A0$1, %eax > > =A0 =A0 =A0 =A0je =A0 =A0 =A0.L3 > > > > Path3: > > =A0 =A0 =A0 =A0cmpl =A0 =A0$1, %eax > > =A0 =A0 =A0 =A0jne =A0 =A0 .L14 > > > > * With PRE, > > > > Path1: > > =A0 =A0 =A0 =A0movl =A0 =A0$1, %ebx > > =A0 =A0 =A0 =A0movl =A0 =A0$2, %eax > > =A0 =A0 =A0 =A0testb =A0 %bl, %bl > > =A0 =A0 =A0 =A0je =A0 =A0 =A0.L3 > > > > Path2: > > =A0 =A0 =A0 =A0movl =A0 =A0$1, %ebx > > =A0 =A0 =A0 =A0movb =A0 =A0$3, %al > > =A0 =A0 =A0 =A0testb =A0 %bl, %bl > > =A0 =A0 =A0 =A0je =A0 =A0 =A0.L3 > > > > Path3: > > =A0 =A0 =A0 =A0cmpl =A0 =A0$1, %eax > > =A0 =A0 =A0 =A0setne =A0 %bl > > =A0 =A0 =A0 =A0testb =A0 %bl, %bl > > =A0 =A0 =A0 =A0jne =A0 =A0 .L14 > > > > Do you have any more thoughts? >=20 > It seems to me that with PRE all the testb %bl, %bl > should be evaluated at compile-time considering the > preceeding movl $1, %ebx. Am I missing something? >=20 Yes. Can this be done by PRE or any other optimizations in middle end? Thanks, -Jiangning > Richard. >=20