summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/MemoryBuiltins.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Simplify ComputeMultiple so that it doesn't depend on TargetData.Dan Gohman2009-11-181-2/+1
| | | | llvm-svn: 89175
* Update computeArraySize() to use ComputeMultiple() to determine the array ↵Victor Hernandez2009-11-101-90/+19
| | | | | | size associated with a malloc; also extend PerformHeapAllocSRoA() to check if the optimized malloc's arg had its highest bit set, so that it is safe for ComputeMultiple() to look through sext instructions while determining the optimized malloc's array size llvm-svn: 86676
* Re-commit r86077 now that r86290 fixes the 179.art and 175.vpr ARM regressions.Victor Hernandez2009-11-071-35/+41
| | | | | | | | | | | | | | | | | | | | | | | Here is the original commit message: This commit updates malloc optimizations to operate on malloc calls that have constant int size arguments. Update CreateMalloc so that its callers specify the size to allocate: MallocInst-autoupgrade users use non-TargetData-computed allocation sizes. Optimization uses use TargetData to compute the allocation size. Now that malloc calls can have constant sizes, update isArrayMallocHelper() to use TargetData to determine the size of the malloced type and the size of malloced arrays. Extend getMallocType() to support malloc calls that have non-bitcast uses. Update OptimizeGlobalAddressOfMalloc() to optimize malloc calls that have non-bitcast uses. The bitcast use of a malloc call has to be treated specially here because the uses of the bitcast need to be replaced and the bitcast needs to be erased (just like the malloc call) for OptimizeGlobalAddressOfMalloc() to work correctly. Update PerformHeapAllocSRoA() to optimize malloc calls that have non-bitcast uses. The bitcast use of the malloc is not handled specially here because ReplaceUsesOfMallocWithGlobal replaces through the bitcast use. Update OptimizeOnceStoredGlobal() to not care about the malloc calls' bitcast use. Update all globalopt malloc tests to not rely on autoupgraded-MallocInsts, but instead use explicit malloc calls with correct allocation sizes. llvm-svn: 86311
* remove a bunch of extraneous LLVMContext argumentsChris Lattner2009-11-061-13/+9
| | | | | | from various APIs, addressing PR5325. llvm-svn: 86231
* Revert r86077 because it caused crashes in 179.art and 175.vpr on ARMVictor Hernandez2009-11-061-41/+35
| | | | llvm-svn: 86213
* Update CreateMalloc so that its callers specify the size to allocate:Victor Hernandez2009-11-051-35/+41
| | | | | | | | | | | | | | | | | | MallocInst-autoupgrade users use non-TargetData-computed allocation sizes. Optimization uses use TargetData to compute the allocation size. Now that malloc calls can have constant sizes, update isArrayMallocHelper() to use TargetData to determine the size of the malloced type and the size of malloced arrays. Extend getMallocType() to support malloc calls that have non-bitcast uses. Update OptimizeGlobalAddressOfMalloc() to optimize malloc calls that have non-bitcast uses. The bitcast use of a malloc call has to be treated specially here because the uses of the bitcast need to be replaced and the bitcast needs to be erased (just like the malloc call) for OptimizeGlobalAddressOfMalloc() to work correctly. Update PerformHeapAllocSRoA() to optimize malloc calls that have non-bitcast uses. The bitcast use of the malloc is not handled specially here because ReplaceUsesOfMallocWithGlobal replaces through the bitcast use. Update OptimizeOnceStoredGlobal() to not care about the malloc calls' bitcast use. Update all globalopt malloc tests to not rely on autoupgraded-MallocInsts, but instead use explicit malloc calls with correct allocation sizes. llvm-svn: 86077
* Changes requested (avoid getFunction(), avoid Type creation via isVoidTy(), ↵Victor Hernandez2009-11-031-13/+8
| | | | | | and avoid redundant isFreeCall cases) in feedback to r85176 llvm-svn: 85936
* Changes (* location in pointer variables, avoiding include, and using ↵Victor Hernandez2009-11-031-39/+34
| | | | | | APInt::getLimitedValue) based on feedback to r85814 llvm-svn: 85933
* Set bit instead of calling pow() to compute 2 << nVictor Hernandez2009-11-021-5/+13
| | | | llvm-svn: 85814
* Fix for warning seen on DF-BSD, Victor, please fix this to use a shift ↵Edward O'Callaghan2009-11-021-1/+1
| | | | | | instead of pow() llvm-svn: 85781
* fix 80-col.Zhongxing Xu2009-10-291-1/+1
| | | | llvm-svn: 85480
* Explicitly convert to double to suppress Visual C++ 2008 build error C2668 ↵Zhongxing Xu2009-10-291-1/+1
| | | | | | pow is ambiguous call to overloaded function llvm-svn: 85478
* Extend getMallocArraySize() to determine the array size if the malloc ↵Victor Hernandez2009-10-281-112/+96
| | | | | | | | | | | | | | argument is: ArraySize * ElementSize ElementSize * ArraySize ArraySize << log2(ElementSize) ElementSize << log2(ArraySize) Refactor isArrayMallocHelper and delete isSafeToGetMallocArraySize, so that there is only 1 copy of the malloc array determining logic. Update users of getMallocArraySize() to not bother calling isArrayMalloc() as well. llvm-svn: 85421
* Rename MallocFreeHelper as MemoryBuiltinsVictor Hernandez2009-10-271-0/+295
llvm-svn: 85286
OpenPOWER on IntegriCloud