diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2011-08-02 22:08:01 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2011-08-02 22:08:01 +0000 |
commit | e8ae02dfb912b1450038edcd6719a948001f148f (patch) | |
tree | 504e16a76dead7b46b6143b7cfd2adbf9536c9d5 /llvm/test/Transforms/InstCombine/malloc-free-delete.ll | |
parent | d2a7d1ed97f79a1de8ee2f9c2ca11e29d352e23a (diff) | |
download | bcm5719-llvm-e8ae02dfb912b1450038edcd6719a948001f148f.tar.gz bcm5719-llvm-e8ae02dfb912b1450038edcd6719a948001f148f.zip |
Teach InstCombine that lifetime intrincs aren't a real user on the result of a
malloc call.
llvm-svn: 136732
Diffstat (limited to 'llvm/test/Transforms/InstCombine/malloc-free-delete.ll')
-rw-r--r-- | llvm/test/Transforms/InstCombine/malloc-free-delete.ll | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/llvm/test/Transforms/InstCombine/malloc-free-delete.ll b/llvm/test/Transforms/InstCombine/malloc-free-delete.ll index 8455300c98c..a35e7b646a4 100644 --- a/llvm/test/Transforms/InstCombine/malloc-free-delete.ll +++ b/llvm/test/Transforms/InstCombine/malloc-free-delete.ll @@ -12,7 +12,7 @@ define i32 @main(i32 %argc, i8** %argv) { ; CHECK: ret i32 0 } -declare i8* @malloc(i32) +declare noalias i8* @malloc(i32) declare void @free(i8*) define i1 @foo() { @@ -23,3 +23,15 @@ define i1 @foo() { call void @free(i8* %m) ret i1 %z } + +declare void @llvm.lifetime.start(i64, i8*) +declare void @llvm.lifetime.end(i64, i8*) + +define void @test3() { +; CHECK: @test3 +; CHECK-NEXT: ret void + %a = call noalias i8* @malloc(i32 10) + call void @llvm.lifetime.start(i64 10, i8* %a) + call void @llvm.lifetime.end(i64 10, i8* %a) + ret void +} |