History log of /external/llvm/lib/Analysis/MemoryBuiltins.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
1db1c239fe1654f174fbddd70e104909d2ad5f5c 23-Nov-2011 Benjamin Kramer <benny.kra@googlemail.com> Validate the return type when checking if a function is malloc.

Fixes PR11426. Not sure if a test case with a "wrong" malloc would be useful.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145106 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Analysis/MemoryBuiltins.cpp
db125cfaf57cc83e7dd7453de2d509bc8efd0e5e 18-Jul-2011 Chris Lattner <sabre@nondot.org> land David Blaikie's patch to de-constify Type, with a few tweaks.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135375 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Analysis/MemoryBuiltins.cpp
ebb2189904564c7c6193e7f23904f1ced7975480 18-Jun-2011 Chris Lattner <sabre@nondot.org> simplify some code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133362 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Analysis/MemoryBuiltins.cpp
1ace169c3d2ffd6596e0533c37df206430e8b707 17-Mar-2011 Nick Lewycky <nicholas@mxc.ca> Add comments for the demanglings. Correct mangled form of operator delete!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127801 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Analysis/MemoryBuiltins.cpp
42e72ca3d00dbe073fbb39e181caa7f0c4c171b7 15-Mar-2011 Nick Lewycky <nicholas@mxc.ca> Add C++ global operator {new,new[],delete,delete[]}(unsigned {int,long}) to the
memory builtins as equivalent to malloc/free.

This is different from any attribute we have. For example, you can delete the
allocators when their result is unused, but you can't collapse two calls to the
same function, even if no global/memory state has changed in between. The
noalias return states that the result does not alias any other pointer, but
instcombine optimizes malloc() as though the result is non-null for the purpose
of eliminating unused pointers.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127673 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Analysis/MemoryBuiltins.cpp
02680f946b8dcbeff3b8d7236030678551b15a6c 23-Jun-2010 Gabor Greif <ggreif@gmail.com> minor enhancement to llvm::isFreeCall API: return CallInst; no functional change

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106686 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Analysis/MemoryBuiltins.cpp
e3401c4fae95bc69dada2a3f9080d9f15349af61 23-Jun-2010 Gabor Greif <ggreif@gmail.com> use ArgOperand getters


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106685 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Analysis/MemoryBuiltins.cpp
551754c4958086cc6910da7c950f2875e212f5cf 17-Apr-2010 Eric Christopher <echristo@apple.com> Revert 101465, it broke internal OpenGL testing.

Probably the best way to know that all getOperand() calls have been handled
is to replace that API instead of updating.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101579 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Analysis/MemoryBuiltins.cpp
4ec2258ffb495d7ce00177e447740ef1123a27db 16-Apr-2010 Gabor Greif <ggreif@gmail.com> reapply r101434
with a fix for self-hosting

rotate CallInst operands, i.e. move callee to the back
of the operand array

the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101465 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Analysis/MemoryBuiltins.cpp
607a7ab3da72a2eb53553a520507cbb8068dd1d8 16-Apr-2010 Gabor Greif <ggreif@gmail.com> back out r101423 and r101397, they break llvm-gcc self-host on darwin10

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101434 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Analysis/MemoryBuiltins.cpp
2ff961f66816daab8bbc58a19025161d969821c2 15-Apr-2010 Gabor Greif <ggreif@gmail.com> reapply r101364, which has been backed out in r101368
with a fix

rotate CallInst operands, i.e. move callee to the back
of the operand array

the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101397 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Analysis/MemoryBuiltins.cpp
9ee17208115482441953127615231c59a2f4d052 15-Apr-2010 Gabor Greif <ggreif@gmail.com> back out r101364, as it trips the linux nightlybot on some clang C++ tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101368 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Analysis/MemoryBuiltins.cpp
165dac08d1bb8428b32a5f39cdd3dbee2888987f 15-Apr-2010 Gabor Greif <ggreif@gmail.com> rotate CallInst operands, i.e. move callee to the back
of the operand array

the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101364 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Analysis/MemoryBuiltins.cpp
60ad781c61815ca5b8dc2a45a102e1c8af65992f 26-Mar-2010 Gabor Greif <ggreif@gmail.com> rename use_const_iterator to const_use_iterator for consistency's sake

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99564 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Analysis/MemoryBuiltins.cpp
f451cb870efcf9e0302d25ed05f4cac6bb494e42 10-Feb-2010 Dan Gohman <gohman@apple.com> Fix "the the" and similar typos.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95781 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Analysis/MemoryBuiltins.cpp
3dbb9e64d6e9d1e8bf16f75ebe4fe59ffdf93dd3 18-Nov-2009 Dan Gohman <gohman@apple.com> Simplify ComputeMultiple so that it doesn't depend on TargetData.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89175 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Analysis/MemoryBuiltins.cpp
8e345a1c418608c49abb7c51a090bbb36f1273bc 10-Nov-2009 Victor Hernandez <vhernandez@apple.com> Update computeArraySize() to use ComputeMultiple() to determine the array 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86676 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Analysis/MemoryBuiltins.cpp
9d0b704e3ea418441001dac4d1a56c2c224cdbf5 07-Nov-2009 Victor Hernandez <vhernandez@apple.com> Re-commit r86077 now that r86290 fixes the 179.art and 175.vpr ARM regressions.

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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86311 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Analysis/MemoryBuiltins.cpp
7b550ccfc5a3346c17e0390a59e2d6d19bc52705 06-Nov-2009 Chris Lattner <sabre@nondot.org> remove a bunch of extraneous LLVMContext arguments
from various APIs, addressing PR5325.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86231 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Analysis/MemoryBuiltins.cpp
df98761d08ae091420b7e9c1366de7684400fc36 06-Nov-2009 Victor Hernandez <vhernandez@apple.com> Revert r86077 because it caused crashes in 179.art and 175.vpr on ARM

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86213 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Analysis/MemoryBuiltins.cpp
24f934d0551e33508c4ffd24318ea0e970db9810 05-Nov-2009 Victor Hernandez <vhernandez@apple.com> 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86077 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Analysis/MemoryBuiltins.cpp
3ad70d5d61f3f86fb5bc167e157680fc107a1173 03-Nov-2009 Victor Hernandez <vhernandez@apple.com> Changes requested (avoid getFunction(), avoid Type creation via isVoidTy(), and avoid redundant isFreeCall cases) in feedback to r85176

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85936 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Analysis/MemoryBuiltins.cpp
88efeaee227a069b3ec3d1b69c918ef31da78a23 03-Nov-2009 Victor Hernandez <vhernandez@apple.com> Changes (* location in pointer variables, avoiding include, and using APInt::getLimitedValue) based on feedback to r85814

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85933 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Analysis/MemoryBuiltins.cpp
bc117b83f6f646c55a98a5b408e0b1dfcacc275e 02-Nov-2009 Victor Hernandez <vhernandez@apple.com> Set bit instead of calling pow() to compute 2 << n

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85814 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Analysis/MemoryBuiltins.cpp
438b00b2adf348cdb933d8764335cebd56046abc 02-Nov-2009 Edward O'Callaghan <eocallaghan@auroraux.org> Fix for warning seen on DF-BSD, Victor, please fix this to use a shift instead of pow()

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85781 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Analysis/MemoryBuiltins.cpp
06ff7505e1ca4bbecc8d95a16160d12972767bc3 29-Oct-2009 Zhongxing Xu <xuzhongxing@gmail.com> fix 80-col.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85480 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Analysis/MemoryBuiltins.cpp
8370057f0cbdcd1dc8e8a082eedd150eb993c52e 29-Oct-2009 Zhongxing Xu <xuzhongxing@gmail.com> Explicitly convert to double to suppress Visual C++ 2008 build error C2668 pow is ambiguous call to overloaded function

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85478 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Analysis/MemoryBuiltins.cpp
90f48e7c91a8faa875ba889ca66b137ffd46e34a 28-Oct-2009 Victor Hernandez <vhernandez@apple.com> Extend getMallocArraySize() to determine the array size if the malloc 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85421 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Analysis/MemoryBuiltins.cpp
f006b183e2d2bebcf6968d1dd7350397c95b0325 27-Oct-2009 Victor Hernandez <vhernandez@apple.com> Rename MallocFreeHelper as MemoryBuiltins

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85286 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Analysis/MemoryBuiltins.cpp