From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5504 invoked by alias); 4 Nov 2009 17:52:35 -0000 Received: (qmail 5495 invoked by uid 22791); 4 Nov 2009 17:52:34 -0000 X-SWARE-Spam-Status: No, hits=-0.9 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from portal.icerasemi.com (HELO pOrtaL.icerasemi.com) (213.249.204.90) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 04 Nov 2009 17:52:31 +0000 X-ASG-Debug-ID: 1257357147-088b00010000-ThFIni X-Barracuda-URL: http://192.168.1.243:80/cgi-bin/mark.cgi Received: from Exchangevs.Icerasemi.com (cluster1.icerasemi.local [192.168.1.203]) by pOrtaL.icerasemi.com (Spam & Virus Firewall) with ESMTP id A623761775; Wed, 4 Nov 2009 17:52:27 +0000 (GMT) Received: from Exchangevs.Icerasemi.com (cluster1.icerasemi.local [192.168.1.203]) by pOrtaL.icerasemi.com with ESMTP id I0Aqj0X4H5nu06vn; Wed, 04 Nov 2009 17:52:27 +0000 (GMT) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-ASG-Orig-Subj: RE: Understanding IRA Subject: RE: Understanding IRA Date: Wed, 04 Nov 2009 17:52:00 -0000 Message-ID: <4D60B0700D1DB54A8C0C6E9BE69163700C1F1BBA@EXCHANGEVS.IceraSemi.local> References: <4D60B0700D1DB54A8C0C6E9BE69163700BD6DB18@EXCHANGEVS.IceraSemi.local> <4AD888ED.1020102@redhat.com> <4AD89516.2070501@redhat.com> <4D60B0700D1DB54A8C0C6E9BE69163700BE00A8B@EXCHANGEVS.IceraSemi.local> <4AE0D6F7.9040006@redhat.com> From: "Ian Bolton" To: "Jeff Law" Cc: "Vladimir Makarov" , X-Barracuda-Connect: cluster1.icerasemi.local[192.168.1.203] X-Barracuda-Start-Time: 1257357147 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.13655 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 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: 2009-11/txt/msg00080.txt.bz2 Hi Jeff, =46rom an empirical perspective, the value of your patch is hard to determine at this stage - one benchmark improved about 0.5% but others have marginally regressed. =46rom an intellectual perspective, however, your patch is clearly a Good Thing. If I am understanding correctly, your aim is to prevent cases where reload evicts a pseudo from a register that conflicts with the pseudo that we are trying to reload, thereby undoing the clever cost- based logic in IRA that gave the register to the current owner in the first place? My guess is that the performance drop could be attributed to reload being lucky in some cases and your patch is preventing this luck from happening. Whilst I'm more of a risk-taker by nature, my employer would prefer more predictable behaviour from its compiler, so we will likely commit your patch to our development branch. Thanks very much! Is there an ETA on when reload will be gone away? ;-) Best regards, Ian =20 > -----Original Message----- > From: Jeff Law [mailto:law@redhat.com] > Sent: 22 October 2009 23:05 > To: Ian Bolton > Cc: Vladimir Makarov; gcc@gcc.gnu.org > Subject: Re: Understanding IRA >=20 > On 10/19/09 12:30, Ian Bolton wrote: > > Hi Jeff and Vladimir. > > > > Jeff: I'd be interested in trying the patch if you can send it my > way. > > > It's nothing special. >=20 > /* Return nonzero if REGNO is a particularly bad choice for reloading > X. */ > static int > ira_bad_reload_regno_1 (int regno, rtx x) > { > int x_regno; > ira_allocno_t a; > enum reg_class pref; >=20 > /* We only deal with pseudo regs. */ > if (! x || GET_CODE (x) !=3D REG) > return 0; >=20 > x_regno =3D REGNO (x); > if (x_regno < FIRST_PSEUDO_REGISTER) > return 0; >=20 > /* If the pseudo prefers REGNO explicitly, then do not consider > REGNO a bad spill choice. */ > pref =3D reg_preferred_class (x_regno); > if (reg_class_size[pref] =3D=3D 1 > && TEST_HARD_REG_BIT (reg_class_contents[pref], regno)) > return 0; >=20 > /* If the pseudo conflicts with REGNO, then we consider REGNO a > poor choice for a reload regno. */ > a =3D ira_regno_allocno_map[x_regno]; > if (TEST_HARD_REG_BIT (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a), regno)) > return 1; >=20 > return 0; > } >=20 > /* Return nonzero if REGNO is a particularly bad choice for reloading > IN or OUT. */ > int > ira_bad_reload_regno (int regno, rtx in, rtx out) > { > return (ira_bad_reload_regno_1 (regno, in) > || ira_bad_reload_regno_1 (regno, out)); > } >=20 > Then change the loop in allocate_reload_reg to iterate 3 times intead > of > 2. And add this fragment >=20 >=20 >=20 > if (pass =3D=3D 1 > && ira_bad_reload_regno (regnum, rld[r].in, rld[r].out)) > continue; >=20 >=20 > To body of hte conditional starting with >=20 > if ((reload_reg_free_p ... >=20 >=20 > It's really just a hack. I don't want to spend much time on that code > as ultimately I want it all to go away. >=20 > Jeff >=20 >=20 >=20