llvm-project/polly/test
Michael Kruse b738ffa845 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
2017-06-28 13:02:43 +00:00
..
CodeGen [Polly] Fix code generation of llvm.expect intrinsic 2017-05-14 09:09:54 +00:00
DeLICM [DeLICM] Partial writes for PHIs. 2017-05-24 15:23:06 +00:00
DeadCodeElimination [Polly] Remove unwanted --check-prefix=CHECK from unit tests. NFC. 2016-04-15 06:12:29 +00:00
DependenceInfo Update some tests to changes in isl's internal representation 2017-05-27 11:33:05 +00:00
FlattenSchedule Add -polly-flatten-schedule pass. 2016-09-08 15:02:36 +00:00
GPGPU [PPCGCodeGeneration] Add flag to allow polly to fail in GPU kernel fails. 2017-06-26 14:56:56 +00:00
Isl Heap allocation for new arrays. 2017-06-28 13:02:43 +00:00
JSONExporter [JSONImport] Check, if the size of an imported array is positive 2017-06-27 22:30:44 +00:00
PruneUnprofitable [PruneUnprofitable] Add -polly-prune-unprofitable pass. 2017-03-17 13:09:52 +00:00
ScheduleOptimizer [FIX] A small addition to r305675. 2017-06-25 06:30:11 +00:00
ScopDetect [Polly] [ScopDetection] Allow passing multiple functions to `-polly-only-func`. 2017-06-09 08:23:40 +00:00
ScopDetectionDiagnostics [ScopDetection] Require LoadInst base pointers to be hoisted. 2017-03-07 20:28:43 +00:00
ScopInfo [FIX] Add %loadPolly to test 2017-06-27 10:47:55 +00:00
Simplify [Simplify] Use execution order of memory accesses. 2017-06-06 17:46:42 +00:00
Unit Introduce unittests. 2016-08-25 12:36:15 +00:00
UnitIsl [CMake] Fix polly-isl-test execution in out-of-LLVM-tree builds. 2017-04-22 23:02:53 +00:00
CMakeLists.txt [CMake] Remove POLLY_TEST_DIRECTORIES. 2017-05-04 12:21:25 +00:00
README
create_ll.sh Small change to create_ll.sh [NFC] 2015-03-08 15:36:27 +00:00
lit.cfg Make the lit configuration Python 3 compatible 2015-07-24 20:33:22 +00:00
lit.site.cfg.in [ScopInfo] Do not use LLVM names to identify statements, arrays, and parameters 2017-05-03 20:08:52 +00:00
polly.ll tests: Drop -polly-detect-unprofitable and -polly-no-early-exit 2015-10-06 15:36:44 +00:00
update_check.py Add -polly-flatten-schedule pass. 2016-09-08 15:02:36 +00:00

README

place tests here