This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Avoid unnecesary rescaning in IRA
- From: "Richard Guenther" <richard dot guenther at gmail dot com>
- To: "Jan Hubicka" <jh at suse dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sat, 27 Sep 2008 18:56:12 -0700
- Subject: Re: Avoid unnecesary rescaning in IRA
- References: <20080927154807.GK15922@kam.mff.cuni.cz>
On Sat, Sep 27, 2008 at 8:48 AM, Jan Hubicka <jh@suse.cz> wrote:
> Hi,
> while profiling large testcase I noticed that most of insn rescans come
> from change_loop that is doing update because change_regs returns true
> even for replacement of register by itself.
> Bootstrapped/regtested i686-linux, OK?
Ok.
Thanks,
Richard.
> * ira-emit.c (change_regs): Return false when replacing reg by itself.
> Index: ira-emit.c
> ===================================================================
> --- ira-emit.c (revision 140713)
> +++ ira-emit.c (working copy)
> @@ -137,6 +137,7 @@ change_regs (rtx *loc)
> int i, regno, result = false;
> const char *fmt;
> enum rtx_code code;
> + rtx reg;
>
> if (*loc == NULL_RTX)
> return false;
> @@ -151,7 +152,10 @@ change_regs (rtx *loc)
> return false;
> if (ira_curr_regno_allocno_map[regno] == NULL)
> return false;
> - *loc = ALLOCNO_REG (ira_curr_regno_allocno_map[regno]);
> + reg = ALLOCNO_REG (ira_curr_regno_allocno_map[regno]);
> + if (reg == *loc)
> + return false;
> + *loc = reg;
> return true;
> }
>
>