[PATCH] D83635: [OpenMPOpt][WIP] Merge parallel regions

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 14 12:41:16 PDT 2020


hfinkel added inline comments.


================
Comment at: llvm/test/Transforms/OpenMP/parallel_region_merging.ll:13
+;    void merge_all() {
+;    #pragma omp parallel
+;        {
----------------
ggeorgakoudis wrote:
> hfinkel wrote:
> > Do these need to say 'nowait' in order to actually match the code?
> No, the code matches the IR generation ('nowait' is available only for worksharing constructs). The merging transformation emits an explicit barrier in place of the implicit barrier after merging. However, I added a TODO because it could make sense to avoid explicit barrier generation, if the 'nowait' clause is present in an enclosing worksharing construct, and the merged parallel regions are independent.
Oh, right. Indeed. Thanks.

We should do barrier elimination anyway, so that's certainly a good point that we should make sure that the barrier elimination can apply to these kinds of barriers (or we can not emit them in the first place, although maybe it's easier to do after we have anything together where we can just query the MemorySSA use/def chain or similar to look at underlying dependence information).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83635/new/

https://reviews.llvm.org/D83635





More information about the llvm-commits mailing list