From e2cfd3ce954a5a5827249ac64eed0acc8aabfd75 Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Fri, 11 May 2012 18:25:29 +0000 Subject: objectsize: add a few more tests and fix a bug llvm-svn: 156625 --- 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 ea3f95ed230..c9b45d0df11 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp @@ -208,7 +208,7 @@ static int computeAllocSize(Value *Alloc, uint64_t &Size, Value* &SizeValue, Size = CI->getZExtValue(); return 1; } - return 0; + return Penalty >= 2 ? 0 : 2; } else if (CallInst *MI = extractCallocCall(Alloc)) { Value *Arg1 = MI->getArgOperand(0); -- cgit v1.2.3