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

Dan Gohman gohman at apple.com
Fri Nov 6 17:48:16 PST 2009


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.

Dan





More information about the llvm-dev mailing list