From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24078 invoked by alias); 24 Apr 2015 03:11:06 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 24068 invoked by uid 89); 24 Apr 2015 03:11:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com Received: from eu-smtp-delivery-143.mimecast.com (HELO eu-smtp-delivery-143.mimecast.com) (146.101.78.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 24 Apr 2015 03:11:04 +0000 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by uk-mta-17.uk.mimecast.lan; Fri, 24 Apr 2015 04:11:00 +0100 Received: from SHAWIN202 ([10.1.2.79]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 24 Apr 2015 04:10:59 +0100 From: "Thomas Preud'homme" To: "'Jeff Law'" , "Steven Bosscher" , , "'Richard Biener'" References: <000501d049d3$079385a0$16ba90e0$@arm.com> <552BBAF9.2010504@redhat.com> <000001d07821$6fb82f60$4f288e20$@arm.com> <5539B177.8020705@redhat.com> In-Reply-To: <5539B177.8020705@redhat.com> Subject: RE: [PATCH, GCC, stage1] Fallback to copy-prop if constant-prop not possible Date: Fri, 24 Apr 2015 03:11:00 -0000 Message-ID: <000501d07e3c$30f53c20$92dfb460$@arm.com> MIME-Version: 1.0 X-MC-Unique: QtqhuzV9RpePd01M-7E7bg-1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-04/txt/msg01479.txt.bz2 > From: Jeff Law [mailto:law@redhat.com] > Sent: Friday, April 24, 2015 10:59 AM >=20 Hi Jeff, > > + > > +static bool > > +cprop_reg_p (const_rtx x) > > +{ > > + return REG_P (x) && !HARD_REGISTER_P (x); > > +} > How about instead this move to a more visible location (perhaps a macro > in regs.h or an inline function). Then as a followup, change the > various places that have this sequence to use that common definition > that exist outside of cprop.c. According to Steven this was proposed in the past but was refused (see end of [1]). [1] https://gcc.gnu.org/ml/gcc-patches/2015-03/msg01066.html >=20 > > @@ -1191,7 +1192,7 @@ do_local_cprop (rtx x, rtx_insn *insn) > > /* Rule out USE instructions and ASM statements as we don't want > to > > change the hard registers mentioned. */ > > if (REG_P (x) > > - && (REGNO (x) >=3D FIRST_PSEUDO_REGISTER > > + && (cprop_reg_p (x) > > || (GET_CODE (PATTERN (insn)) !=3D USE > > && asm_noperands (PATTERN (insn)) < 0))) > Isn't the REG_P test now redundant? I made the same mistake when reviewing that change and indeed it's not. Note the opening parenthesis before cprop_reg_p that contains a bitwise OR expression. So in the case where cprop_reg_p is false, REG_P still needs to be true. We could keep a check on FIRST_PSEUDO_REGISTER but the intent (checking that the register is suitable for propagation) is clearer now, as pointed o= ut by Steven to me. >=20 > OK for the trunk with those changes. >=20 > jeff Given the above I intent to keep the REG_P in the second excerpt and will wait for your input about moving cprop_reg_p to rtl.h Best regards, Thomas