diff options
| author | Nuno Lopes <nunoplopes@sapo.pt> | 2012-06-21 15:45:28 +0000 |
|---|---|---|
| committer | Nuno Lopes <nunoplopes@sapo.pt> | 2012-06-21 15:45:28 +0000 |
| commit | 55fff8342230ab80179ace8a782328f888b9b5bb (patch) | |
| tree | 94e8d767cb897ead337204996e483bb414e78b85 /llvm/lib/Transforms/Utils/Local.cpp | |
| parent | 4e9012c2b1fd023edc28dc680844c9119adb4e0f (diff) | |
| download | llvm-55fff8342230ab80179ace8a782328f888b9b5bb.zip llvm-55fff8342230ab80179ace8a782328f888b9b5bb.tar.gz llvm-55fff8342230ab80179ace8a782328f888b9b5bb.tar.bz2 | |
refactor the MemoryBuiltin analysis:
- provide more extensive set of functions to detect library allocation functions (e.g., malloc, calloc, strdup, etc)
- provide an API to compute the size and offset of an object pointed by
Move a few clients (GVN, AA, instcombine, ...) to the new API.
This implementation is a lot more aggressive than each of the custom implementations being replaced.
Patch reviewed by Nick Lewycky and Chandler Carruth, thanks.
llvm-svn: 158919
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Utils/Local.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index b08f8e2..8e59274 100644 --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/lib/Transforms/Utils/Local.cpp @@ -266,7 +266,7 @@ bool llvm::isInstructionTriviallyDead(Instruction *I) { return isa<UndefValue>(II->getArgOperand(1)); } - if (extractMallocCall(I) || extractCallocCall(I)) return true; + if (isAllocLikeFn(I)) return true; if (CallInst *CI = isFreeCall(I)) if (Constant *C = dyn_cast<Constant>(CI->getArgOperand(0))) |
