[PATCH] D13611: [Polly] Create virtual independent blocks
Johannes Doerfert via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 9 17:28:45 PDT 2015
jdoerfert created this revision.
jdoerfert added reviewers: grosser, Meinersbur.
jdoerfert added a subscriber: Polly.
Herald added a subscriber: sanjoy.
Even with the scalar/PHI modeling and code generation we still
utilized the independent blocks pass to move scalars around in order to
decrease the dependences caused by them. However, this has two major
drawbacks:
o Polly could not be used as analysis only pass by default and
without the independent blocks pass the result suffered.
o The independent blocks pass had limited knowledge about domains
as well as accesses. Both limited the pass to simple
movement/re-computation of scalars that can be trivially moved.
This patch is a drop-in replacement for the independent blocks pass
that first virtually moves/re-computes scalars in the SCoP description.
Only in the code generation re-computation will actually take place.
The logic is split in three traversals of the scalars in the SCoP:
1) Collect interesting operands for each scalar definition that
escapes the block it resides in.
2) For each scalar use, check if the definition can be recomputed
in its statement based on the interesting operands of the
definition. If so, remove the access and remember that the
definition has to be recomputed later.
3) For each scalar definition, check if all uses have been
eliminated through virtual re-computation. If so, remove the
access as it does not need to be communicated anymore.
Subsequent patches can increase the capabilities easily as the domain
and access information is already available.
-------------------------- REVIEW NOTES --------------------------
- lnt & unit tests are green
- We had 245 scalar access in the test suite before, now 236. In
total this logic eliminated 54 trivially recomputable scalars
and allowed to eliminate 54 instead of 49 statements.
- The buildbots show the following compile/execution time changes for
a similar but prior version of this patch:
Compile time:
Improvements : Δ : Previous : Current : σ
.../bmm : -71.43% : 0.6440 : 0.1840 : 0.0054
.../paq8p : -12.48% : 5.8644 : 5.1323 : 0.0181
.../consumer-lame : -10.13% : 10.3444 : 9.2961 : 0.0376
.../sieve : -5.61% : 0.4280 : 0.4040 : 0.0093
.../espresso : -1.35% : 10.3841 : 10.2441 : 0.0395
..//Recurrences-dbl : -1.24% : 4.1923 : 4.1403 : 0.0150
.../471_omnetpp : -1.08% : 42.1606 : 41.7046 : 0.1013
Execution time:
Regressions : Δ : Previous : Current : σ
.../salsa20 : 4.32% : 6.6684 : 6.9564 : 0.0059
.../GlobalDataFlow-dbl : 1.53% : 4.6963 : 4.7683 : 0.0047
Improvements : Δ : Previous : Current : σ
..//viterbi : -1.61% : 2.7402 : 2.6962 : 0.0072
http://reviews.llvm.org/D13611
Files:
include/polly/CodeGen/BlockGenerators.h
include/polly/LinkAllPasses.h
include/polly/ScopInfo.h
lib/Analysis/ScopInfo.cpp
lib/CMakeLists.txt
lib/CodeGen/BlockGenerators.cpp
lib/CodeGen/CodeGeneration.cpp
lib/Makefile
lib/Support/RegisterPasses.cpp
lib/Transform/IndependentBlocks.cpp
test/IndependentBlocks/inter_bb_scalar_dep.ll
test/IndependentBlocks/intra_and_inter_bb_scalar_dep.ll
test/IndependentBlocks/intra_bb_scalar_dep.ll
test/IndependentBlocks/phi_outside_scop.ll
test/IndependentBlocks/scalar_to_array.ll
test/IndependentBlocks/scev-invalidated.ll
test/Isl/CodeGen/20110312-Fail-without-basicaa.ll
test/Isl/CodeGen/OpenMP/invariant_base_pointer_preloaded_different_bb.ll
test/Isl/CodeGen/eliminate-multiple-scalar-fp-reads.ll
test/Isl/CodeGen/eliminate-multiple-scalar-reads.ll
test/Isl/CodeGen/eliminate-scalars-with-outside-load.ll
test/Isl/CodeGen/non-affine-phi-node-expansion-3.ll
test/Isl/CodeGen/srem-in-other-bb.ll
test/ScopInfo/eliminate-scalar-caused-by-load-reduction-2.ll
test/ScopInfo/eliminate-scalar-caused-by-load-reduction.ll
test/ScopInfo/independent-blocks-never-stop-on-big-scop.ll
test/ScopInfo/inter_bb_scalar_dep.ll
test/ScopInfo/intra_and_inter_bb_scalar_dep.ll
test/ScopInfo/scalar_dependence_cond_br.ll
test/ScopInfo/tempscop-printing.ll
test/ScopInfo/unneeded_scalar_dependences-1.ll
test/ScopInfo/unneeded_scalar_dependences-2.ll
test/ScopInfo/unneeded_scalar_dependences-3.ll
test/ScopInfo/unneeded_scalar_dependences-4.ll
test/ScopInfo/unneeded_scalar_dependences-5.ll
test/ScopInfo/unneeded_scalar_dependences-6.ll
test/ScopInfo/unneeded_scalar_dependences-7.ll
test/ScopInfo/unneeded_scalar_dependences-8.ll
test/ScopInfo/unneeded_scalar_dependences-9.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13611.37007.patch
Type: text/x-patch
Size: 102751 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151010/6370b5ae/attachment.bin>
More information about the llvm-commits
mailing list