[LLVMdev] How to partition registers into different RegisterClass?

Chris Lattner sabre at nondot.org
Tue Jul 26 12:44:16 PDT 2005


On Tue, 26 Jul 2005, Tzu-Chien Chiu wrote:
> 2005/7/26, Chris Lattner <sabre at nondot.org>:
>> Tzu-Chien Chiu wrote:
>>> The same problem exists when there are two types of costant registers,
>>> floating point and integer, and each is declared 'packed' ([4xfloat]
>>> and [4xint]). The instruction selector doesn't know which instruction
>>> it should produce because the newly defined MVT type 'packed' is
>>> always used for all operands (registers), even if it's acutally a
>>> [4xfloat] or [4xint].
>>
>> It might make sense to add two MVT enums: one for packed integers, and one
>> for packed floats?
>
> I thought about that too, but what if:
> * there are many packed types, 16 and 32-bit floating points, 16 and
> 32-bit integers, a lot of enums will be needed.
> * there number of elements in a packed type could vary.

You're right.  However, I would still prefer that you add an enum value 
for each format that you need.

> If SDOperand can return a "const Type *", the element type of the
> packed type can be obtained, and only one enum value 'packed' needed
> to be added to MVT::Type. Not only the element type can be available,
> but also the number of elements.

The problem with this approach is that it will inflate the size of the MVT 
representation.  The MVT is supposed to be an enum that can be used to 
index into tables.  Adding pointers to other types would make that not 
work.

In the future, as the number of different formats grows, we can reevaluate 
this decision.

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/




More information about the llvm-dev mailing list