Page MenuHomePhabricator

[Polly][WIP] Insert copy statements into the domain of the schedule tree
Needs RevisionPublic

Authored by gareevroman on Jun 26 2017, 12:20 AM.



Copy statements are implemented using extensions nodes. That causes the following issues:

  1. It is not possible to recompute the dependencies that can be necessary for dependence analysis and, subsequently, detection of parallel loops.
  2. It is not possible to print schedules that contains extensions nodes.
  3. If someone wants to further optimize the schedule tree, the extensions nodes should be handled separately.

This patch makes polly insert copy statements into the domain of the schedule tree to avoid the issues stated above. In particular, it helps to generate parallel code in case of GEMM.

For example, in case of the GEMM from PolyBench 3.2, alpha = beta = 1, Intel Core i7-3820 SandyBridge, OMP_NUM_THREADS = 8, and the following options,

clang -O3 gemm.c -I utilities/ utilities/polybench.c -DPOLYBENCH_TIME -march=native -mllvm -polly -DPOLYBENCH_USE_SCALAR_LB -mllvm —polly-parallel -lgomp

it helps to improve the execution time of generated code from 0.099 seconds to 0.038 seconds in case of standard dataset, from 0.734 seconds to 0.242 seconds in case of large data set, and from 5.78 seconds to 1.74 seconds in case extra large dataset.

Diff Detail

Event Timeline

gareevroman created this revision.Jun 26 2017, 12:20 AM
gareevroman added inline comments.Jun 26 2017, 12:21 AM

TODO: Translate to C++ bindings.

grosser edited edge metadata.Jul 10 2017, 11:30 PM

Hi Roman,

just to make sure this does not appear as to be totally unanswered. I am supportive on this change, but am waiting on the outcome of our discussion with Sven.

grosser requested changes to this revision.Jul 14 2017, 12:37 AM

Just marking this as requesting changes to indicate the discussion with Sven first needs to conclude. Can you ping me when you would like to take up this patch.

Also, one alternative to changing isl is possibly to just walk the full AST and build rebuild it. While rebuilding it, we can then add new statements.

This revision now requires changes to proceed.Jul 14 2017, 12:37 AM