[LLVMdev] Type Legalizer Question.

Evan Cheng evan.cheng at apple.com
Wed Oct 1 23:39:48 PDT 2008


On Oct 1, 2008, at 3:01 AM, sanjiv gupta wrote:

> On Wed, 2008-10-01 at 11:12 +0200, Duncan Sands wrote:
>> Hi,
>>
>>> I have another query related to type legalizer.
>>> Can a target ignore certain nodes during legalize? Probably a hook  
>>> for
>>> target that can be called inside IgnoreNodeResults ()?
>>
>> while this could be done, I don't like the idea of doing an end-run
>> around the whole type legalization infrastructure.  So you would have
>> to come up with a pretty convincing argument as to why this can't be
>> done another way!
>>
>>> We want to keep certain nodes illegal, especially the pointer nodes.
>>> Our target has 16-bit pointer and a few 16-bit insns to perform
>>> arithmetic.
>>> Rest of the stuff is 8-bit so we want to use legalizer to expand  
>>> them.
>>
>> I think x86-32 is capable of doing a small number of 64 bit  
>> operations.
>> I wonder how they are handled/generated given that i64 is not a  
>> legal type?
>>
> They might be using DAGCombine to convert the operations back to 64- 
> bit.
> Also, the pointer is still a legal type (i32) in X86-32.
>
> In our case the pointers themselves are illegal (i16). We have 16-bit
> registers that can only hold pointers during indirect addressing. All
> other operations and registers are 8-bit. So we still want to expand
> everything to 8-bit but still keep the pointer nodes as an i16 node, a
> pair that in turn holds the expanded parts.

So you have a i16 register class which makes the type legal. You can  
make loads and stores legal (can you?). But you will have to custom  
lower all other i16 operations. This will work, but it requires a lot  
of target specific code.

Evan

>
>
> - Sanjiv
>
>
>
>
>
>> Ciao,
>>
>> Duncan.
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list