Ok, now in the easy case it seems to be working. I've handled most
cases but I was wondering about one problem that I don't seem to be
able to handle.

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
- I could go through all the blocks and rename all the r6s into r15s
and vice-versa. As long as they are regular registers (and not the
return register for example), it should work.

I don't see how to do to handle this case neatly, any ideas?

Thanks in advance,
Jc

On Tue, Apr 21, 2009 at 5:23 PM, Jean Christophe Beyler
<jean.christophe.bey...@gmail.com> wrote:
> Ok, I've been working at this and have actually made a bit of progress.
>
> - I now have a framework that finds the group of loads (let's assume
> they stay together).
>
> - With the DF framework, I'm able to figure out which registers are
> being used and which are free to be used.
>
> - I've pretty much got it to change the registers to the ones I want
> but there are still some corner cases where it seems to be badly
> handling that and actually changing the semantics of the program.
>
> I'll look into that, thanks,
> Jc
>
> On Mon, Apr 20, 2009 at 3:01 PM, Eric Botcazou <ebotca...@adacore.com> wrote:
>>> Ok, I'll try to look at that. Is there an area where I can see how to
>>> initialize the framework and get information about which registers are
>>> free?
>>
>> The API is in df.h, see for example ifcvt.c.
>>
>> --
>> Eric Botcazou
>>
>

Reply via email to