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: reinit regs upon global reg variable (IRA regression)


On Thu, Mar 19, 2009 at 2:14 PM, Alexandre Oliva <aoliva@redhat.com> wrote:
> On Mar 19, 2009, Richard Guenther <richard.guenther@gmail.com> wrote:
>
>> On Thu, Mar 19, 2009 at 1:46 AM, Alexandre Oliva <aoliva@redhat.com> wrote:
>>> https://bugzilla.redhat.com/show_bug.cgi?id=490509
>
>>> Turns out the new register allocation is using outdated information:
>>> available (rather than fixed) register information in each register
>>> class is computed before compilation starts, but it wasn't updated when
>>> new registers became global, and IRA needs this information to be
>>> updated.
>
>> This looks like papering over a different issue.
>
> How so? ?Maybe the fix is sub-optimal, but I can't get from that to
> papering over a different issue.

Well, the issue would be init_regs called too early.  With
now always being in unit-at-a-time mode it should be possible to
expand global variables upfront.  But looking I see that it still
seems to be a mess, so ...

>> I see that globalize_reg is only called from make_decl_rtl
>
> Yup, that's where we realize the decl is bound to a specific global
> register and mark it as such, which must in turn recompute register
> classes before they're used by anything else.

... sure.  It also seems that ira_init is called very early.  Ugh.

>> we should call that when we process globals from the varpool.
>
> This might very well work. ?It would be fragile in other ways, though,
> in that it would depend on the current unit-at-a-time compilation mode.
> Unless recomputing these sets becomes a performance problem, recomputing
> them as soon as we make changes to the base sets works just fine and is
> far more robust.
>
>> So how do we end up in IRA before all the global regs have been
>> globalized?
>
> We don't. ?But they have been globalized after we computed the initial
> init_regs(), and we never recomputed it.

Given the mess the patch is ok.

Thanks,
Richard.


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