[LLVMdev] C embedded extensions and LLVM

Christopher Lamb christopher.lamb at gmail.com
Wed Nov 14 01:30:58 PST 2007

On Nov 12, 2007, at 11:38 PM, Chris Lattner wrote:

>>> In an ideal world, we'll just need flags on load/
>>> store nodes because the pointer registers will already be lowered to
>>> some other regclass.
>> I assume malloc's and memcpy's would need them as well?
> Yeah, seems likely.  I think malloc gets lowered in SDISel to a call
> though, so maybe it doesn't need it.  I'm not sure what "malloc from
> alternate address space" really means though.  There can only be one
> function named "malloc" :).

That's true. I guess I was thinking of "intrinsic" overloading, but  
you can't really do that based on return type, can you! Well, you  
could, but it'd be odd.

> Maybe LangRef should explicitly ban the
> malloc instruction from returning a pointer to an alternate address
> space?

Yes. I think that, in embedded C parlance, malloc should always  
return a pointer to the generic address space. If casting that  
pointer to another address space is valid given the target's rules,  
that's fine.

Christopher Lamb

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20071114/c4078b81/attachment.html>

More information about the llvm-dev mailing list