[all-commits] [llvm/llvm-project] ca134c: [OpenMP] Group side-effects to improve guarding ef...

Johannes Doerfert via All-commits all-commits at lists.llvm.org
Fri Sep 10 10:09:10 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ca134c3963d310c2868f08c211011d610b4eefb5
      https://github.com/llvm/llvm-project/commit/ca134c3963d310c2868f08c211011d610b4eefb5
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    M llvm/lib/Transforms/IPO/OpenMPOpt.cpp
    A llvm/test/Transforms/OpenMP/spmdization_guarding.ll

  Log Message:
  -----------
  [OpenMP] Group side-effects to improve guarding efficiency

When we guard side-effects as part of SPMDzation we do it for
consecutive instructions that need guarding. This patch will try to
reorder guarded side-effects in a block to decrease the number of
guarded regions we need. It does not use any smarts, e.g., alias
analysis, to move side-effects over non-interfering reads. Instead,
it only moves side-effects downwards to the next guarded side-effect
if there was nothing in between that could have possibly be affected.

Reviewed By: ggeorgakoudis

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


  Commit: 7dbba3376f633cabcf4df568bc9ca95f44a35203
      https://github.com/llvm/llvm-project/commit/7dbba3376f633cabcf4df568bc9ca95f44a35203
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    M llvm/include/llvm/Analysis/TargetTransformInfo.h
    M llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
    M llvm/include/llvm/Transforms/Utils/GlobalStatus.h
    M llvm/lib/Analysis/TargetTransformInfo.cpp
    M llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h
    M llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.h
    M llvm/lib/Transforms/IPO/GlobalOpt.cpp
    M llvm/lib/Transforms/Utils/GlobalStatus.cpp
    A llvm/test/Transforms/GlobalOpt/address_space_initializer.ll

  Log Message:
  -----------
  [GlobalOpt][FIX] Do not embed initializers into AS!=0 globals

Not all address spaces support initializers for globals and we can
therefore not set them without checking if they are allowed. This
patch adds a hook into TTI to check if an AS allows non-undef
initializers. We disable it for all but address space 0 by default,
NVPTX and AMDGPU targets allow all but address space 3.

Reviewed By: tra

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


  Commit: 45e8e084921b99ca36131d7f90359c70c4e1a25c
      https://github.com/llvm/llvm-project/commit/45e8e084921b99ca36131d7f90359c70c4e1a25c
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    M clang/include/clang/Sema/Sema.h
    M clang/lib/Parse/ParseOpenMP.cpp
    M clang/lib/Sema/SemaOpenMP.cpp
    M clang/test/OpenMP/assumes_codegen.cpp
    M clang/test/OpenMP/assumes_include_nvptx.cpp
    M clang/test/OpenMP/assumes_print.cpp
    M clang/test/OpenMP/assumes_template_print.cpp

  Log Message:
  -----------
  [OpenMP] Encode `omp [...] assume[...]` assumptions with `omp[x]` prefix

Since these assumptions are coming from OpenMP it makes sense to mark
them as such in the generic IR encoding. Standardized assumptions will
be named
  omp_ASSUMPTION_NAME
and extensions will be named
  ompx_ASSUMPTION_NAME
which is the OpenMP 5.2 syntax for "extensions" of any kind.

This also matches what the OpenMP-Opt pass expects.

Summarized,
  #pragma omp [...] assume[s] no_parallelism
now generates the same IR assumption annotation as
  __attribute__((assume("omp_no_parallelism")))

Reviewed By: jhuber6

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


Compare: https://github.com/llvm/llvm-project/compare/deefeffb5db6...45e8e084921b


More information about the All-commits mailing list