[llvm-commits] [llvm] r108118 - /llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp

Rafael Espindola espindola at google.com
Sun Jul 18 12:39:12 PDT 2010


On 18 July 2010 05:09, Lang Hames <lhames at gmail.com> wrote:
>> I think that the test for virtual registers is more strict than it needs
>> to be,
>> it should be possible to coalesce two virtual registers the class of one
>> is a subclass of the other.
>
> That certainly sounds safe if the destination class is a subclass of the
> source class. I assume going the other way is dangerous, in that it could
> leave junk in the non-aliased portion of the super-register?

Note that this *subclass*, not *subregister". I don't think in general
it is safe to coalesce if the two classes have different value types
(which is an interesting limitation now that I think of it).

Lets say we have two virtual registers V0 and V1. The first one is in
class S1 with physical registers R0, R1 and R2. The second one is in
class S2 with registers R0, R1 and R3. If we coalesce V0 and V1, what
physical registers can be used for the coalesced reg? R0 and R1.

In general, we should be able to coalesce two virtual registers if
they have the same value types and the resulting reg class is in the
intersection of the two original ones.

I wonder what would it take to be able to coalesce, for example, a
vector and a fp virtual register. Just moving the value type out of
the register class and into the individual operations?

> Cheers,
> Lang.

Cheers,
-- 
Rafael Ávila de Espíndola




More information about the llvm-commits mailing list