[llvm-commits] [llvm] r123533 - in /llvm/trunk: include/llvm/IntrinsicInst.h lib/Analysis/LazyValueInfo.cpp

Chris Lattner clattner at apple.com
Sat Jan 15 18:13:36 PST 2011


On Jan 15, 2011, at 1:16 AM, Nick Lewycky wrote:

> Author: nicholas
> Date: Sat Jan 15 03:16:12 2011
> New Revision: 123533
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=123533&view=rev
> Log:
> Teach LazyValueInfo that allocas aren't NULL. Over all of llvm-test, this saves
> half a million non-local queries, each of which would otherwise have triggered a
> linear scan over a basic block.
> 
> Also fix a fixme for memory intrinsics which dereference pointers. With this,
> we prove that a pointer is non-null because it was dereferenced by an intrinsic
> 112 times in llvm-test.

Cool.  Please add a testcase for this, one other thing:

> +    if (MI->getRawDest() == Ptr || MI->getDest() == Ptr)
> +      return true;
> +    if (MemTransferInst *MTI = dyn_cast<MemTransferInst>(MI))
> +      return MTI->getRawSource() == Ptr || MTI->getSource() == Ptr;

Would it be better to do something like:

Ptr = Ptr->stripPointerCasts();

and then use MI->getDest()?

-Chris



More information about the llvm-commits mailing list