teach DSE and isInstructionTriviallyDead() about calloc

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156553 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nuno Lopes
2012-05-10 17:14:00 +00:00
parent 9777f61bfe
commit e54874471c
3 changed files with 26 additions and 5 deletions

View File

@@ -260,7 +260,7 @@ bool llvm::isInstructionTriviallyDead(Instruction *I) {
return isa<UndefValue>(II->getArgOperand(1));
}
if (extractMallocCall(I)) return true;
if (extractMallocCall(I) || extractCallocCall(I)) return true;
if (CallInst *CI = isFreeCall(I))
if (Constant *C = dyn_cast<Constant>(CI->getArgOperand(0)))