[cfe-commits] patch: preserve address space

Mon Ping Wang wangmp at apple.com
Fri Jan 23 01:45:41 PST 2009


Hi Chris,

I'm trying not to agree with your interpretation but I think you are  
right :->.  CodeGen should not insert any implicit cast that changes  
address spaces, i.e., in LLVM IR, the type generated for p1->arr  
should have an address space.

   -- Mon Ping


On Jan 22, 2009, at 4:15 PM, Chris Lattner wrote:

>
> On Jan 21, 2009, at 11:30 PM, Mon Ping Wang wrote:
>
>> Hi Chris,
>>
>> The spec seems to imply that "p1->arr" should be type [int3] which  
>> means that
>>  int* ptr = p1->arr;
>>
>> is legal as the type are compatible though it is changing address  
>> spaces.
>>
>> From an implementation, it looks like today the LValue for the  
>> address has the correct address qualified type.  The Expression  
>> type for "p1->arr" would be have a different address space for its  
>> type.  CodeGen should be aware of this and not generate a bit cast  
>> to change the address space between the two types and make sure  
>> that in the LLVM IR we generate, the address space is passed  
>> correctly in the types.
>
> Hi Mon Ping,
>
> Does this mean that you agree with my interpretation?  Are you  
> asking a question? :)
>
> -Chris
>




More information about the cfe-commits mailing list