Joseph Huber | 7eb899c | 2021-09-10 16:17:54 -0400 | [diff] [blame] | 1 | .. _omp180: |
| 2 | |
| 3 | Replacing OpenMP runtime call <call> with <value>. |
| 4 | ==================================================================== |
| 5 | |
Shao-Ce SUN | 0c66025 | 2021-11-15 09:17:08 +0800 | [diff] [blame] | 6 | This optimization remark indicates that analysis determined an OpenMP runtime |
| 7 | calls can be replaced with a constant value. This can occur when an OpenMP |
| 8 | runtime call that queried some internal state was found to always return a |
Joseph Huber | 7eb899c | 2021-09-10 16:17:54 -0400 | [diff] [blame] | 9 | single value after analysis. |
| 10 | |
| 11 | Example |
| 12 | ------- |
| 13 | |
Shao-Ce SUN | 0c66025 | 2021-11-15 09:17:08 +0800 | [diff] [blame] | 14 | This optimization will trigger for most target regions to simplify the runtime |
| 15 | once certain constants are known. This will trigger for internal runtime |
| 16 | functions so it requires enabling verbose remarks with |
Johannes Doerfert | 3c8a4c6 | 2022-01-22 16:24:52 -0600 | [diff] [blame] | 17 | `-openmp-opt-verbose-remarks` (prefixed with `-mllvm` for use with clang). |
Joseph Huber | 7eb899c | 2021-09-10 16:17:54 -0400 | [diff] [blame] | 18 | |
| 19 | .. code-block:: c++ |
| 20 | |
| 21 | void foo() { |
| 22 | #pragma omp target parallel |
| 23 | { } |
| 24 | } |
| 25 | |
| 26 | .. code-block:: console |
| 27 | |
| 28 | $ clang test.c -fopenmp -fopenmp-targets=nvptx64 -O1 -Rpass=openmp-opt \ |
| 29 | -mllvm -openmp-opt-verbose-remarks |
| 30 | remark: Replacing runtime call __kmpc_is_spmd_exec_mode with 1. [OMP180] [-Rpass=openmp-opt] |
| 31 | remark: Replacing runtime call __kmpc_is_spmd_exec_mode with 1. [OMP180] [-Rpass=openmp-opt] |
| 32 | remark: Replacing runtime call __kmpc_parallel_level with 1. [OMP180] [-Rpass=openmp-opt] |
| 33 | remark: Replacing runtime call __kmpc_parallel_level with 1. [OMP180] [-Rpass=openmp-opt] |
| 34 | |
| 35 | Diagnostic Scope |
| 36 | ---------------- |
| 37 | |
| 38 | OpenMP optimization remark. |