[LLVMdev] BasicAliasAnalysis: Null pointers do not alias with anything

Hans Wennborg hans at hanshq.net
Sat Nov 7 01:44:26 PST 2009



Dan Gohman wrote:
> On Nov 6, 2009, at 7:49 AM, Hans Wennborg wrote:
>> I'm not sure what you mean by generalizing.
>> Do you mean I should do the check on O1 and O2, which are the results of calls to getUnderlyingObject?
>>
>> Something like:
>>
>> if (const ConstantPointerNull *CPN = dyn_cast<ConstantPointerNull>(O1))
>> 	if (CPN->getType()->getAddressSpace() == 0)
>> 		return NoAlias;
>>
>> and the same for O2 (maybe extract it into a function?)
> 
> Yes, thanks.

Ok, patch with test case attached.

/ Hans

> 
> Dan
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: BasicAliasAnalysis.diff
Type: text/x-patch
Size: 1508 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20091107/4b1e737b/attachment.bin>


More information about the llvm-dev mailing list