[LLVMdev] BasicAliasAnalysis: Null pointers do not alias with anything
Dan Gohman
gohman at apple.com
Mon Nov 9 11:29:18 PST 2009
On Nov 7, 2009, at 1:44 AM, Hans Wennborg wrote:
>
>
> 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.
Applied, thanks!
Dan
More information about the llvm-dev
mailing list