From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5163 invoked by alias); 17 Feb 2015 02:51:39 -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 5149 invoked by uid 89); 17 Feb 2015 02:51:38 -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: service87.mimecast.com Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 17 Feb 2015 02:51:37 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by service87.mimecast.com; Tue, 17 Feb 2015 02:51:34 +0000 Received: from SHAWIN202 ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 17 Feb 2015 02:51:33 +0000 From: "Thomas Preud'homme" To: "'Steven Bosscher'" Cc: "GCC Patches" References: <000501d049d3$079385a0$16ba90e0$@arm.com> In-Reply-To: Subject: RE: [PATCH, GCC, stage1] Fallback to copy-prop if constant-prop not possible Date: Tue, 17 Feb 2015 02:51:00 -0000 Message-ID: <000601d04a5c$a0c0f030$e242d090$@arm.com> MIME-Version: 1.0 X-MC-Unique: 115021702513401101 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-02/txt/msg00991.txt.bz2 > From: Steven Bosscher [mailto:stevenb.gcc@gmail.com] > Sent: Tuesday, February 17, 2015 4:19 AM > To: Thomas Preud'homme > Cc: GCC Patches; Richard Biener > Subject: Re: [PATCH, GCC, stage1] Fallback to copy-prop if constant-prop > not possible >=20 > On Mon, Feb 16, 2015 at 11:26 AM, Thomas Preud'homme wrote: >=20 > > /* Subroutine of cprop_insn that tries to propagate constants into > > @@ -1044,40 +1042,41 @@ cprop_insn (rtx_insn *insn) >=20 > > - /* Constant propagation. */ > > - if (cprop_constant_p (src)) > > - { > > - if (constprop_register (reg_used, src, insn)) > > + /* Constant propagation. */ > > + if (src_cst && cprop_constant_p (src_cst) > > + && constprop_register (reg_used, src_cst, insn)) > > { > > changed_this_round =3D changed =3D 1; > > global_const_prop_count++; >=20 > The cprop_constant_p test is redundant, you only have non-NULL > src_cst > if it is a cprop_constant_p (as you test for it in find_avail_set()). Ack. >=20 >=20 > > @@ -1087,18 +1086,16 @@ retry: > > "GLOBAL CONST-PROP: Replacing reg %d in ", r= egno); > > fprintf (dump_file, "insn %d with constant ", > > INSN_UID (insn)); > > - print_rtl (dump_file, src); > > + print_rtl (dump_file, src_cst); > > fprintf (dump_file, "\n"); > > } > > if (insn->deleted ()) > > return 1; > > } > > - } > > - else if (REG_P (src) > > - && REGNO (src) >=3D FIRST_PSEUDO_REGISTER > > - && REGNO (src) !=3D regno) > > - { > > - if (try_replace_reg (reg_used, src, insn)) > > + else if (src_reg && REG_P (src_reg) > > + && REGNO (src_reg) >=3D FIRST_PSEUDO_REGISTER > > + && REGNO (src_reg) !=3D regno > > + && try_replace_reg (reg_used, src_reg, insn)) >=20 > Likewise for the REG_P and ">=3D FIRST_PSEUDO_REGISTER" tests here > (with > the equivalent and IMHO preferable HARD_REGISTER_P test in > find_avail_set()). I'm not sure I follow you here. First, it seems to me that the equivalent test is rather REG_P && !HARD_REGISTER_P since here it checks if it's a pseudo register. Then, do you mean the test can be simply removed because of the REG_P && !HARD_REGISTER_P in hash_scan_set () called indirectly by compute_hash_table () when called in one_cprop_pass () before any cprop_insn ()? Or do you mean I should move the check in find_avail_set ()? Best regards, Thomas