[all-commits] [llvm/llvm-project] 989674: [OpenMP] Ensure to remove noinline from all runtim...

Johannes Doerfert via All-commits all-commits at lists.llvm.org
Mon Jan 31 23:11:43 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 989674f110548866f149b964288d8a84f0d60f40
      https://github.com/llvm/llvm-project/commit/989674f110548866f149b964288d8a84f0d60f40
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2022-02-01 (Tue, 01 Feb 2022)

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

  Log Message:
  -----------
  [OpenMP] Ensure to remove noinline from all runtime functions eventually

We used to remove noinline from known OpenMP runtime functions (which
are declared in OMPKinds.td). Now we remove noinline from all functions
with the proper prefixes: __kmpc, _ZN4_OMP (= namespace omp), omp_


  Commit: 3c8a4c6f471765451a1b074eb589c9ad367a8e3c
      https://github.com/llvm/llvm-project/commit/3c8a4c6f471765451a1b074eb589c9ad367a8e3c
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2022-02-01 (Tue, 01 Feb 2022)

  Changed paths:
    M llvm/lib/Transforms/IPO/OpenMPOpt.cpp
    A llvm/test/Transforms/OpenMP/barrier_removal.ll
    M openmp/docs/remarks/OMP180.rst
    A openmp/docs/remarks/OMP190.rst
    M openmp/docs/remarks/OptimizationRemarks.rst

  Log Message:
  -----------
  [OpenMP] Eliminate redundant barriers in the same block

Patch originally by Giorgis Georgakoudis (@ggeorgakoudis), typos and
bugs introduced later by me.

This patch allows us to remove redundant barriers if they are part
of a "consecutive" pair of barriers in a basic block with no impacted
memory effect (read or write) in-between them. Memory accesses to
local (=thread private) or constant memory are allowed to appear.
Technically we could also allow any other memory that is not used to
share information between threads, e.g., the result of a malloc that
is also not captured. However, it will be easier to do more reasoning
once the code is put into an AA. That will also allow us to look through
phis/selects reasonably. At that point we should also deal with calls,
barriers in different blocks, and other complexities.

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


  Commit: a5b6aef24e7a3f2a74cc4e716314d3f8d424d1c1
      https://github.com/llvm/llvm-project/commit/a5b6aef24e7a3f2a74cc4e716314d3f8d424d1c1
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2022-02-01 (Tue, 01 Feb 2022)

  Changed paths:
    M llvm/lib/Transforms/IPO/AttributorAttributes.cpp

  Log Message:
  -----------
  [Attributor][NFCI] Remove anonymous namespaces

The namespaces made it more complicate to implement static helpers,
among other things. We should not need them at all.


  Commit: 3f0e670498cb923a7f8e8f779db660770e05ebc0
      https://github.com/llvm/llvm-project/commit/3f0e670498cb923a7f8e8f779db660770e05ebc0
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2022-02-01 (Tue, 01 Feb 2022)

  Changed paths:
    M llvm/include/llvm/Transforms/IPO/Attributor.h
    M llvm/lib/Transforms/IPO/Attributor.cpp
    M llvm/lib/Transforms/IPO/AttributorAttributes.cpp

  Log Message:
  -----------
  [Attributor][NFCI] Expose some nosync reasoning to outside users.

No-sync is a property that we need in more places as complex
transformations emerge. To simplify the query we provide an
`AA::isNoSyncInst` helper now and expose two existing helpers through
the `AANoSync` class.


  Commit: 7b9844cc8dd0045f5251450ba2980d6d6ac48ef9
      https://github.com/llvm/llvm-project/commit/7b9844cc8dd0045f5251450ba2980d6d6ac48ef9
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2022-02-01 (Tue, 01 Feb 2022)

  Changed paths:
    M openmp/libomptarget/DeviceRTL/src/Synchronization.cpp

  Log Message:
  -----------
  [OpenMP][FIX] Explicit barriers in SPMD mode are not aligned

Due to num_threads (probably also other reasons) we cannot assume
explicit barriers are always executed by all threads in an aligned
fashion. We can optimize them if that property can be proven but
that is different.


Compare: https://github.com/llvm/llvm-project/compare/c25ba3c79020...7b9844cc8dd0


More information about the All-commits mailing list