summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/MallocHelper.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Rename MallocHelper as MallocFreeHelper, since it now also identifies calls ↵Victor Hernandez2009-10-261-296/+0
| | | | | | to free() llvm-svn: 85181
* Remove FreeInst.Victor Hernandez2009-10-261-2/+7
| | | | | | | Remove LowerAllocations pass. Update some more passes to treate free calls just like they were treating FreeInst. llvm-svn: 85176
* Auto-upgrade free instructions to calls to the builtin free function.Victor Hernandez2009-10-241-0/+26
| | | | | | | Update all analysis passes and transforms to treat free calls just like FreeInst. Remove RaiseAllocations and all its tests since FreeInst no longer needs to be raised. llvm-svn: 84987
* Invert isSafeToGetMallocArraySize check because we return NULL when we don't ↵Victor Hernandez2009-10-161-1/+1
| | | | | | | | know the size. Thanks to Duncan Sands for noticing this bug. llvm-svn: 84261
* Fix bug where array malloc with unexpected computation of the size argument ↵Victor Hernandez2009-10-151-9/+44
| | | | | | | | | | | | | | | | | | | | resulted in MallocHelper identifying the malloc as a non-array malloc. This broke GlobalOpt's optimization of stores of mallocs to global variables. The fix is to classify malloc's into 3 categories: 1. non-array mallocs 2. array mallocs whose array size can be determined 3. mallocs that cannot be determined to be of type 1 or 2 and cannot be optimized getMallocArraySize() returns NULL for category 3, and all users of this function must avoid their malloc optimization if this function returns NULL. Eventually, currently unexpected codegen for computing the malloc's size argument will be supported in isArrayMalloc() and getMallocArraySize(), extending malloc optimizations to those examples. llvm-svn: 84199
* Add PR to this FIXME, looks like I didn't commit this change after all.Torok Edwin2009-10-071-1/+2
| | | | llvm-svn: 83457
* Don't treat malloc calls with non-matching prototype as malloc.Torok Edwin2009-10-051-2/+13
| | | | | | | Fixes second part of PR5130, miscompilation in FreeBSD kernel, where malloc takes 3 params, and *does* initialize memory. llvm-svn: 83324
* No need to verify that malloc's return type is i8*.Victor Hernandez2009-09-221-1/+1
| | | | llvm-svn: 82561
* Update malloc call creation code (AllocType is now the element type of the ↵Victor Hernandez2009-09-181-41/+55
| | | | | | | | | | | | | | | | | | malloc, not the resulting type). In getMallocArraySize(), fix bug in the case that array size is the product of 2 constants. Extend isArrayMalloc() and getMallocArraySize() to handle case where malloc is used as char array. Ensure that ArraySize in LowerAllocations::runOnBasicBlock() is correct type. Extend Instruction::isSafeToSpeculativelyExecute() to handle malloc calls. Add verification for malloc calls. Reviewed by Dan Gohman. llvm-svn: 82257
* Fit code within 80 columnsVictor Hernandez2009-09-101-2/+4
| | | | llvm-svn: 81459
* Add some braces to make newer GCCs happy and update CMakeLists.Benjamin Kramer2009-09-101-1/+1
| | | | llvm-svn: 81443
* Add malloc call utility functions. Patch by Victor Hernandez.Evan Cheng2009-09-101-0/+202
llvm-svn: 81426
OpenPOWER on IntegriCloud