[LLVMdev] Question about intrinsic function llvm.objectsize

Shuxin Yang shuxin.llvm at gmail.com
Wed Feb 27 11:37:54 PST 2013


This is not how LLVM disambiguates in the basicaa code fragment you 
quote below.
>>
>> The code fragment asserts that something can be assumed "no alias" if 
>> the access size of an memory access (i.e. a load or store) is bigger 
>> than the underlying object of the other accessed object.
>>
>> For you example below:
>>
>> V1Size = sizeof(mydata)
>> V2Size = say 4
>>
>> assuming that GetUnderlyingObject for addr1 and addr2 returns mydata:
> This assumption is wrong. The GetUnderlyingObject() return phi node 
> instead of &mydata.
>
>>
>> getObjectSize(O1) = sizeof(mydata)
>> getObjectSize(O2) = sizeof(mydata)
>>
>> this should be
>> isObjectSmallerThan(O2, V1Size) == false
>> isObjectSmallerThan(O1, V2Size) == false
>>
>> ??
I think the "getUnderlyingObject()" is actually "trying to get 
underlying object".  If it were able to figure
out the base address of the underlying object, it should be able to 
return the size of object along with
the base address of the underlying object.  For the end, it needs to 
duplicate some functionality of
ObjectSizeOffsetVisitor





More information about the llvm-dev mailing list