forked from OSchip/llvm-project
b738ffa845
This patch aims to implement the option of allocating new arrays created by polly on heap instead of stack. To enable this option, a key named 'allocation' must be written in the imported json file with the value 'heap'. We need such a feature because in a next iteration, we will implement a mechanism of maximal static expansion which will need a way to allocate arrays on heap. Indeed, the expansion is very costly in terms of memory and doing the allocation on stack is not worth considering. The malloc and the free are added respectively at polly.start and polly.exiting such that there is no use-after-free (for instance in case of Scop in a loop) and such that all memory cells allocated with a malloc are free'd when we don't need them anymore. We also add : - In the class ScopArrayInfo, we add a boolean as member called IsOnHeap which represents the fact that the array in allocated on heap or not. - A new branch in the method allocateNewArrays in the ISLNodeBuilder for the case of heap allocation. allocateNewArrays now takes a BBPair containing polly.start and polly.exiting. allocateNewArrays takes this two blocks and add the malloc and free calls respectively to polly.start and polly.exiting. - As IntPtrTy for the malloc call, we use the DataLayout one. To do that, we have modified : - createScopArrayInfo and getOrCreateScopArrayInfo such that it returns a non-const SAI, in order to be able to call setIsOnHeap in the JSONImporter. - executeScopConditionnaly such that it return both start block and end block of the scop, because we need this two blocs to be able to add the malloc and the free calls at the right position. Differential Revision: https://reviews.llvm.org/D33688 llvm-svn: 306540 |
||
---|---|---|
.. | ||
CodeGen | ||
DeLICM | ||
DeadCodeElimination | ||
DependenceInfo | ||
FlattenSchedule | ||
GPGPU | ||
Isl | ||
JSONExporter | ||
PruneUnprofitable | ||
ScheduleOptimizer | ||
ScopDetect | ||
ScopDetectionDiagnostics | ||
ScopInfo | ||
Simplify | ||
Unit | ||
UnitIsl | ||
CMakeLists.txt | ||
README | ||
create_ll.sh | ||
lit.cfg | ||
lit.site.cfg.in | ||
polly.ll | ||
update_check.py |
README
place tests here