[LLVMdev] Type Legalizer Question.

Chris Lattner clattner at apple.com
Thu Oct 2 11:02:22 PDT 2008


On Oct 2, 2008, at 10:21 AM, Alireza.Moshtaghi at microchip.com wrote:

>
>>> Won't work; LLVM expects at least some basic operations, like add,
> to
>>> be legal in legal register types.
>>
>> That sounds like a bug, not a feature.
>>
>> -Chris
>
> I think the reason behind this behavior in llvm is the pointer
> calculations.
> When it comes to expanding operands, llvm does not have any case  
> defined
> for load (because its only operand is a pointer) and it asserts if it
> finds out that the pointer of store needs to be expanded...
>
> For all other targets, whatever register is used for pointer, that
> register can also be part of a legal operation of its own size.
> However, the problem with our target is that it allows only 8 bit
> calculations but also provides 16 bit pointers (2 8 bits)

Sure, I understand what you're saying.  My point was that features are  
added to LLVM on demand, and no targets in mainline need the ability  
to expand pointer operands.  Because nothing has needed it, noone has  
added it.

This doesn't mean that LLVM shouldn't support targets that need this  
functionality, just that it doesn't yet.  I'd really like to see LLVM  
expand to support these targets in a first-class way without hacks!

-Chris



More information about the llvm-dev mailing list