diff options
author | Tobias Grosser <tobias@grosser.es> | 2017-08-19 20:21:22 +0000 |
---|---|---|
committer | Tobias Grosser <tobias@grosser.es> | 2017-08-19 20:21:22 +0000 |
commit | ecb94a039291145aab487ba1713f05c3684bc8f4 (patch) | |
tree | 93bfade4018c43caa2b36ecb7ac14585d325800f /polly/lib/CodeGen/PPCGCodeGeneration.cpp | |
parent | 91522ffa12309176ce555f4c0bcbd2888135b85c (diff) | |
download | bcm5719-llvm-ecb94a039291145aab487ba1713f05c3684bc8f4.tar.gz bcm5719-llvm-ecb94a039291145aab487ba1713f05c3684bc8f4.zip |
[GPGPU] Correctly initialize array order and fixed_element information
Summary:
This information is necessary for PPCG to perform correct life range reordering.
With these changes applied we can live-range reorder some of the important
kernels in COSMO.
We also update and rename one test case, which previously could not be optimized
and now is optimized thanks to live-range reordering. To preserve test coverage
we add a new test case scalar-writes-in-scop-requires-abort.ll, which exercises
our automatic abort in case of scalar writes in the kernel.
Reviewers: Meinersbur, bollu, singam-sanjay
Subscribers: nemanjai, pollydev, llvm-commits, kbarton
Tags: #polly
Differential Revision: https://reviews.llvm.org/D36929
llvm-svn: 311259
Diffstat (limited to 'polly/lib/CodeGen/PPCGCodeGeneration.cpp')
-rw-r--r-- | polly/lib/CodeGen/PPCGCodeGeneration.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/polly/lib/CodeGen/PPCGCodeGeneration.cpp b/polly/lib/CodeGen/PPCGCodeGeneration.cpp index 8c0742b0fd5..0499003793a 100644 --- a/polly/lib/CodeGen/PPCGCodeGeneration.cpp +++ b/polly/lib/CodeGen/PPCGCodeGeneration.cpp @@ -2815,6 +2815,9 @@ public: Access->ref_id = Acc->getId().release(); Access->next = Accesses; Access->n_index = Acc->getScopArrayInfo()->getNumberOfDimensions(); + // TODO: Also mark one-element accesses to arrays as fixed-element. + Access->fixed_element = + Acc->isLatestScalarKind() ? isl_bool_true : isl_bool_false; Accesses = Access; } @@ -3029,6 +3032,7 @@ public: i++; collect_references(PPCGProg, &PPCGArray); + PPCGArray.only_fixed_element = only_fixed_element_accessed(&PPCGArray); } } @@ -3070,13 +3074,6 @@ public: PPCGProg->to_outer = getArrayIdentity(); // TODO: verify that this assignment is correct. PPCGProg->any_to_outer = nullptr; - - // this needs to be set when live range reordering is enabled. - // NOTE: I believe that is conservatively correct. I'm not sure - // what the semantics of this is. - // Quoting PPCG/gpu.h: "Order dependences on non-scalars." - PPCGProg->array_order = - isl_union_map_empty(isl_set_get_space(PPCGScop->context)); PPCGProg->n_stmts = std::distance(S->begin(), S->end()); PPCGProg->stmts = getStatements(); @@ -3099,6 +3096,9 @@ public: createArrays(PPCGProg, ValidSAIs); + PPCGProg->array_order = nullptr; + collect_order_dependences(PPCGProg); + PPCGProg->may_persist = compute_may_persist(PPCGProg); return PPCGProg; } |