Teach instCombine to remove malloc+free if malloc's only uses are comparisons
authorDuncan Sands <baldrick@free.fr>
Thu, 27 May 2010 19:09:06 +0000 (19:09 +0000)
committerDuncan Sands <baldrick@free.fr>
Thu, 27 May 2010 19:09:06 +0000 (19:09 +0000)
commit1d9b973fd7e60e4149678a03aac762551c846f13
treee002a3d6cf5b6a3049d504b189c0052caa5049e6
parent084fb0ea3246300aa81dd2561ce4d84401b74792
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
lib/Transforms/InstCombine/InstCombine.h
lib/Transforms/InstCombine/InstCombineCalls.cpp
lib/Transforms/InstCombine/InstCombineCompares.cpp
lib/Transforms/InstCombine/InstructionCombining.cpp
test/Transforms/InstCombine/badmalloc.ll
test/Transforms/InstCombine/malloc-free-delete.ll