From 1d9b973fd7e60e4149678a03aac762551c846f13 Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Thu, 27 May 2010 19:09:06 +0000 Subject: 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 --- test/Transforms/InstCombine/badmalloc.ll | 1 + 1 file changed, 1 insertion(+) (limited to 'test/Transforms/InstCombine/badmalloc.ll') 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 -- cgit v1.2.3