aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp
diff options
context:
space:
mode:
authorMichael Kruse <llvm@meinersbur.de>2017-06-28 13:02:43 +0000
committerMichael Kruse <llvm@meinersbur.de>2017-06-28 13:02:43 +0000
commitb738ffa845493d8af0d08acaa7c8b2b91dd295b2 (patch)
tree7c85429afaab29206e92f701599eaac3d08f3fb5 /clang/lib/Frontend/CreateInvocationFromCommandLine.cpp
parent72d25399379c7195d8a3d2f9f497ac68252483e9 (diff)
downloadllvm-b738ffa845493d8af0d08acaa7c8b2b91dd295b2.zip
llvm-b738ffa845493d8af0d08acaa7c8b2b91dd295b2.tar.gz
llvm-b738ffa845493d8af0d08acaa7c8b2b91dd295b2.tar.bz2
Heap allocation for new arrays.
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
Diffstat (limited to 'clang/lib/Frontend/CreateInvocationFromCommandLine.cpp')
0 files changed, 0 insertions, 0 deletions