llvm-6502/lib/Transforms/IPO
Victor Hernandez 24f934d055 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
2009-11-05 00:03:03 +00:00
..
ArgumentPromotion.cpp Remove includes of Support/Compiler.h that are no longer needed after the 2009-10-25 06:57:41 +00:00
CMakeLists.txt Auto-upgrade free instructions to calls to the builtin free function. 2009-10-24 04:23:03 +00:00
ConstantMerge.cpp Remove includes of Support/Compiler.h that are no longer needed after the 2009-10-25 06:57:41 +00:00
DeadArgumentElimination.cpp Remove includes of Support/Compiler.h that are no longer needed after the 2009-10-25 06:57:41 +00:00
DeadTypeElimination.cpp Remove includes of Support/Compiler.h that are no longer needed after the 2009-10-25 06:57:41 +00:00
ExtractGV.cpp Remove includes of Support/Compiler.h that are no longer needed after the 2009-10-25 06:57:41 +00:00
FunctionAttrs.cpp Rename MallocFreeHelper as MemoryBuiltins 2009-10-27 20:05:49 +00:00
GlobalDCE.cpp cleanups, switch GlobalDCE to SmallPtrSet instead of std::set 2009-11-01 19:03:42 +00:00
GlobalOpt.cpp Update CreateMalloc so that its callers specify the size to allocate: 2009-11-05 00:03:03 +00:00
InlineAlways.cpp Remove includes of Support/Compiler.h that are no longer needed after the 2009-10-25 06:57:41 +00:00
Inliner.cpp Move the InlineCost code from Transforms/Utils to Analysis. 2009-10-13 18:30:07 +00:00
InlineSimple.cpp Remove includes of Support/Compiler.h that are no longer needed after the 2009-10-25 06:57:41 +00:00
Internalize.cpp Remove includes of Support/Compiler.h that are no longer needed after the 2009-10-25 06:57:41 +00:00
IPConstantPropagation.cpp teach ipsccp and ipconstprop that a blockaddress doesn't 'take the address' of a function 2009-11-01 06:11:53 +00:00
IPO.cpp Reverting 85714, 85715, 85716, which are breaking the build 2009-11-01 16:42:53 +00:00
LoopExtractor.cpp Remove includes of Support/Compiler.h that are no longer needed after the 2009-10-25 06:57:41 +00:00
LowerSetJmp.cpp Eliminate some temporaries. 2009-11-03 12:52:50 +00:00
Makefile
MergeFunctions.cpp Remove includes of Support/Compiler.h that are no longer needed after the 2009-10-25 06:57:41 +00:00
PartialInlining.cpp Remove includes of Support/Compiler.h that are no longer needed after the 2009-10-25 06:57:41 +00:00
PartialSpecialization.cpp Remove includes of Support/Compiler.h that are no longer needed after the 2009-10-25 06:57:41 +00:00
PruneEH.cpp Remove includes of Support/Compiler.h that are no longer needed after the 2009-10-25 06:57:41 +00:00
StripDeadPrototypes.cpp Remove includes of Support/Compiler.h that are no longer needed after the 2009-10-25 06:57:41 +00:00
StripSymbols.cpp llvm.dbg.global_variables do not exist anymore. 2009-10-28 16:51:52 +00:00
StructRetPromotion.cpp Remove includes of Support/Compiler.h that are no longer needed after the 2009-10-25 06:57:41 +00:00