This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Reserving a number of consecutive registers
- From: Jean Christophe Beyler <jean dot christophe dot beyler at gmail dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 1 May 2009 16:41:20 -0400
- Subject: Re: Reserving a number of consecutive registers
- References: <c568a2600904171150y27a14be3x380a7fa2e967280e@mail.gmail.com> <c568a2600904211423m688a0484j254c48be13a49fc@mail.gmail.com> <c568a2600904300653y77d26cfr68d6f581cbda4c81@mail.gmail.com> <200904302116.03944.ebotcazou@adacore.com> <c568a2600905011333k2a5b24d5p4f6b2bd418c3b80a@mail.gmail.com>
Ok, I added a df_analyze at the beginning of my target reorg function
and now it works. Is there anything I should add to cleanup afterwards
?
Sorry about this, I'm slowly learning different parts of the GCC
compiler as I go,
Thanks again for all your help,
Jc
On Fri, May 1, 2009 at 4:33 PM, Jean Christophe Beyler
<jean.christophe.beyler@gmail.com> wrote:
> Yes, I have done that and now am looking to limit those numbers. For
> example, I don't copy back the ones that are not live-out registers.
> It works well but I am have an issue when recompiling the whole
> compiler.
>
> I've simplified this to this, if in my reorg function, I do only this ?:
>
> ? ?FOR_EACH_BB (bb)
> ? ?{
> ? ? ? ?bitmap regs_forw = BITMAP_ALLOC (®_obstack);
> ? ? ? ?bitmap_copy (regs_forw, df_get_live_in (bb));
> ? ? ? ?BITMAP_FREE (regs_forw);
> ? ?}
>
> It fails here:
> /home/beyler/cyclops64/src/cyclops64-gcc-4.3.2/libgcc/../gcc/libgcc2.c:
> In function '__divdi3':
> /home/beyler/cyclops64/src/cyclops64-gcc-4.3.2/libgcc/../gcc/libgcc2.c:1102:
> internal compiler error: Segmentation fault
>
> I'm looking into that now, am I allowed to be doing this in the reorg ?
> #0 ?df_get_live_in (bb=0xb7a9c8ac) at
> /home/beyler/cyclops64/src/cyclops64-gcc-4.3.2/gcc/df-problems.c:93
> 93 ? ? ? ? ?return DF_LR_IN (bb);
>
> Or is there a way to know if I'm allowed to do that copy?
> Thanks again,
> Jc
>
> On Thu, Apr 30, 2009 at 3:16 PM, Eric Botcazou <ebotcazou@adacore.com> wrote:
>>> Let's say I want to rename register r6 to r15. I can safely do that in
>>> the block if I know that r15 is not used in that basic block and that
>>> r6 is not a live-out of the basic block.
>>>
>>> However, how to handle the case where r6 is a live-out ? Then, I would
>>> have to make sure that r15 is not defined in another basic block, thus
>>> destroying my new live-out value?
>>>
>>> It seems to be a cat-mouse game:
>>>
>>> - I could copy back r15 to r6 in that case though I would like to try
>>> to not have to do that because that requires an extra copy at the end
>>> of the block
>>
>> Yes, you need to make a copy in this case but its cost could be offsetted by
>> the gain from the load_multiple. ?Or it could be eliminated by running a new
>> instance of cprop_hardreg. ?You need to experiment and tune the pass.
>>
>> --
>> Eric Botcazou
>>
>