This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Avoid unnecesary rescaning in IRA


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;
>     }
>
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]