summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InferFunctionAttrs
diff options
context:
space:
mode:
authorPhilip Reames <listmail@philipreames.com>2016-01-04 22:49:23 +0000
committerPhilip Reames <listmail@philipreames.com>2016-01-04 22:49:23 +0000
commit2466719e448d7c010407a758cd7dc1d3ce9c959a (patch)
tree4a0a0afb4a330edc4f8b1de1b64b58f9da0ae6fc /llvm/test/Transforms/InferFunctionAttrs
parentbd364ce6945829b3ca124d4f1600ec5c6ec0cc80 (diff)
downloadbcm5719-llvm-2466719e448d7c010407a758cd7dc1d3ce9c959a.tar.gz
bcm5719-llvm-2466719e448d7c010407a758cd7dc1d3ce9c959a.zip
[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 llvm-svn: 256787
Diffstat (limited to 'llvm/test/Transforms/InferFunctionAttrs')
-rw-r--r--llvm/test/Transforms/InferFunctionAttrs/annotate.ll6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InferFunctionAttrs/annotate.ll b/llvm/test/Transforms/InferFunctionAttrs/annotate.ll
index 963f484eb55..709feb486c2 100644
--- a/llvm/test/Transforms/InferFunctionAttrs/annotate.ll
+++ b/llvm/test/Transforms/InferFunctionAttrs/annotate.ll
@@ -16,6 +16,12 @@ declare i32* @realloc(i32*, i32)
declare i32 @strcpy(...)
; CHECK: declare i32 @strcpy(...)
+; operator new routines
+declare i8* @_Znwj(i64)
+; CHECK: declare noalias nonnull i8* @_Znwj(i64)
+declare i8* @_Znwm(i64)
+; CHECK: declare noalias nonnull i8* @_Znwm(i64)
+
declare i32 @gettimeofday(i8*, i8*)
; CHECK-POSIX: declare i32 @gettimeofday(i8* nocapture, i8* nocapture) [[G0:#[0-9]+]]
OpenPOWER on IntegriCloud