From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 81230 invoked by alias); 9 Oct 2015 11:20:21 -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 81215 invoked by uid 89); 9 Oct 2015 11:20:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mailapp01.imgtec.com Received: from mailapp01.imgtec.com (HELO mailapp01.imgtec.com) (195.59.15.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 09 Oct 2015 11:20:15 +0000 Received: from KLMAIL01.kl.imgtec.org (unknown [192.168.5.35]) by Websense Email Security Gateway with ESMTPS id 956EDECE91B58; Fri, 9 Oct 2015 12:20:10 +0100 (IST) Received: from hhmail02.hh.imgtec.org (10.100.10.20) by KLMAIL01.kl.imgtec.org (192.168.5.35) with Microsoft SMTP Server (TLS) id 14.3.195.1; Fri, 9 Oct 2015 12:20:13 +0100 Received: from hhmail02.hh.imgtec.org ([::1]) by hhmail02.hh.imgtec.org ([::1]) with mapi id 14.03.0235.001; Fri, 9 Oct 2015 12:20:13 +0100 From: Robert Suchanek To: Bernd Schmidt , "ebotcazou@adacore.com" , "gcc-patches@gcc.gnu.org" Subject: RE: [RFC][PATCH] Preferred rename register in regrename pass Date: Fri, 09 Oct 2015 11:20:00 -0000 Message-ID: References: <55FC2B8D.6000106@redhat.com> <56179FC6.3040503@redhat.com> In-Reply-To: <56179FC6.3040503@redhat.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg00958.txt.bz2 Hi Bernd, > Hi Robert, > > gcc/ > > * regrename.c (create_new_chain): Initialize terminated_dead, > > renamed and tied_chain. > > (find_best_rename_reg): Pick and check register from the tied chain. > > (regrename_do_replace): Mark head as renamed. > > (scan_rtx_reg): Tie chains in move insns. Set terminate_dead flag. > > * regrename.h (struct du_head): Add tied_chain, renamed and > > terminated_dead members. >=20 > Thanks - this looks a lot better already. You didn't say how it was > bootstrapped and tested; please include this information for future > submissions. For a patch like this, some data on the improvement you got > would also be appreciated. Ah, sorry. I bootstrapped on x86_64-unknown-linux-gnu and ran the Dejagnu with -frename-registers. All looked fine. As for the data, I'll do=20 the comparison and will update this thread by next week. >=20 > I'd still like to investigate the possibility of further simplification: >=20 > > + { > > + /* Find the input chain. */ > > + for (i =3D c->id - 1; id_to_chain.iterate (i, &head); i--) > > + if (head->last && head->last->insn =3D=3D insn > > + && head->terminated_dead) > > + { > > + gcc_assert (head->regno =3D=3D REGNO (recog_data.operand[1])); > > + c->tied_chain =3D head; > > + head->tied_chain =3D c; > > + > > + if (dump_file) > > + fprintf (dump_file, "Tying chain %s (%d) with %s (%d)\n", > > + reg_names[c->regno], c->id, > > + reg_names[head->regno], head->id); > > + /* Once tied, we're done. */ > > + break; > > + } > > + } > > + } > > + > This looks like it's a little more complicated than necessary. Couldn't > you add a static var "terminated_this_insn" which gets initialized to > NULL and set when a reg dies, and then you check this here rather than > having a loop? That would also eliminate the new "terminated_dead" field. That is a good idea. I'll add the changes and update together with the results. > Other than that I'm pretty happy with this. >=20 >=20 > Bernd Regards, Robert