[ScopBuilder] Introduce -polly-stmt-granularity=scalar-indep option.
commit4bd2f732d05214ba7253225f7adb3b0af5c500df
authorMichael Kruse <llvm@meinersbur.de>
Thu, 5 Oct 2017 13:43:00 +0000 (5 13:43 +0000)
committerMichael Kruse <llvm@meinersbur.de>
Thu, 5 Oct 2017 13:43:00 +0000 (5 13:43 +0000)
tree12b9c0b1511d5c2d9be618b59ead935041725c8e
parent5a61a8ad549e6a54e416eabe48fce467f9a38b2d
[ScopBuilder] Introduce -polly-stmt-granularity=scalar-indep option.

The option splits BasicBlocks into minimal statements such that no
additional scalar dependencies are introduced.

The algorithm is based on a union-find structure, and unites sets if
putting them into separate statements would introduce a scalar
dependencies. As a consequence, instructions may be split into separate
statements such their relative order is different than the statements
they are in. This is accounted for instructions whose relative order
matters (e.g. memory accesses).

The algorithm is generic in that heuristic changes can be made
relatively easily. We might relax the order requirement for read-reads
or accesses to different base pointers. Forwardable instructions can be
made to not cause a join.

This implementation gives us a speed-up of 82% in SPEC 2006 456.hmmer
benchmark by allowing loop-distribution in a hot loop such that one of
the loops can be vectorized.

Differential Revision: https://reviews.llvm.org/D38403

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@314983 91177308-0d34-0410-b5e6-96231b3b80d8
include/polly/ScopBuilder.h
lib/Analysis/ScopBuilder.cpp
test/ScopInfo/granularity_scalar-indep.ll [new file with mode: 0644]
test/ScopInfo/granularity_scalar-indep_epilogue.ll [new file with mode: 0644]
test/ScopInfo/granularity_scalar-indep_epilogue_last.ll [new file with mode: 0644]
test/ScopInfo/granularity_scalar-indep_noepilogue.ll [new file with mode: 0644]
test/ScopInfo/granularity_scalar-indep_ordered.ll [new file with mode: 0644]