diff options
author | Duncan Sands <baldrick@free.fr> | 2010-05-27 19:09:06 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2010-05-27 19:09:06 +0000 |
commit | 1d9b973fd7e60e4149678a03aac762551c846f13 (patch) | |
tree | e002a3d6cf5b6a3049d504b189c0052caa5049e6 /test/Transforms/InstCombine/badmalloc.ll | |
parent | 084fb0ea3246300aa81dd2561ce4d84401b74792 (diff) | |
download | llvm-1d9b973fd7e60e4149678a03aac762551c846f13.tar.gz llvm-1d9b973fd7e60e4149678a03aac762551c846f13.tar.bz2 llvm-1d9b973fd7e60e4149678a03aac762551c846f13.tar.xz |
Teach instCombine to remove malloc+free if malloc's only uses are comparisons
to null. Patch by Matti Niemenmaa.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104871 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/badmalloc.ll')
-rw-r--r-- | test/Transforms/InstCombine/badmalloc.ll | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/badmalloc.ll b/test/Transforms/InstCombine/badmalloc.ll index cab23b5af5..f5a623dc77 100644 --- a/test/Transforms/InstCombine/badmalloc.ll +++ b/test/Transforms/InstCombine/badmalloc.ll @@ -10,6 +10,7 @@ declare void @free(i8*) define i1 @test1() { %A = call noalias i8* @malloc(i64 4) nounwind %B = icmp eq i8* %A, null + store i8 0, i8* %A call void @free(i8* %A) ret i1 %B |