[MemoryBuiltins] Remove isOperatorNewLike by consolidating non-null inference handling
authorPhilip Reames <listmail@philipreames.com>
Mon, 4 Jan 2016 22:49:23 +0000 (22:49 +0000)
committerPhilip Reames <listmail@philipreames.com>
Mon, 4 Jan 2016 22:49:23 +0000 (22:49 +0000)
commite14c161b0e3691e5004303766678ec939155fd42
tree5a13ffebcec6203241ade717be7be9285685292f
parentcc6a69d0c01fbc883615ff853b34d319bf1fce01
[MemoryBuiltins] Remove isOperatorNewLike by consolidating non-null inference handling

This patch removes the isOperatorNewLike predicate since it was only being used to establish a non-null return value and we have attributes specifically for that purpose with generic handling. To keep approximate the same behaviour for existing frontends, I added the various operator new like (i.e. instances of operator new) to InferFunctionAttrs. It's not really clear to me why this isn't handled in Clang, but I didn't want to break existing code and any subtle assumptions it might have.

Once this patch is in, I'm going to start separating the isAllocLike family of predicates. These appear to be being used for a mixture of things which should be more clearly separated and documented. Today, they're being used to indicate (at least) aliasing facts, CSE-ability, and default values from an allocation site.

Differential Revision: http://reviews.llvm.org/D15820

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256787 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/MemoryBuiltins.h
lib/Analysis/MemoryBuiltins.cpp
lib/Analysis/ValueTracking.cpp
lib/Transforms/IPO/InferFunctionAttrs.cpp
test/Transforms/InferFunctionAttrs/annotate.ll
test/Transforms/InstSimplify/call.ll