diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2015-03-09 02:57:32 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2015-03-09 02:57:32 +0000 |
commit | 75eda5e913d9fb9539ba79dba625bc98fe91ad31 (patch) | |
tree | 3fd7f96c2e09be114be71752e0d8c8250c8e8807 /llvm/lib/Analysis/MemoryBuiltins.cpp | |
parent | d64657f2989f0e1e279f1ad8a03f627b4b60f407 (diff) | |
download | llvm-75eda5e913d9fb9539ba79dba625bc98fe91ad31.zip llvm-75eda5e913d9fb9539ba79dba625bc98fe91ad31.tar.gz llvm-75eda5e913d9fb9539ba79dba625bc98fe91ad31.tar.bz2 |
DCE: isArrayMalloc() is not used neither in LLVM nor Clang
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 231624
Diffstat (limited to 'llvm/lib/Analysis/MemoryBuiltins.cpp')
-rw-r--r-- | llvm/lib/Analysis/MemoryBuiltins.cpp | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/llvm/lib/Analysis/MemoryBuiltins.cpp b/llvm/lib/Analysis/MemoryBuiltins.cpp index 6108af3..a0c8908 100644 --- a/llvm/lib/Analysis/MemoryBuiltins.cpp +++ b/llvm/lib/Analysis/MemoryBuiltins.cpp @@ -232,23 +232,6 @@ static Value *computeArraySize(const CallInst *CI, const DataLayout *DL, return nullptr; } -/// isArrayMalloc - Returns the corresponding CallInst if the instruction -/// is a call to malloc whose array size can be determined and the array size -/// is not constant 1. Otherwise, return NULL. -const CallInst *llvm::isArrayMalloc(const Value *I, - const DataLayout *DL, - const TargetLibraryInfo *TLI) { - const CallInst *CI = extractMallocCall(I, TLI); - Value *ArraySize = computeArraySize(CI, DL, TLI); - - if (ConstantInt *ConstSize = dyn_cast_or_null<ConstantInt>(ArraySize)) - if (ConstSize->isOne()) - return CI; - - // CI is a non-array malloc or we can't figure out that it is an array malloc. - return nullptr; -} - /// getMallocType - Returns the PointerType resulting from the malloc call. /// The PointerType depends on the number of bitcast uses of the malloc call: /// 0: PointerType is the calls' return type. |