This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Question on register renaming in rtl loop unroll pass
- From: "Bin.Cheng" <amker dot cheng at gmail dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Thu, 4 Jul 2013 19:26:02 +0800
- Subject: Re: Question on register renaming in rtl loop unroll pass
- References: <CAHFci2-8WTRo4rGER6QHEoh_8tL0AXmpZqs4Sovy6OgeG2mm5g at mail dot gmail dot com> <1413819 dot OeunHWRmPy at polaris> <CAHFci2-yytJQe2soOn8avEvX_1_+PKDFgkvjr-iXjUFhRAdECw at mail dot gmail dot com> <7423234 dot mnWDPOWJz5 at polaris>
On Fri, Jun 28, 2013 at 6:39 PM, Eric Botcazou <ebotcazou@adacore.com> wrote:
>> The problem is auto-inc-dec is weak and can only capture
>> post-increment in first part of code, generating even worse code for
>> RA:
>> .L1:
>> r197 <- r162
>> [r197++] <- x
>> ...
>> [r162+4] <- y
>> r162 <- r197+0x4
>> ...
>> b .L1
>> Now we have two live registers and it seems hard to eliminate.
>>
>> So could the unrolled codes be like below?
>
> I'd try the opposite first, i.e to do more renaming so as to get smaller live
> ranges for the pseudo-registers and thus help the auto-inc-dec and RA passes.
Hi Eric, Thanks for your explanation.
It seems the unroller tends to replace:
use(i)
i = i + 1;
...
use(i)
i = i + 1;
...
use(i)
i = i + 1;
...
type of codes by:
use(i)
i0 = i + 1
...
use(i)
i = i0 + 1
...
use(i)
i = i0 + 2
...
I understand this splits long live range of "i" into short ones, but
since we have -fweb pass which does below transformation:
use(i)
i = i + 1;
...
use(i)
i = i + 1;
...
use(i)
i = i + 1;
...
into:
use(i)
i0 = i + 1
...
use(i0)
i1 = i0 + 1
...
use(i1)
i = i0 + 2
...
Why would we want "-fsplit-ivs-in-unroller" in the first place? As far
as live range is concerned, it seems "-fweb" works as good as
"-fsplit-ivs-in-unroller".
Thanks in advance.
--
Best Regards.