summaryrefslogtreecommitdiff
path: root/openmp/docs
diff options
context:
space:
mode:
authorJohannes Doerfert <johannes@jdoerfert.de>2022-01-22 16:24:52 -0600
committerJohannes Doerfert <johannes@jdoerfert.de>2022-02-01 01:07:50 -0600
commit3c8a4c6f471765451a1b074eb589c9ad367a8e3c (patch)
tree53ed29310ed622aa37fc198e949238b9df87623c /openmp/docs
parent989674f110548866f149b964288d8a84f0d60f40 (diff)
downloadllvm-3c8a4c6f471765451a1b074eb589c9ad367a8e3c.tar.gz
[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
Diffstat (limited to 'openmp/docs')
-rw-r--r--openmp/docs/remarks/OMP180.rst2
-rw-r--r--openmp/docs/remarks/OMP190.rst23
-rw-r--r--openmp/docs/remarks/OptimizationRemarks.rst4
3 files changed, 28 insertions, 1 deletions
diff --git a/openmp/docs/remarks/OMP180.rst b/openmp/docs/remarks/OMP180.rst
index 034181ca5671..c2d937236b32 100644
--- a/openmp/docs/remarks/OMP180.rst
+++ b/openmp/docs/remarks/OMP180.rst
@@ -14,7 +14,7 @@ Example
This optimization will trigger for most target regions to simplify the runtime
once certain constants are known. This will trigger for internal runtime
functions so it requires enabling verbose remarks with
-`-openmp-opt-verbose-remarks`.
+`-openmp-opt-verbose-remarks` (prefixed with `-mllvm` for use with clang).
.. code-block:: c++
diff --git a/openmp/docs/remarks/OMP190.rst b/openmp/docs/remarks/OMP190.rst
new file mode 100644
index 000000000000..2170c0acf975
--- /dev/null
+++ b/openmp/docs/remarks/OMP190.rst
@@ -0,0 +1,23 @@
+.. _omp190:
+
+Redundant barrier eliminated. (device only)
+====================================================================
+
+This optimization remark indicates that analysis determined an aligned
+barrier in the device code to be redundant. This can occur when state
+updates that have been synchronized by the barrier were eliminated too.
+See also "Co-Designing an OpenMP GPU Runtime and Optimizations for Near-Zero
+Overhead Execution", IPDPS'22.
+
+Example
+-------
+
+This optimization will trigger for most target regions if state initialization
+was removed as a consequence of "state forwarding". This will trigger for
+internal runtime functions so it requires enabling verbose remarks with
+`-openmp-opt-verbose-remarks` (prefixed with `-mllvm` for use with clang).
+
+Diagnostic Scope
+----------------
+
+OpenMP optimization remark.
diff --git a/openmp/docs/remarks/OptimizationRemarks.rst b/openmp/docs/remarks/OptimizationRemarks.rst
index bf964e2ffc74..e9bc9cf8bb40 100644
--- a/openmp/docs/remarks/OptimizationRemarks.rst
+++ b/openmp/docs/remarks/OptimizationRemarks.rst
@@ -40,6 +40,7 @@ OpenMP Remarks
OMP160
OMP170
OMP180
+ OMP190
.. list-table::
:widths: 15 15 70
@@ -111,3 +112,6 @@ OpenMP Remarks
* - :ref:`OMP180 <omp180>`
- Optimization
- Replacing OpenMP runtime call <call> with <value>.
+ * - :ref:`OMP190 <omp190>`
+ - Optimization
+ - Redundant barrier eliminated. (device only)