[llvm] 12c0bf8 - tests: add attributes that would normally come from inferattrs

Augie Fackler via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 25 14:29:07 PDT 2022


Author: Augie Fackler
Date: 2022-07-25T17:29:00-04:00
New Revision: 12c0bf8ba91db377f816afa701cf05beee2ab40b

URL: https://github.com/llvm/llvm-project/commit/12c0bf8ba91db377f816afa701cf05beee2ab40b
DIFF: https://github.com/llvm/llvm-project/commit/12c0bf8ba91db377f816afa701cf05beee2ab40b.diff

LOG: tests: add attributes that would normally come from inferattrs

As my goal is to remove at least _some_ functions from the static list
in MemoryBuiltins.cpp, these tests either need to run inferattrs or
statically declare these attributes to keep passing. A couple of tests
had alternate cases which are no longer meaningful, e.g.
`malloc-load-removal.ll`.

Differential Revision: https://reviews.llvm.org/D123087

Added: 
    

Modified: 
    llvm/test/Analysis/GlobalsModRef/indirect-global.ll
    llvm/test/Instrumentation/BoundsChecking/simple.ll
    llvm/test/Transforms/Attributor/heap_to_stack.ll
    llvm/test/Transforms/Attributor/lowerheap.ll
    llvm/test/Transforms/Coroutines/coro-split-00.ll
    llvm/test/Transforms/Coroutines/coro-split-hidden.ll
    llvm/test/Transforms/Coroutines/no-suspend.ll
    llvm/test/Transforms/DeadStoreElimination/2016-07-17-UseAfterFree.ll
    llvm/test/Transforms/DeadStoreElimination/calloc-store.ll
    llvm/test/Transforms/DeadStoreElimination/free.ll
    llvm/test/Transforms/DeadStoreElimination/multiblock-malloc-free.ll
    llvm/test/Transforms/DeadStoreElimination/operand-bundles.ll
    llvm/test/Transforms/DeadStoreElimination/simple.ll
    llvm/test/Transforms/GVN/calloc-load-removal.ll
    llvm/test/Transforms/GVN/malloc-load-removal.ll
    llvm/test/Transforms/GVN/nonescaping-malloc.ll
    llvm/test/Transforms/GVN/nonescaping.ll
    llvm/test/Transforms/GlobalOpt/2009-11-16-BrokenPerformHeapAllocSRoA.ll
    llvm/test/Transforms/GlobalOpt/2021-08-03-StoreOnceLoadMultiCasts.ll
    llvm/test/Transforms/GlobalOpt/calloc-promote.ll
    llvm/test/Transforms/GlobalOpt/malloc-promote-1.ll
    llvm/test/Transforms/GlobalOpt/malloc-promote-2.ll
    llvm/test/Transforms/GlobalOpt/malloc-promote-4.ll
    llvm/test/Transforms/GlobalOpt/malloc-promote-5.ll
    llvm/test/Transforms/GlobalOpt/malloc-promote-opaque-ptr.ll
    llvm/test/Transforms/GlobalOpt/null-check-is-use-pr35760.ll
    llvm/test/Transforms/InstCombine/alloc-realloc-free.ll
    llvm/test/Transforms/InstCombine/badmalloc.ll
    llvm/test/Transforms/InstCombine/builtin-dynamic-object-size.ll
    llvm/test/Transforms/InstCombine/compare-unescaped.ll
    llvm/test/Transforms/InstCombine/deref-alloc-fns.ll
    llvm/test/Transforms/InstCombine/getelementptr.ll
    llvm/test/Transforms/InstCombine/malloc-free-mismatched.ll
    llvm/test/Transforms/InstCombine/malloc-free.ll
    llvm/test/Transforms/InstCombine/malloc_free_delete_nvptx.ll
    llvm/test/Transforms/InstCombine/objsize-64.ll
    llvm/test/Transforms/InstCombine/objsize.ll
    llvm/test/Transforms/InstCombine/realloc-free.ll
    llvm/test/Transforms/InstCombine/realloc.ll
    llvm/test/Transforms/LowerConstantIntrinsics/builtin-object-size-phi.ll
    llvm/test/Transforms/LowerConstantIntrinsics/objectsize_basic.ll
    llvm/test/Transforms/MemCpyOpt/memcpy.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Analysis/GlobalsModRef/indirect-global.ll b/llvm/test/Analysis/GlobalsModRef/indirect-global.ll
index e0c484c847fad..a3b3ebd15ca59 100644
--- a/llvm/test/Analysis/GlobalsModRef/indirect-global.ll
+++ b/llvm/test/Analysis/GlobalsModRef/indirect-global.ll
@@ -9,7 +9,7 @@ target datalayout = "p:32:32:32"
 
 @G = internal global i32* null		; <i32**> [#uses=3]
 
-declare noalias i8* @malloc(i32)
+declare noalias i8* @malloc(i32) allockind("alloc,uninitialized") allocsize(0) inaccessiblememonly
 define void @malloc_init() {
 ; CHECK-LABEL: @malloc_init(
 ; CHECK-NEXT:    [[A:%.*]] = call dereferenceable_or_null(4) i8* @malloc(i32 4)
@@ -38,7 +38,7 @@ define i32 @malloc_test(i32* %P) {
 
 @G2 = internal global i32* null		; <i32**> [#uses=3]
 
-declare noalias i8* @calloc(i32, i32)
+declare noalias i8* @calloc(i32, i32) allockind("alloc,zeroed") allocsize(0,1) inaccessiblememonly
 define void @calloc_init() {
 ; CHECK-LABEL: @calloc_init(
 ; CHECK-NEXT:    [[A:%.*]] = call dereferenceable_or_null(4) i8* @calloc(i32 4, i32 1)

diff  --git a/llvm/test/Instrumentation/BoundsChecking/simple.ll b/llvm/test/Instrumentation/BoundsChecking/simple.ll
index f00d3b8e2c5f2..1934d17bd3097 100644
--- a/llvm/test/Instrumentation/BoundsChecking/simple.ll
+++ b/llvm/test/Instrumentation/BoundsChecking/simple.ll
@@ -6,9 +6,9 @@ target datalayout = "e-p:64:64:64-p1:16:16:16-i1:8:8-i8:8:8-i16:16:16-i32:32:32-
 @.str_as1 = private addrspace(1) constant [8 x i8] c"abcdefg\00"   ; <[8 x i8] addrspace(1)*>
 
 
-declare noalias i8* @malloc(i64) nounwind
-declare noalias i8* @calloc(i64, i64) nounwind
-declare noalias i8* @realloc(i8* nocapture, i64) nounwind
+declare noalias i8* @malloc(i64) nounwind allocsize(0)
+declare noalias i8* @calloc(i64, i64) nounwind allocsize(0,1)
+declare noalias i8* @realloc(i8* nocapture allocptr, i64) nounwind allocsize(1)
 
 ; CHECK: @f1
 define void @f1() nounwind {

diff  --git a/llvm/test/Transforms/Attributor/heap_to_stack.ll b/llvm/test/Transforms/Attributor/heap_to_stack.ll
index 4b5b385744b02..aadf46b22f6ca 100644
--- a/llvm/test/Transforms/Attributor/heap_to_stack.ll
+++ b/llvm/test/Transforms/Attributor/heap_to_stack.ll
@@ -1,10 +1,10 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals
-; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal  -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=5 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM
+; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal  -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=8 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM
 ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal  -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=8 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM
 ; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal  -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM
 ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal  -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM
 
-declare noalias i8* @malloc(i64)
+declare noalias i8* @malloc(i64) allockind("alloc,uninitialized") allocsize(0)
 
 declare void @nocapture_func_frees_pointer(i8* nocapture)
 
@@ -26,7 +26,7 @@ declare void @usei8(i8)
 
 declare i32 @no_return_call() noreturn
 
-declare void @free(i8* nocapture)
+declare void @free(i8* nocapture) allockind("free")
 
 declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) nounwind
 
@@ -46,13 +46,13 @@ define void @h2s_value_simplify_interaction(i1 %c, i8* %A) {
 ; IS________OPM-NEXT:    [[C2:%.*]] = bitcast i32* [[C1]] to i8*
 ; IS________OPM-NEXT:    [[L:%.*]] = load i8, i8* [[C2]], align 16
 ; IS________OPM-NEXT:    call void @usei8(i8 [[L]])
-; IS________OPM-NEXT:    call void @no_sync_func(i8* nocapture nofree noundef align 16 [[C2]]) #[[ATTR5:[0-9]+]]
+; IS________OPM-NEXT:    call void @no_sync_func(i8* nocapture nofree noundef align 16 [[C2]]) #[[ATTR9:[0-9]+]]
 ; IS________OPM-NEXT:    br label [[J]]
 ; IS________OPM:       dead:
 ; IS________OPM-NEXT:    unreachable
 ; IS________OPM:       j:
 ; IS________OPM-NEXT:    [[PHI:%.*]] = phi i8* [ [[M]], [[F]] ], [ null, [[F2]] ]
-; IS________OPM-NEXT:    tail call void @no_sync_func(i8* nocapture nofree noundef align 16 [[PHI]]) #[[ATTR5]]
+; IS________OPM-NEXT:    tail call void @no_sync_func(i8* nocapture nofree noundef align 16 [[PHI]]) #[[ATTR9]]
 ; IS________OPM-NEXT:    ret void
 ;
 ; IS________NPM-LABEL: define {{[^@]+}}@h2s_value_simplify_interaction
@@ -68,13 +68,13 @@ define void @h2s_value_simplify_interaction(i1 %c, i8* %A) {
 ; IS________NPM:       f2:
 ; IS________NPM-NEXT:    [[L:%.*]] = load i8, i8* [[M]], align 16
 ; IS________NPM-NEXT:    call void @usei8(i8 [[L]])
-; IS________NPM-NEXT:    call void @no_sync_func(i8* nocapture nofree noundef align 16 [[M]]) #[[ATTR6:[0-9]+]]
+; IS________NPM-NEXT:    call void @no_sync_func(i8* nocapture nofree noundef align 16 [[M]]) #[[ATTR10:[0-9]+]]
 ; IS________NPM-NEXT:    br label [[J]]
 ; IS________NPM:       dead:
 ; IS________NPM-NEXT:    unreachable
 ; IS________NPM:       j:
 ; IS________NPM-NEXT:    [[PHI:%.*]] = phi i8* [ [[M]], [[F]] ], [ null, [[F2]] ]
-; IS________NPM-NEXT:    tail call void @no_sync_func(i8* nocapture nofree noundef align 16 [[PHI]]) #[[ATTR6]]
+; IS________NPM-NEXT:    tail call void @no_sync_func(i8* nocapture nofree noundef align 16 [[PHI]]) #[[ATTR10]]
 ; IS________NPM-NEXT:    ret void
 ;
 entry:
@@ -185,7 +185,7 @@ define void @test3a(i8* %p) {
   ret void
 }
 
-declare noalias i8* @aligned_alloc(i64, i64)
+declare noalias i8* @aligned_alloc(i64 allocalign, i64) allockind("alloc,uninitialized,aligned") allocsize(1)
 
 define void @test3b(i8* %p) {
 ; IS________OPM-LABEL: define {{[^@]+}}@test3b
@@ -243,7 +243,7 @@ define void @test3d(i8* %p) {
   ret void
 }
 
-declare noalias i8* @calloc(i64, i64)
+declare noalias i8* @calloc(i64, i64) allockind("alloc,zeroed") allocsize(0,1)
 
 define void @test0() {
 ; IS________OPM-LABEL: define {{[^@]+}}@test0() {
@@ -266,15 +266,10 @@ define void @test0() {
 
 ; TEST 4
 define void @test4() {
-; IS________OPM-LABEL: define {{[^@]+}}@test4() {
-; IS________OPM-NEXT:    [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 noundef 4)
-; IS________OPM-NEXT:    tail call void @nofree_func(i8* noalias nocapture nofree [[TMP1]])
-; IS________OPM-NEXT:    ret void
-;
-; IS________NPM-LABEL: define {{[^@]+}}@test4() {
-; IS________NPM-NEXT:    [[DOTH2S:%.*]] = alloca i8, i64 4, align 1
-; IS________NPM-NEXT:    tail call void @nofree_func(i8* noalias nocapture nofree [[DOTH2S]])
-; IS________NPM-NEXT:    ret void
+; CHECK-LABEL: define {{[^@]+}}@test4() {
+; CHECK-NEXT:    [[DOTH2S:%.*]] = alloca i8, i64 4, align 1
+; CHECK-NEXT:    tail call void @nofree_func(i8* noalias nocapture nofree [[DOTH2S]])
+; CHECK-NEXT:    ret void
 ;
   %1 = tail call noalias i8* @malloc(i64 4)
   tail call void @nofree_func(i8* %1)
@@ -384,12 +379,12 @@ define void @test6(i32) {
 define void @test7() {
 ; IS________OPM-LABEL: define {{[^@]+}}@test7() {
 ; IS________OPM-NEXT:    [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 noundef 4)
-; IS________OPM-NEXT:    [[TMP2:%.*]] = tail call i32 @no_return_call() #[[ATTR3:[0-9]+]]
+; IS________OPM-NEXT:    [[TMP2:%.*]] = tail call i32 @no_return_call() #[[ATTR4:[0-9]+]]
 ; IS________OPM-NEXT:    unreachable
 ;
 ; IS________NPM-LABEL: define {{[^@]+}}@test7() {
 ; IS________NPM-NEXT:    [[DOTH2S:%.*]] = alloca i8, i64 4, align 1
-; IS________NPM-NEXT:    [[TMP1:%.*]] = tail call i32 @no_return_call() #[[ATTR3:[0-9]+]]
+; IS________NPM-NEXT:    [[TMP1:%.*]] = tail call i32 @no_return_call() #[[ATTR4:[0-9]+]]
 ; IS________NPM-NEXT:    unreachable
 ;
   %1 = tail call noalias i8* @malloc(i64 4)
@@ -427,7 +422,7 @@ define void @test9() {
 ; IS________OPM-NEXT:    tail call void @no_sync_func(i8* nocapture nofree [[TMP1]])
 ; IS________OPM-NEXT:    [[TMP2:%.*]] = bitcast i8* [[TMP1]] to i32*
 ; IS________OPM-NEXT:    store i32 10, i32* [[TMP2]], align 4
-; IS________OPM-NEXT:    tail call void @foo_nounw(i32* nofree noundef align 4 [[TMP2]]) #[[ATTR5]]
+; IS________OPM-NEXT:    tail call void @foo_nounw(i32* nofree noundef align 4 [[TMP2]]) #[[ATTR9]]
 ; IS________OPM-NEXT:    tail call void @free(i8* nocapture noundef nonnull align 4 dereferenceable(4) [[TMP1]])
 ; IS________OPM-NEXT:    ret void
 ;
@@ -436,7 +431,7 @@ define void @test9() {
 ; IS________NPM-NEXT:    tail call void @no_sync_func(i8* nocapture nofree [[TMP1]])
 ; IS________NPM-NEXT:    [[TMP2:%.*]] = bitcast i8* [[TMP1]] to i32*
 ; IS________NPM-NEXT:    store i32 10, i32* [[TMP2]], align 4
-; IS________NPM-NEXT:    tail call void @foo_nounw(i32* nofree noundef align 4 [[TMP2]]) #[[ATTR6]]
+; IS________NPM-NEXT:    tail call void @foo_nounw(i32* nofree noundef align 4 [[TMP2]]) #[[ATTR10]]
 ; IS________NPM-NEXT:    tail call void @free(i8* nocapture noundef nonnull align 4 dereferenceable(4) [[TMP1]])
 ; IS________NPM-NEXT:    ret void
 ;
@@ -514,13 +509,13 @@ define i32 @test_lifetime() {
 define void @test11() {
 ; IS________OPM-LABEL: define {{[^@]+}}@test11() {
 ; IS________OPM-NEXT:    [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 noundef 4)
-; IS________OPM-NEXT:    tail call void @sync_will_return(i8* [[TMP1]]) #[[ATTR5]]
+; IS________OPM-NEXT:    tail call void @sync_will_return(i8* [[TMP1]]) #[[ATTR9]]
 ; IS________OPM-NEXT:    tail call void @free(i8* nocapture [[TMP1]])
 ; IS________OPM-NEXT:    ret void
 ;
 ; IS________NPM-LABEL: define {{[^@]+}}@test11() {
 ; IS________NPM-NEXT:    [[DOTH2S:%.*]] = alloca i8, i64 4, align 1
-; IS________NPM-NEXT:    tail call void @sync_will_return(i8* [[DOTH2S]]) #[[ATTR6]]
+; IS________NPM-NEXT:    tail call void @sync_will_return(i8* [[DOTH2S]]) #[[ATTR10]]
 ; IS________NPM-NEXT:    ret void
 ;
   %1 = tail call noalias i8* @malloc(i64 4)
@@ -557,11 +552,10 @@ define i32 @irreducible_cfg(i32 %0) {
 ; IS________OPM-NEXT:    [[TMP14]] = add nsw i32 [[DOT1]], 1
 ; IS________OPM-NEXT:    br label [[TMP8]]
 ; IS________OPM:       15:
-; IS________OPM-NEXT:    [[TMP16:%.*]] = load i32, i32* [[TMP3]], align 4
-; IS________OPM-NEXT:    [[TMP17:%.*]] = bitcast i32* [[TMP3]] to i8*
-; IS________OPM-NEXT:    call void @free(i8* nocapture noundef [[TMP17]])
-; IS________OPM-NEXT:    [[TMP18:%.*]] = load i32, i32* [[TMP3]], align 4
-; IS________OPM-NEXT:    ret i32 [[TMP18]]
+; IS________OPM-NEXT:    [[TMP16:%.*]] = bitcast i32* [[TMP3]] to i8*
+; IS________OPM-NEXT:    call void @free(i8* nocapture noundef [[TMP16]])
+; IS________OPM-NEXT:    [[TMP17:%.*]] = load i32, i32* [[TMP3]], align 4
+; IS________OPM-NEXT:    ret i32 [[TMP17]]
 ;
 ; IS________NPM-LABEL: define {{[^@]+}}@irreducible_cfg
 ; IS________NPM-SAME: (i32 [[TMP0:%.*]]) {
@@ -631,43 +625,24 @@ define i32 @irreducible_cfg(i32 %0) {
 
 
 define i32 @malloc_in_loop(i32 %0) {
-; IS________OPM-LABEL: define {{[^@]+}}@malloc_in_loop
-; IS________OPM-SAME: (i32 [[TMP0:%.*]]) {
-; IS________OPM-NEXT:    [[TMP2:%.*]] = alloca i32, align 4
-; IS________OPM-NEXT:    [[TMP3:%.*]] = alloca i32*, align 8
-; IS________OPM-NEXT:    store i32 [[TMP0]], i32* [[TMP2]], align 4
-; IS________OPM-NEXT:    br label [[TMP4:%.*]]
-; IS________OPM:       4:
-; IS________OPM-NEXT:    [[TMP5:%.*]] = load i32, i32* [[TMP2]], align 4
-; IS________OPM-NEXT:    [[TMP6:%.*]] = add nsw i32 [[TMP5]], -1
-; IS________OPM-NEXT:    store i32 [[TMP6]], i32* [[TMP2]], align 4
-; IS________OPM-NEXT:    [[TMP7:%.*]] = icmp sgt i32 [[TMP6]], 0
-; IS________OPM-NEXT:    br i1 [[TMP7]], label [[TMP8:%.*]], label [[TMP11:%.*]]
-; IS________OPM:       8:
-; IS________OPM-NEXT:    [[TMP9:%.*]] = call noalias i8* @malloc(i64 noundef 4)
-; IS________OPM-NEXT:    [[TMP10:%.*]] = bitcast i8* [[TMP9]] to i32*
-; IS________OPM-NEXT:    br label [[TMP4]]
-; IS________OPM:       11:
-; IS________OPM-NEXT:    ret i32 5
-;
-; IS________NPM-LABEL: define {{[^@]+}}@malloc_in_loop
-; IS________NPM-SAME: (i32 [[TMP0:%.*]]) {
-; IS________NPM-NEXT:    [[TMP2:%.*]] = alloca i32, align 4
-; IS________NPM-NEXT:    [[TMP3:%.*]] = alloca i32*, align 8
-; IS________NPM-NEXT:    store i32 [[TMP0]], i32* [[TMP2]], align 4
-; IS________NPM-NEXT:    br label [[TMP4:%.*]]
-; IS________NPM:       4:
-; IS________NPM-NEXT:    [[TMP5:%.*]] = load i32, i32* [[TMP2]], align 4
-; IS________NPM-NEXT:    [[TMP6:%.*]] = add nsw i32 [[TMP5]], -1
-; IS________NPM-NEXT:    store i32 [[TMP6]], i32* [[TMP2]], align 4
-; IS________NPM-NEXT:    [[TMP7:%.*]] = icmp sgt i32 [[TMP6]], 0
-; IS________NPM-NEXT:    br i1 [[TMP7]], label [[TMP8:%.*]], label [[TMP10:%.*]]
-; IS________NPM:       8:
-; IS________NPM-NEXT:    [[DOTH2S:%.*]] = alloca i8, i64 4, align 1
-; IS________NPM-NEXT:    [[TMP9:%.*]] = bitcast i8* [[DOTH2S]] to i32*
-; IS________NPM-NEXT:    br label [[TMP4]]
-; IS________NPM:       10:
-; IS________NPM-NEXT:    ret i32 5
+; CHECK-LABEL: define {{[^@]+}}@malloc_in_loop
+; CHECK-SAME: (i32 [[TMP0:%.*]]) {
+; CHECK-NEXT:    [[TMP2:%.*]] = alloca i32, align 4
+; CHECK-NEXT:    [[TMP3:%.*]] = alloca i32*, align 8
+; CHECK-NEXT:    store i32 [[TMP0]], i32* [[TMP2]], align 4
+; CHECK-NEXT:    br label [[TMP4:%.*]]
+; CHECK:       4:
+; CHECK-NEXT:    [[TMP5:%.*]] = load i32, i32* [[TMP2]], align 4
+; CHECK-NEXT:    [[TMP6:%.*]] = add nsw i32 [[TMP5]], -1
+; CHECK-NEXT:    store i32 [[TMP6]], i32* [[TMP2]], align 4
+; CHECK-NEXT:    [[TMP7:%.*]] = icmp sgt i32 [[TMP6]], 0
+; CHECK-NEXT:    br i1 [[TMP7]], label [[TMP8:%.*]], label [[TMP10:%.*]]
+; CHECK:       8:
+; CHECK-NEXT:    [[DOTH2S:%.*]] = alloca i8, i64 4, align 1
+; CHECK-NEXT:    [[TMP9:%.*]] = bitcast i8* [[DOTH2S]] to i32*
+; CHECK-NEXT:    br label [[TMP4]]
+; CHECK:       10:
+; CHECK-NEXT:    ret i32 5
 ;
   %2 = alloca i32, align 4
   %3 = alloca i32*, align 8
@@ -820,7 +795,7 @@ define void @test16c(i8 %v, i8** %P) {
 ; IS________OPM-SAME: (i8 [[V:%.*]], i8** nocapture nofree writeonly [[P:%.*]]) {
 ; IS________OPM-NEXT:    [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 noundef 4)
 ; IS________OPM-NEXT:    store i8* [[TMP1]], i8** [[P]], align 8
-; IS________OPM-NEXT:    tail call void @no_sync_func(i8* nocapture nofree [[TMP1]]) #[[ATTR5]]
+; IS________OPM-NEXT:    tail call void @no_sync_func(i8* nocapture nofree [[TMP1]]) #[[ATTR9]]
 ; IS________OPM-NEXT:    tail call void @free(i8* nocapture [[TMP1]])
 ; IS________OPM-NEXT:    ret void
 ;
@@ -828,7 +803,7 @@ define void @test16c(i8 %v, i8** %P) {
 ; IS________NPM-SAME: (i8 [[V:%.*]], i8** nocapture nofree writeonly [[P:%.*]]) {
 ; IS________NPM-NEXT:    [[DOTH2S:%.*]] = alloca i8, i64 4, align 1
 ; IS________NPM-NEXT:    store i8* [[DOTH2S]], i8** [[P]], align 8
-; IS________NPM-NEXT:    tail call void @no_sync_func(i8* nocapture nofree [[DOTH2S]]) #[[ATTR6]]
+; IS________NPM-NEXT:    tail call void @no_sync_func(i8* nocapture nofree [[DOTH2S]]) #[[ATTR10]]
 ; IS________NPM-NEXT:    ret void
 ;
   %1 = tail call noalias i8* @malloc(i64 4)
@@ -850,18 +825,26 @@ define void @test16d(i8 %v, i8** %P) {
   ret void
 }
 ;.
-; IS________OPM: attributes #[[ATTR0:[0-9]+]] = { nounwind willreturn }
-; IS________OPM: attributes #[[ATTR1:[0-9]+]] = { nofree nosync willreturn }
-; IS________OPM: attributes #[[ATTR2:[0-9]+]] = { nofree nounwind }
-; IS________OPM: attributes #[[ATTR3]] = { noreturn }
-; IS________OPM: attributes #[[ATTR4:[0-9]+]] = { argmemonly nocallback nofree nosync nounwind willreturn }
-; IS________OPM: attributes #[[ATTR5]] = { nounwind }
+; IS________OPM: attributes #[[ATTR0:[0-9]+]] = { allockind("alloc,uninitialized") allocsize(0) }
+; IS________OPM: attributes #[[ATTR1:[0-9]+]] = { nounwind willreturn }
+; IS________OPM: attributes #[[ATTR2:[0-9]+]] = { nofree nosync willreturn }
+; IS________OPM: attributes #[[ATTR3:[0-9]+]] = { nofree nounwind }
+; IS________OPM: attributes #[[ATTR4]] = { noreturn }
+; IS________OPM: attributes #[[ATTR5:[0-9]+]] = { allockind("free") }
+; IS________OPM: attributes #[[ATTR6:[0-9]+]] = { argmemonly nocallback nofree nosync nounwind willreturn }
+; IS________OPM: attributes #[[ATTR7:[0-9]+]] = { allockind("alloc,uninitialized,aligned") allocsize(1) }
+; IS________OPM: attributes #[[ATTR8:[0-9]+]] = { allockind("alloc,zeroed") allocsize(0,1) }
+; IS________OPM: attributes #[[ATTR9]] = { nounwind }
 ;.
-; IS________NPM: attributes #[[ATTR0:[0-9]+]] = { nounwind willreturn }
-; IS________NPM: attributes #[[ATTR1:[0-9]+]] = { nofree nosync willreturn }
-; IS________NPM: attributes #[[ATTR2:[0-9]+]] = { nofree nounwind }
-; IS________NPM: attributes #[[ATTR3]] = { noreturn }
-; IS________NPM: attributes #[[ATTR4:[0-9]+]] = { argmemonly nocallback nofree nosync nounwind willreturn }
-; IS________NPM: attributes #[[ATTR5:[0-9]+]] = { argmemonly nocallback nofree nounwind willreturn writeonly }
-; IS________NPM: attributes #[[ATTR6]] = { nounwind }
+; IS________NPM: attributes #[[ATTR0:[0-9]+]] = { allockind("alloc,uninitialized") allocsize(0) }
+; IS________NPM: attributes #[[ATTR1:[0-9]+]] = { nounwind willreturn }
+; IS________NPM: attributes #[[ATTR2:[0-9]+]] = { nofree nosync willreturn }
+; IS________NPM: attributes #[[ATTR3:[0-9]+]] = { nofree nounwind }
+; IS________NPM: attributes #[[ATTR4]] = { noreturn }
+; IS________NPM: attributes #[[ATTR5:[0-9]+]] = { allockind("free") }
+; IS________NPM: attributes #[[ATTR6:[0-9]+]] = { argmemonly nocallback nofree nosync nounwind willreturn }
+; IS________NPM: attributes #[[ATTR7:[0-9]+]] = { allockind("alloc,uninitialized,aligned") allocsize(1) }
+; IS________NPM: attributes #[[ATTR8:[0-9]+]] = { allockind("alloc,zeroed") allocsize(0,1) }
+; IS________NPM: attributes #[[ATTR9:[0-9]+]] = { argmemonly nocallback nofree nounwind willreturn writeonly }
+; IS________NPM: attributes #[[ATTR10]] = { nounwind }
 ;.

diff  --git a/llvm/test/Transforms/Attributor/lowerheap.ll b/llvm/test/Transforms/Attributor/lowerheap.ll
index b4e95c22ad8df..d11415723d2be 100644
--- a/llvm/test/Transforms/Attributor/lowerheap.ll
+++ b/llvm/test/Transforms/Attributor/lowerheap.ll
@@ -6,16 +6,16 @@
 
 declare i64 @subfn(i8*) #0
 
-declare noalias i8* @malloc(i64)
-declare noalias i8* @calloc(i64, i64)
-declare void @free(i8*)
+declare noalias i8* @malloc(i64) allockind("alloc,uninitialized") allocsize(0) "alloc-family"="malloc"
+declare noalias i8* @calloc(i64, i64) allockind("alloc,zeroed") allocsize(0,1) "alloc-family"="malloc"
+declare void @free(i8*) allockind("free") "alloc-family"="malloc"
 
 define i64 @f(i64 %len) {
 ; IS________OPM-LABEL: define {{[^@]+}}@f
 ; IS________OPM-SAME: (i64 [[LEN:%.*]]) {
 ; IS________OPM-NEXT:  entry:
 ; IS________OPM-NEXT:    [[MEM:%.*]] = call noalias i8* @malloc(i64 [[LEN]])
-; IS________OPM-NEXT:    [[RES:%.*]] = call i64 @subfn(i8* [[MEM]]) #[[ATTR1:[0-9]+]]
+; IS________OPM-NEXT:    [[RES:%.*]] = call i64 @subfn(i8* [[MEM]]) #[[ATTR4:[0-9]+]]
 ; IS________OPM-NEXT:    call void @free(i8* [[MEM]])
 ; IS________OPM-NEXT:    ret i64 [[RES]]
 ;
@@ -23,7 +23,7 @@ define i64 @f(i64 %len) {
 ; IS________NPM-SAME: (i64 [[LEN:%.*]]) {
 ; IS________NPM-NEXT:  entry:
 ; IS________NPM-NEXT:    [[MEM_H2S:%.*]] = alloca i8, i64 [[LEN]], align 1
-; IS________NPM-NEXT:    [[RES:%.*]] = call i64 @subfn(i8* [[MEM_H2S]]) #[[ATTR2:[0-9]+]]
+; IS________NPM-NEXT:    [[RES:%.*]] = call i64 @subfn(i8* [[MEM_H2S]]) #[[ATTR5:[0-9]+]]
 ; IS________NPM-NEXT:    ret i64 [[RES]]
 ;
 entry:
@@ -39,7 +39,7 @@ define i64 @g(i64 %len) {
 ; IS________OPM-SAME: (i64 [[LEN:%.*]]) {
 ; IS________OPM-NEXT:  entry:
 ; IS________OPM-NEXT:    [[MEM:%.*]] = call noalias i8* @calloc(i64 [[LEN]], i64 noundef 8)
-; IS________OPM-NEXT:    [[RES:%.*]] = call i64 @subfn(i8* [[MEM]]) #[[ATTR1]]
+; IS________OPM-NEXT:    [[RES:%.*]] = call i64 @subfn(i8* [[MEM]]) #[[ATTR4]]
 ; IS________OPM-NEXT:    call void @free(i8* [[MEM]])
 ; IS________OPM-NEXT:    ret i64 [[RES]]
 ;
@@ -49,7 +49,7 @@ define i64 @g(i64 %len) {
 ; IS________NPM-NEXT:    [[TMP0:%.*]] = mul i64 [[LEN]], 8
 ; IS________NPM-NEXT:    [[MEM_H2S:%.*]] = alloca i8, i64 [[TMP0]], align 1
 ; IS________NPM-NEXT:    call void @llvm.memset.p0i8.i64(i8* [[MEM_H2S]], i8 0, i64 [[TMP0]], i1 false)
-; IS________NPM-NEXT:    [[RES:%.*]] = call i64 @subfn(i8* [[MEM_H2S]]) #[[ATTR2]]
+; IS________NPM-NEXT:    [[RES:%.*]] = call i64 @subfn(i8* [[MEM_H2S]]) #[[ATTR5]]
 ; IS________NPM-NEXT:    ret i64 [[RES]]
 ;
 entry:
@@ -62,9 +62,15 @@ entry:
 attributes #0 = { nounwind willreturn }
 ;.
 ; IS________OPM: attributes #[[ATTR0:[0-9]+]] = { nounwind willreturn }
-; IS________OPM: attributes #[[ATTR1]] = { nounwind }
+; IS________OPM: attributes #[[ATTR1:[0-9]+]] = { allockind("alloc,uninitialized") allocsize(0) "alloc-family"="malloc" }
+; IS________OPM: attributes #[[ATTR2:[0-9]+]] = { allockind("alloc,zeroed") allocsize(0,1) "alloc-family"="malloc" }
+; IS________OPM: attributes #[[ATTR3:[0-9]+]] = { allockind("free") "alloc-family"="malloc" }
+; IS________OPM: attributes #[[ATTR4]] = { nounwind }
 ;.
 ; IS________NPM: attributes #[[ATTR0:[0-9]+]] = { nounwind willreturn }
-; IS________NPM: attributes #[[ATTR1:[0-9]+]] = { argmemonly nocallback nofree nounwind willreturn writeonly }
-; IS________NPM: attributes #[[ATTR2]] = { nounwind }
+; IS________NPM: attributes #[[ATTR1:[0-9]+]] = { allockind("alloc,uninitialized") allocsize(0) "alloc-family"="malloc" }
+; IS________NPM: attributes #[[ATTR2:[0-9]+]] = { allockind("alloc,zeroed") allocsize(0,1) "alloc-family"="malloc" }
+; IS________NPM: attributes #[[ATTR3:[0-9]+]] = { allockind("free") "alloc-family"="malloc" }
+; IS________NPM: attributes #[[ATTR4:[0-9]+]] = { argmemonly nocallback nofree nounwind willreturn writeonly }
+; IS________NPM: attributes #[[ATTR5]] = { nounwind }
 ;.

diff  --git a/llvm/test/Transforms/Coroutines/coro-split-00.ll b/llvm/test/Transforms/Coroutines/coro-split-00.ll
index c34313aef59b1..36a748b43b6b9 100644
--- a/llvm/test/Transforms/Coroutines/coro-split-00.ll
+++ b/llvm/test/Transforms/Coroutines/coro-split-00.ll
@@ -74,8 +74,8 @@ declare i1 @llvm.coro.alloc(token)
 declare i8* @llvm.coro.begin(token, i8*)
 declare i1 @llvm.coro.end(i8*, i1) 
 
-declare noalias i8* @malloc(i32)
+declare noalias i8* @malloc(i32) allockind("alloc,uninitialized") "alloc-family"="malloc"
 declare void @print(i32)
-declare void @free(i8*) willreturn
+declare void @free(i8*) willreturn allockind("free") "alloc-family"="malloc"
 
 !0 = !{i32 846595819, i8** null}

diff  --git a/llvm/test/Transforms/Coroutines/coro-split-hidden.ll b/llvm/test/Transforms/Coroutines/coro-split-hidden.ll
index eab86eba41009..a783d7d8960d5 100644
--- a/llvm/test/Transforms/Coroutines/coro-split-hidden.ll
+++ b/llvm/test/Transforms/Coroutines/coro-split-hidden.ll
@@ -76,6 +76,6 @@ declare i1 @llvm.coro.alloc(token)
 declare i8* @llvm.coro.begin(token, i8*)
 declare i1 @llvm.coro.end(i8*, i1)
 
-declare noalias i8* @malloc(i32)
+declare noalias i8* @malloc(i32) allockind("alloc,uninitialized")
 declare void @print(i32)
-declare void @free(i8*) willreturn
+declare void @free(i8*) willreturn allockind("free")

diff  --git a/llvm/test/Transforms/Coroutines/no-suspend.ll b/llvm/test/Transforms/Coroutines/no-suspend.ll
index 6534cca115abf..a8f773e5d049c 100644
--- a/llvm/test/Transforms/Coroutines/no-suspend.ll
+++ b/llvm/test/Transforms/Coroutines/no-suspend.ll
@@ -413,8 +413,8 @@ lpad:
   resume { i8*, i32 } %lpval
 }
 
-declare i8* @malloc(i32)
-declare void @free(i8*) willreturn
+declare i8* @malloc(i32) allockind("alloc,uninitialized") allocsize(0)
+declare void @free(i8*) willreturn allockind("free")
 declare void @print(i32)
 declare void @foo()
 

diff  --git a/llvm/test/Transforms/DeadStoreElimination/2016-07-17-UseAfterFree.ll b/llvm/test/Transforms/DeadStoreElimination/2016-07-17-UseAfterFree.ll
index 3501b43600168..4bbbcb870e5a2 100644
--- a/llvm/test/Transforms/DeadStoreElimination/2016-07-17-UseAfterFree.ll
+++ b/llvm/test/Transforms/DeadStoreElimination/2016-07-17-UseAfterFree.ll
@@ -23,10 +23,10 @@ entry:
 }
 
 ; Function Attrs: nounwind
-declare void @free(i8* nocapture) local_unnamed_addr #0
+declare void @free(i8* nocapture allocptr) local_unnamed_addr #0
 
 ; Function Attrs: argmemonly nounwind
 declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1) #1
 
-attributes #0 = { nounwind }
+attributes #0 = { nounwind allockind("free")}
 attributes #1 = { argmemonly nounwind }

diff  --git a/llvm/test/Transforms/DeadStoreElimination/calloc-store.ll b/llvm/test/Transforms/DeadStoreElimination/calloc-store.ll
index 26fe2b9074326..de0e55e33c0f8 100644
--- a/llvm/test/Transforms/DeadStoreElimination/calloc-store.ll
+++ b/llvm/test/Transforms/DeadStoreElimination/calloc-store.ll
@@ -1,6 +1,6 @@
 ; RUN: opt < %s -basic-aa -dse -S | FileCheck %s
 
-declare noalias i8* @calloc(i64, i64) inaccessiblememonly
+declare noalias i8* @calloc(i64, i64) inaccessiblememonly allockind("alloc,zeroed")
 
 define i32* @test1() {
 ; CHECK-LABEL: test1

diff  --git a/llvm/test/Transforms/DeadStoreElimination/free.ll b/llvm/test/Transforms/DeadStoreElimination/free.ll
index 40001150ea957..abde433c3855b 100644
--- a/llvm/test/Transforms/DeadStoreElimination/free.ll
+++ b/llvm/test/Transforms/DeadStoreElimination/free.ll
@@ -3,8 +3,8 @@
 
 target datalayout = "e-p:64:64:64"
 
-declare void @free(i8* nocapture)
-declare noalias i8* @malloc(i64)
+declare void @free(i8* nocapture) allockind("free")
+declare noalias i8* @malloc(i64) allockind("alloc,uninitialized")
 
 define void @test(i32* %Q, i32* %P) {
 ; CHECK-LABEL: @test(

diff  --git a/llvm/test/Transforms/DeadStoreElimination/multiblock-malloc-free.ll b/llvm/test/Transforms/DeadStoreElimination/multiblock-malloc-free.ll
index c35fb30983f51..68256ecf56e2a 100644
--- a/llvm/test/Transforms/DeadStoreElimination/multiblock-malloc-free.ll
+++ b/llvm/test/Transforms/DeadStoreElimination/multiblock-malloc-free.ll
@@ -367,9 +367,9 @@ cleanup:                                          ; preds = %entry, %if.end5, %i
   ret %struct.BitfieldStruct* %retval.0
 }
 
-attributes #0 = { nofree nounwind allocsize(0) }
+attributes #0 = { nofree nounwind allocsize(0) allockind("alloc,uninitialized") }
 attributes #1 = { nofree nounwind }
-attributes #2 = { nounwind }
+attributes #2 = { nounwind allockind("free") }
 attributes #3 = { allocsize(0,1) }
 attributes #4 = { allocsize(0) }
-attributes #5 = { nofree nounwind allocsize(0,1) }
+attributes #5 = { nofree nounwind allocsize(0,1) allockind("alloc,zeroed") }

diff  --git a/llvm/test/Transforms/DeadStoreElimination/operand-bundles.ll b/llvm/test/Transforms/DeadStoreElimination/operand-bundles.ll
index 85a64c887dd6b..6305dc5844c79 100644
--- a/llvm/test/Transforms/DeadStoreElimination/operand-bundles.ll
+++ b/llvm/test/Transforms/DeadStoreElimination/operand-bundles.ll
@@ -42,7 +42,7 @@ define void @test3() {
   ret void
 }
 
-declare noalias i8* @calloc(i64, i64) inaccessiblememonly
+declare noalias i8* @calloc(i64, i64) inaccessiblememonly allockind("alloc,zeroed")
 
 define void @test4() {
 ; CHECK-LABEL: @test4

diff  --git a/llvm/test/Transforms/DeadStoreElimination/simple.ll b/llvm/test/Transforms/DeadStoreElimination/simple.ll
index 1eeaec8825073..721124e5384f1 100644
--- a/llvm/test/Transforms/DeadStoreElimination/simple.ll
+++ b/llvm/test/Transforms/DeadStoreElimination/simple.ll
@@ -264,9 +264,9 @@ define i32 addrspace(1)* @test13_addrspacecast() {
 }
 
 
-declare noalias i8* @malloc(i64) willreturn
+declare noalias i8* @malloc(i64) willreturn allockind("alloc,uninitialized")
 declare noalias i8* @custom_malloc(i32) willreturn
-declare noalias i8* @calloc(i32, i32) willreturn
+declare noalias i8* @calloc(i32, i32) willreturn allockind("alloc,zeroed")
 
 define void @test14(i32* %Q) {
 ; CHECK-LABEL: @test14(
@@ -693,7 +693,7 @@ entry:
   ret void
 }
 
-declare void @free(i8* nocapture)
+declare void @free(i8* nocapture) allockind("free")
 
 ; We cannot remove `store i32 1, i32* %p`, because @unknown_func may unwind
 ; and the caller may read %p while unwinding.

diff  --git a/llvm/test/Transforms/GVN/calloc-load-removal.ll b/llvm/test/Transforms/GVN/calloc-load-removal.ll
index e275b917e77de..ad34a719e87ed 100644
--- a/llvm/test/Transforms/GVN/calloc-load-removal.ll
+++ b/llvm/test/Transforms/GVN/calloc-load-removal.ll
@@ -1,5 +1,4 @@
 ; RUN: opt -S -basic-aa -gvn < %s | FileCheck %s
-; RUN: opt -S -basic-aa -gvn -disable-simplify-libcalls < %s | FileCheck %s -check-prefix=CHECK_NO_LIBCALLS
 ; Check that loads from calloc are recognized as being zero.
 
 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
@@ -46,4 +45,4 @@ bb4:
 ; CHECK_NO_LIBCALLS: ret i32 %
 }
 
-declare noalias i8* @calloc(i64, i64)
+declare noalias i8* @calloc(i64, i64) allockind("alloc,zeroed") allocsize(0,1)

diff  --git a/llvm/test/Transforms/GVN/malloc-load-removal.ll b/llvm/test/Transforms/GVN/malloc-load-removal.ll
index 57fb89225efd0..dc89f38179171 100644
--- a/llvm/test/Transforms/GVN/malloc-load-removal.ll
+++ b/llvm/test/Transforms/GVN/malloc-load-removal.ll
@@ -1,11 +1,10 @@
 ; RUN: opt -S -basic-aa -gvn < %s | FileCheck %s
-; RUN: opt -S -basic-aa -gvn -disable-simplify-libcalls < %s | FileCheck %s -check-prefix=CHECK_NO_LIBCALLS
 ; PR13694
 
 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
 target triple = "x86_64-apple-macosx10.8.0"
 
-declare noalias i8* @malloc(i64) nounwind
+declare noalias i8* @malloc(i64) nounwind allockind("alloc,uninitialized") allocsize(0)
 
 define noalias i8* @test1() nounwind uwtable ssp {
 entry:
@@ -55,7 +54,7 @@ if.end:                                           ; preds = %if.then, %entry
 ; CHECK_NO_LIBCALLS: icmp
 }
 
-declare noalias i8* @aligned_alloc(i64, i64) nounwind
+declare noalias i8* @aligned_alloc(i64 allocalign, i64) nounwind allockind("alloc,uninitialized,aligned") allocsize(1)
 
 define noalias i8* @test3() nounwind uwtable ssp {
 entry:

diff  --git a/llvm/test/Transforms/GVN/nonescaping-malloc.ll b/llvm/test/Transforms/GVN/nonescaping-malloc.ll
index fd61835e14a40..67dce4887974b 100644
--- a/llvm/test/Transforms/GVN/nonescaping-malloc.ll
+++ b/llvm/test/Transforms/GVN/nonescaping-malloc.ll
@@ -35,7 +35,7 @@ entry:
 
 declare i64 @strlen(i8* nocapture) nounwind readonly
 
-declare noalias i8* @malloc(i64) nounwind
+declare noalias i8* @malloc(i64) nounwind allockind("alloc,uninitialized") allocsize(0) inaccessiblememonly
 
 declare i32 @_ZN4llvm13StringMapImpl15LookupBucketForENS_9StringRefE(%"struct.llvm::StringMapImpl"*, i64, i64)
 

diff  --git a/llvm/test/Transforms/GVN/nonescaping.ll b/llvm/test/Transforms/GVN/nonescaping.ll
index 61ec38b5bfe38..1672b01efb3bc 100644
--- a/llvm/test/Transforms/GVN/nonescaping.ll
+++ b/llvm/test/Transforms/GVN/nonescaping.ll
@@ -4,8 +4,8 @@
 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
 target triple = "x86_64-apple-darwin10.0"
 
-declare noalias i8* @malloc(i64) nounwind
-declare noalias i8* @calloc(i64, i64)
+declare noalias i8* @malloc(i64) nounwind allockind("alloc,uninitialized") allocsize(0) inaccessiblememonly
+declare noalias i8* @calloc(i64, i64) allockind("alloc,zeroed") allocsize(0,1) inaccessiblememonly
 declare noalias i8* @_Znwm(i64)
 declare void @escape(i8*)
 

diff  --git a/llvm/test/Transforms/GlobalOpt/2009-11-16-BrokenPerformHeapAllocSRoA.ll b/llvm/test/Transforms/GlobalOpt/2009-11-16-BrokenPerformHeapAllocSRoA.ll
index cabb750d19e5f..0a62cba7945f6 100644
--- a/llvm/test/Transforms/GlobalOpt/2009-11-16-BrokenPerformHeapAllocSRoA.ll
+++ b/llvm/test/Transforms/GlobalOpt/2009-11-16-BrokenPerformHeapAllocSRoA.ll
@@ -23,4 +23,4 @@ define void @test() nounwind ssp {
   ret void
 }
 
-declare noalias i8* @malloc(i64)
+declare noalias i8* @malloc(i64) allockind("alloc,uninitialized")

diff  --git a/llvm/test/Transforms/GlobalOpt/2021-08-03-StoreOnceLoadMultiCasts.ll b/llvm/test/Transforms/GlobalOpt/2021-08-03-StoreOnceLoadMultiCasts.ll
index 7acd56d78d10d..7e94cc5af56f8 100644
--- a/llvm/test/Transforms/GlobalOpt/2021-08-03-StoreOnceLoadMultiCasts.ll
+++ b/llvm/test/Transforms/GlobalOpt/2021-08-03-StoreOnceLoadMultiCasts.ll
@@ -40,5 +40,5 @@ entry:
   ret i32 %1
 }
 
-declare noalias align 16 i8* @malloc(i64)
+declare noalias align 16 i8* @malloc(i64) allockind("alloc,uninitialized") allocsize(0)
 declare void @f1()

diff  --git a/llvm/test/Transforms/GlobalOpt/calloc-promote.ll b/llvm/test/Transforms/GlobalOpt/calloc-promote.ll
index f2b048ed6bc9a..9983bc66965fd 100644
--- a/llvm/test/Transforms/GlobalOpt/calloc-promote.ll
+++ b/llvm/test/Transforms/GlobalOpt/calloc-promote.ll
@@ -45,5 +45,5 @@ entry:
   ret i32 %res
 }
 
-declare noalias align 16 i8* @calloc(i64, i64)
+declare noalias align 16 i8* @calloc(i64, i64) allockind("alloc,zeroed") allocsize(0,1)
 declare void @f1()

diff  --git a/llvm/test/Transforms/GlobalOpt/malloc-promote-1.ll b/llvm/test/Transforms/GlobalOpt/malloc-promote-1.ll
index 22d250d03f646..b398d07532792 100644
--- a/llvm/test/Transforms/GlobalOpt/malloc-promote-1.ll
+++ b/llvm/test/Transforms/GlobalOpt/malloc-promote-1.ll
@@ -16,7 +16,7 @@ define void @init() {
   ret void
 }
 
-declare noalias i8* @malloc(i64)
+declare noalias i8* @malloc(i64) allockind("alloc,uninitialized") allocsize(0)
 
 define i32 @get() {
 ; CHECK-LABEL: @get(

diff  --git a/llvm/test/Transforms/GlobalOpt/malloc-promote-2.ll b/llvm/test/Transforms/GlobalOpt/malloc-promote-2.ll
index f171224b1f147..d0cc063539d1e 100644
--- a/llvm/test/Transforms/GlobalOpt/malloc-promote-2.ll
+++ b/llvm/test/Transforms/GlobalOpt/malloc-promote-2.ll
@@ -17,7 +17,7 @@ define void @t() {
   ret void
 }
 
-declare noalias i8* @malloc(i64)
+declare noalias i8* @malloc(i64) allockind("alloc,uninitialized") allocsize(0)
 
 define void @foo(i64 %Size) nounwind noinline #0 {
 ; CHECK-LABEL: @foo(

diff  --git a/llvm/test/Transforms/GlobalOpt/malloc-promote-4.ll b/llvm/test/Transforms/GlobalOpt/malloc-promote-4.ll
index 9026f3522acb9..a58d177e9f73a 100644
--- a/llvm/test/Transforms/GlobalOpt/malloc-promote-4.ll
+++ b/llvm/test/Transforms/GlobalOpt/malloc-promote-4.ll
@@ -58,4 +58,4 @@ define dso_local i32 @main() {
   ret i32 %1
 }
 
-declare dso_local noalias i8* @malloc(i64)
+declare dso_local noalias i8* @malloc(i64) allockind("alloc,uninitialized") allocsize(0)

diff  --git a/llvm/test/Transforms/GlobalOpt/malloc-promote-5.ll b/llvm/test/Transforms/GlobalOpt/malloc-promote-5.ll
index 06e0c3adc2a76..f594b465bd6ca 100644
--- a/llvm/test/Transforms/GlobalOpt/malloc-promote-5.ll
+++ b/llvm/test/Transforms/GlobalOpt/malloc-promote-5.ll
@@ -44,5 +44,5 @@ entry:
   ret i32 %res
 }
 
-declare noalias align 16 i8* @malloc(i64)
+declare noalias align 16 i8* @malloc(i64) allockind("alloc,uninitialized") allocsize(0)
 declare void @f1()

diff  --git a/llvm/test/Transforms/GlobalOpt/malloc-promote-opaque-ptr.ll b/llvm/test/Transforms/GlobalOpt/malloc-promote-opaque-ptr.ll
index caedf919e56ee..f174c42c19fab 100644
--- a/llvm/test/Transforms/GlobalOpt/malloc-promote-opaque-ptr.ll
+++ b/llvm/test/Transforms/GlobalOpt/malloc-promote-opaque-ptr.ll
@@ -5,7 +5,7 @@
 @g2 = internal global ptr null
 @g3 = internal global ptr null
 
-declare noalias i8* @malloc(i64)
+declare noalias i8* @malloc(i64) allockind("alloc,uninitialized") allocsize(0)
 
 ;.
 ; CHECK: @[[G1_BODY_0:[a-zA-Z0-9_$"\\.-]+]] = internal unnamed_addr global i64 undef

diff  --git a/llvm/test/Transforms/GlobalOpt/null-check-is-use-pr35760.ll b/llvm/test/Transforms/GlobalOpt/null-check-is-use-pr35760.ll
index 3e158798057d7..9ec9721260b0d 100644
--- a/llvm/test/Transforms/GlobalOpt/null-check-is-use-pr35760.ll
+++ b/llvm/test/Transforms/GlobalOpt/null-check-is-use-pr35760.ll
@@ -42,6 +42,6 @@ define internal void @_ZL13PutsSomethingv() {
   ret void
 }
 
-declare dso_local noalias i8* @malloc(i64)
+declare dso_local noalias i8* @malloc(i64) inaccessiblememonly allockind("alloc,uninitialized") allocsize(0)
 
 declare dso_local i32 @puts(i8* nocapture readonly)

diff  --git a/llvm/test/Transforms/InstCombine/alloc-realloc-free.ll b/llvm/test/Transforms/InstCombine/alloc-realloc-free.ll
index 40c995cd768eb..3a7cae955d879 100644
--- a/llvm/test/Transforms/InstCombine/alloc-realloc-free.ll
+++ b/llvm/test/Transforms/InstCombine/alloc-realloc-free.ll
@@ -17,8 +17,8 @@ declare dso_local void @free(i8* nocapture noundef) local_unnamed_addr #2
 declare void @llvm.dbg.value(metadata, metadata, metadata) #3
 
 attributes #0 = { mustprogress nounwind uwtable willreturn }
-attributes #1 = { inaccessiblememonly mustprogress nofree nounwind willreturn }
-attributes #2 = { inaccessiblemem_or_argmemonly mustprogress nounwind willreturn }
-attributes #3 = { nofree nosync nounwind readnone speculatable willreturn }
+attributes #1 = { inaccessiblememonly mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") "alloc-family"="malloc" }
+attributes #2 = { inaccessiblemem_or_argmemonly mustprogress nounwind willreturn allockind("realloc") "alloc-family"="malloc" }
+attributes #3 = { nofree nosync nounwind readnone speculatable willreturn allockind("free") "alloc-family"="malloc" }
 attributes #4 = { nounwind }
 

diff  --git a/llvm/test/Transforms/InstCombine/badmalloc.ll b/llvm/test/Transforms/InstCombine/badmalloc.ll
index 5eb74613e730c..0c4326741faae 100644
--- a/llvm/test/Transforms/InstCombine/badmalloc.ll
+++ b/llvm/test/Transforms/InstCombine/badmalloc.ll
@@ -3,8 +3,8 @@
 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
 target triple = "x86_64-apple-darwin10.0"
 
-declare noalias i8* @malloc(i64) nounwind
-declare void @free(i8*)
+declare noalias i8* @malloc(i64) nounwind allockind("alloc,uninitialized") "alloc-family"="malloc"
+declare void @free(i8*) allockind("free") "alloc-family"="malloc"
 
 ; PR5130
 define i1 @test1() {

diff  --git a/llvm/test/Transforms/InstCombine/builtin-dynamic-object-size.ll b/llvm/test/Transforms/InstCombine/builtin-dynamic-object-size.ll
index c84bc9bcaa28b..7960ac93c0028 100644
--- a/llvm/test/Transforms/InstCombine/builtin-dynamic-object-size.ll
+++ b/llvm/test/Transforms/InstCombine/builtin-dynamic-object-size.ll
@@ -192,12 +192,12 @@ entry:
 declare void @bury(i32) local_unnamed_addr #2
 
 ; Function Attrs: nounwind allocsize(0)
-declare i8* @malloc(i64)
+declare i8* @malloc(i64) nounwind allocsize(0) allockind("alloc,uninitialized") "alloc-family"="malloc"
 
 declare i8* @get_unknown_buffer()
 
 ; Function Attrs: nounwind
-declare void @free(i8* nocapture)
+declare void @free(i8* nocapture) nounwind allockind("free") "alloc-family"="malloc"
 
 ; Function Attrs: nounwind readnone speculatable
 declare i64 @llvm.objectsize.i64.p0i8(i8*, i1, i1, i1)

diff  --git a/llvm/test/Transforms/InstCombine/compare-unescaped.ll b/llvm/test/Transforms/InstCombine/compare-unescaped.ll
index 9d9c2d2308195..2d459046c0a8e 100644
--- a/llvm/test/Transforms/InstCombine/compare-unescaped.ll
+++ b/llvm/test/Transforms/InstCombine/compare-unescaped.ll
@@ -3,7 +3,7 @@
 
 @gp = global i32* null, align 8
 
-declare noalias i8* @malloc(i64)
+declare noalias i8* @malloc(i64) allockind("alloc,uninitialized") allocsize(0)
 
 define i1 @compare_global_trivialeq() {
 ; CHECK-LABEL: @compare_global_trivialeq(

diff  --git a/llvm/test/Transforms/InstCombine/deref-alloc-fns.ll b/llvm/test/Transforms/InstCombine/deref-alloc-fns.ll
index 41a2427b683d3..a62c4224c5f25 100644
--- a/llvm/test/Transforms/InstCombine/deref-alloc-fns.ll
+++ b/llvm/test/Transforms/InstCombine/deref-alloc-fns.ll
@@ -3,13 +3,13 @@
 ; RUN: opt -mtriple=x86_64-unknown-linux-gnu < %s -passes=instcombine -S | FileCheck %s --check-prefixes=CHECK,GNU
 
 
-declare noalias i8* @malloc(i64)
-declare noalias i8* @calloc(i64, i64)
-declare noalias i8* @realloc(i8* nocapture, i64)
+declare noalias i8* @malloc(i64) allockind("alloc,uninitialized") allocsize(0) "alloc-family"="malloc"
+declare noalias i8* @calloc(i64, i64) allockind("alloc,zeroed") allocsize(0,1) "alloc-family"="malloc"
+declare noalias i8* @realloc(i8* nocapture, i64) allockind("realloc") allocsize(1) "alloc-family"="malloc"
 declare noalias nonnull i8* @_Znam(i64) ; throwing version of 'new'
 declare noalias nonnull i8* @_Znwm(i64) ; throwing version of 'new'
 declare noalias i8* @strdup(i8*)
-declare noalias i8* @aligned_alloc(i64, i64)
+declare noalias i8* @aligned_alloc(i64 allocalign, i64) allockind("alloc,uninitialized,aligned") allocsize(1) "alloc-family"="malloc"
 declare noalias align 16 i8* @memalign(i64, i64)
 ; new[](unsigned int, align_val_t)
 declare noalias i8* @_ZnajSt11align_val_t(i64 %size, i64 %align)

diff  --git a/llvm/test/Transforms/InstCombine/getelementptr.ll b/llvm/test/Transforms/InstCombine/getelementptr.ll
index b0b964c151eb1..b5c9ffafe94cb 100644
--- a/llvm/test/Transforms/InstCombine/getelementptr.ll
+++ b/llvm/test/Transforms/InstCombine/getelementptr.ll
@@ -552,7 +552,7 @@ define i32 @test27(%struct.compat_siginfo* %to, %struct.siginfo_t* %from) {
 ; CHECK-NEXT:    [[T349:%.*]] = getelementptr [[STRUCT_SIGINFO_T:%.*]], %struct.siginfo_t* [[T344]], i64 0, i32 3, i32 0, i32 3, i32 0
 ; CHECK-NEXT:    [[T349350:%.*]] = bitcast i8** [[T349]] to i32*
 ; CHECK-NEXT:    [[T351:%.*]] = load i32, i32* [[T349350]], align 8
-; CHECK-NEXT:    [[T360:%.*]] = call i32 asm sideeffect "...", "=r,ir,*m,i,0,~{dirflag},~{fpsr},~{flags}"(i32 [[T351]], %struct.__large_struct* elementtype([[STRUCT___LARGE_STRUCT:%.*]]) null, i32 -14, i32 0) #[[ATTR0:[0-9]+]]
+; CHECK-NEXT:    [[T360:%.*]] = call i32 asm sideeffect "...", "=r,ir,*m,i,0,~{dirflag},~{fpsr},~{flags}"(i32 [[T351]], %struct.__large_struct* elementtype(%struct.__large_struct) null, i32 -14, i32 0) #[[ATTR0:[0-9]+]]
 ; CHECK-NEXT:    unreachable
 ;
 entry:
@@ -1313,7 +1313,7 @@ define i8* @D98588(i8* %c1, i64 %offset) {
   ret i8* %gep
 }
 
-declare noalias i8* @malloc(i64) nounwind
+declare noalias i8* @malloc(i64) nounwind allockind("alloc,uninitialized") allocsize(0)
 
 define i32 @test_gep_bitcast_malloc(%struct.A* %a) {
 ; CHECK-LABEL: @test_gep_bitcast_malloc(

diff  --git a/llvm/test/Transforms/InstCombine/malloc-free-mismatched.ll b/llvm/test/Transforms/InstCombine/malloc-free-mismatched.ll
index fa6166d822152..117f015629f39 100644
--- a/llvm/test/Transforms/InstCombine/malloc-free-mismatched.ll
+++ b/llvm/test/Transforms/InstCombine/malloc-free-mismatched.ll
@@ -3,7 +3,7 @@
 
 define dso_local i32 @_Z6answeri(i32 %0) {
 ; CHECK-LABEL: @_Z6answeri(
-; CHECK-NEXT:    [[TMP2:%.*]] = call noalias nonnull dereferenceable(80) i8* @_Znam(i64 80) #[[ATTR1:[0-9]+]]
+; CHECK-NEXT:    [[TMP2:%.*]] = call noalias nonnull dereferenceable(80) i8* @_Znam(i64 80) #[[ATTR2:[0-9]+]]
 ; CHECK-NEXT:    call void @free(i8* [[TMP2]])
 ; CHECK-NEXT:    ret i32 42
 ;
@@ -24,7 +24,7 @@ define void @test_alloca() {
 declare dso_local nonnull i8* @_Znam(i64) #1
 
 ; Function Attrs: nounwind
-declare dso_local void @free(i8*)
+declare dso_local void @free(i8*) allockind("free") "alloc-family"="malloc"
 
 attributes #0 = { builtin allocsize(0) }
-attributes #1 = { nobuiltin allocsize(0) }
+attributes #1 = { nobuiltin allocsize(0) allockind("alloc,uninitialized") "alloc-family"="_Znam" }

diff  --git a/llvm/test/Transforms/InstCombine/malloc-free.ll b/llvm/test/Transforms/InstCombine/malloc-free.ll
index 7ae1e8ab9c625..a3f5cb126902e 100644
--- a/llvm/test/Transforms/InstCombine/malloc-free.ll
+++ b/llvm/test/Transforms/InstCombine/malloc-free.ll
@@ -26,10 +26,10 @@ define i32 @dead_aligned_alloc(i32 %size, i32 %alignment, i8 %value) {
   ret i32 0
 }
 
-declare noalias i8* @calloc(i32, i32) nounwind
-declare noalias i8* @malloc(i32)
-declare noalias i8* @aligned_alloc(i32, i32)
-declare void @free(i8*)
+declare noalias i8* @calloc(i32, i32) nounwind allockind("alloc,zeroed") allocsize(0,1) "alloc-family"="malloc"
+declare noalias i8* @malloc(i32) allockind("alloc,uninitialized") allocsize(0) "alloc-family"="malloc"
+declare noalias i8* @aligned_alloc(i32, i32) allockind("alloc,uninitialized,aligned") allocsize(1) "alloc-family"="malloc"
+declare void @free(i8*) allockind("free") "alloc-family"="malloc"
 
 define i1 @foo() {
 ; CHECK-LABEL: @foo(

diff  --git a/llvm/test/Transforms/InstCombine/malloc_free_delete_nvptx.ll b/llvm/test/Transforms/InstCombine/malloc_free_delete_nvptx.ll
index 3a19efbae8a81..aa1e42bdf2762 100644
--- a/llvm/test/Transforms/InstCombine/malloc_free_delete_nvptx.ll
+++ b/llvm/test/Transforms/InstCombine/malloc_free_delete_nvptx.ll
@@ -4,8 +4,8 @@
 target triple = "nvptx64"
 
 declare void @user(i8*)
-declare i8* @malloc(i64)
-declare void @free(i8*)
+declare i8* @malloc(i64) allockind("alloc,uninitialized") "alloc-family"="malloc" allocsize(0)
+declare void @free(i8*) allockind("free") "alloc-family"="malloc"
 
 ; Ensure the nvptx backend states malloc & free are a thing so we can recognize
 ; so we will optimize them properly. In the test below the malloc-free chain is

diff  --git a/llvm/test/Transforms/InstCombine/objsize-64.ll b/llvm/test/Transforms/InstCombine/objsize-64.ll
index 55396ac1b528e..c97268bdaf020 100644
--- a/llvm/test/Transforms/InstCombine/objsize-64.ll
+++ b/llvm/test/Transforms/InstCombine/objsize-64.ll
@@ -2,7 +2,7 @@
 ; RUN: opt < %s -passes=instcombine -S | FileCheck %s
 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
 
-declare noalias i8* @malloc(i64) nounwind
+declare noalias i8* @malloc(i64) nounwind allockind("alloc,uninitialized") allocsize(0)
 declare noalias nonnull i8* @_Znwm(i64)  ; new(unsigned long)
 declare i32 @__gxx_personality_v0(...)
 declare void @__cxa_call_unexpected(i8*)

diff  --git a/llvm/test/Transforms/InstCombine/objsize.ll b/llvm/test/Transforms/InstCombine/objsize.ll
index d6cdc5e1ab294..d000df6cf21f6 100644
--- a/llvm/test/Transforms/InstCombine/objsize.ll
+++ b/llvm/test/Transforms/InstCombine/objsize.ll
@@ -192,7 +192,7 @@ entry:
 
 declare i8* @__memset_chk(i8*, i32, i32, i32) nounwind
 
-declare noalias i8* @malloc(i32) nounwind
+declare noalias i8* @malloc(i32) nounwind allockind("alloc,uninitialized") allocsize(0)
 
 define i32 @test7(i8** %esc) {
 ; CHECK-LABEL: @test7(
@@ -207,7 +207,7 @@ define i32 @test7(i8** %esc) {
   ret i32 %objsize
 }
 
-declare noalias i8* @calloc(i32, i32) nounwind
+declare noalias i8* @calloc(i32, i32) nounwind allockind("alloc,zeroed") allocsize(0,1)
 
 define i32 @test8(i8** %esc) {
 ; CHECK-LABEL: @test8(

diff  --git a/llvm/test/Transforms/InstCombine/realloc-free.ll b/llvm/test/Transforms/InstCombine/realloc-free.ll
index 6109d1be31686..9370e654ce401 100644
--- a/llvm/test/Transforms/InstCombine/realloc-free.ll
+++ b/llvm/test/Transforms/InstCombine/realloc-free.ll
@@ -6,14 +6,15 @@ define dso_local void @_Z3fooPv(i8* nocapture %0) local_unnamed_addr #0 {
 ; CHECK-NEXT:    tail call void @free(i8* [[TMP0:%.*]])
 ; CHECK-NEXT:    ret void
 ;
-  %2 = tail call align 16 dereferenceable_or_null(6) i8* @realloc(i8* %0, i64 6) #2
-  tail call void @free(i8* %2) #2
+  %2 = tail call align 16 dereferenceable_or_null(6) i8* @realloc(i8* %0, i64 6) #3
+  tail call void @free(i8* %2) #3
   ret void
 }
 
 declare dso_local noalias noundef i8* @realloc(i8* nocapture, i64 noundef) local_unnamed_addr #1
-declare dso_local void @free(i8* nocapture noundef) local_unnamed_addr #1
+declare dso_local void @free(i8* nocapture noundef) local_unnamed_addr #2
 
 attributes #0 = { mustprogress nounwind uwtable willreturn }
-attributes #1 = { inaccessiblemem_or_argmemonly mustprogress nounwind willreturn }
-attributes #2 = { nounwind }
+attributes #1 = { inaccessiblemem_or_argmemonly mustprogress nounwind willreturn allockind("realloc") }
+attributes #2 = { inaccessiblemem_or_argmemonly mustprogress nounwind willreturn allockind("free") }
+attributes #3 = { nounwind }

diff  --git a/llvm/test/Transforms/InstCombine/realloc.ll b/llvm/test/Transforms/InstCombine/realloc.ll
index 8b2af1ad2df30..81b54225518f3 100644
--- a/llvm/test/Transforms/InstCombine/realloc.ll
+++ b/llvm/test/Transforms/InstCombine/realloc.ll
@@ -1,8 +1,8 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
 ; RUN: opt < %s -passes=instcombine -S | FileCheck %s
 
-declare i8* @realloc(i8*, i64) #1
-declare noalias i8* @malloc(i64) #1
+declare i8* @realloc(i8* allocptr, i64) allockind("realloc") allocsize(1)
+declare noalias i8* @malloc(i64) allockind("alloc,uninitialized")
 
 
 define i8* @realloc_null_ptr() #0 {

diff  --git a/llvm/test/Transforms/LowerConstantIntrinsics/builtin-object-size-phi.ll b/llvm/test/Transforms/LowerConstantIntrinsics/builtin-object-size-phi.ll
index a31a1970ee2c5..31a4a6156fe02 100644
--- a/llvm/test/Transforms/LowerConstantIntrinsics/builtin-object-size-phi.ll
+++ b/llvm/test/Transforms/LowerConstantIntrinsics/builtin-object-size-phi.ll
@@ -5,7 +5,7 @@
 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
-declare dso_local noalias noundef i8* @malloc(i64 noundef) local_unnamed_addr
+declare dso_local noalias noundef i8* @malloc(i64 noundef) local_unnamed_addr allocsize(0)
 declare i64 @llvm.objectsize.i64.p0i8(i8*, i1 immarg, i1 immarg, i1 immarg)
 
 @buffer = dso_local global [4 x i8] zeroinitializer, align 1

diff  --git a/llvm/test/Transforms/LowerConstantIntrinsics/objectsize_basic.ll b/llvm/test/Transforms/LowerConstantIntrinsics/objectsize_basic.ll
index a1f0c84aab40a..7b78b0217b298 100644
--- a/llvm/test/Transforms/LowerConstantIntrinsics/objectsize_basic.ll
+++ b/llvm/test/Transforms/LowerConstantIntrinsics/objectsize_basic.ll
@@ -139,7 +139,7 @@ define i64 @vla_pointer_size_mismatch(i42 %x) {
   ret i64 %objsize
 }
 
-declare i8* @malloc(i64)
+declare i8* @malloc(i64) allocsize(0)
 
 define i64 @test_objectsize_malloc() {
 ; CHECK-LABEL: @test_objectsize_malloc(

diff  --git a/llvm/test/Transforms/MemCpyOpt/memcpy.ll b/llvm/test/Transforms/MemCpyOpt/memcpy.ll
index 4881f110ab03f..9b97e36078e1f 100644
--- a/llvm/test/Transforms/MemCpyOpt/memcpy.ll
+++ b/llvm/test/Transforms/MemCpyOpt/memcpy.ll
@@ -328,7 +328,7 @@ define void @test8() {
   ret void
 }
 
-declare noalias i8* @malloc(i32) willreturn
+declare noalias i8* @malloc(i32) willreturn allockind("alloc,uninitialized") allocsize(0)
 
 ; rdar://11341081
 %struct.big = type { [50 x i32] }


        


More information about the llvm-commits mailing list