From d4cf35d77576c8de1e958937aed5445a81f6989b Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Thu, 3 May 2012 22:08:19 +0000 Subject: remove calls to calloc if the allocated memory is not used (it was already being done for malloc) fix a few typos found by Chad in my previous commit llvm-svn: 156110 --- llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Transforms') diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp index 4196ca6cf79..5fdb57bc7aa 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp @@ -172,7 +172,7 @@ Instruction *InstCombiner::SimplifyMemSet(MemSetInst *MI) { Instruction *InstCombiner::visitCallInst(CallInst &CI) { if (isFreeCall(&CI)) return visitFree(CI); - if (isMalloc(&CI)) + if (extractMallocCall(&CI) || extractCallocCall(&CI)) return visitMalloc(CI); // If the caller function is nounwind, mark the call as nounwind, even if the -- cgit v1.2.3