The array partitioning pass is a LLVM optimization pass which splits (currently global) arrays within the C program through LLVM IR transformations and redirects accesses to the corresponding sub-arrays created for subsequent read and write accesses.
In order to use the array partitioning pass, you will need to do the following:
1) Add this line to the Makefile
PARTITION=1
2) Create a partition.config file in the test directory
Each line of the partition.config file describes the partitioning scheme for one global array and it has four fields.
<global/local> <function name if local> <array name> <partition spec>
For example, if you want to split a global array named arr which has 10 rows and 10 columns into 10 different sub-arrays each containing one row of the original array:
global - arr *|-|
Can also be achieved using
global - arr b10|-|
But performance might suffer.
These are the possible partitions to create:
For more details refer to this presentation: arraypartition_sep18.pdf
You may also want to do these optional steps for improved performance: 1) Add these options into the config.tcl file
set_parameter REPLICATE_PTHREAD_FUNCTIONS 1 set_parameter REPLICATE_ROMS 1
2) Add loop unrolling directives to the Makefile