43 lines · plain
1.. _omp150:2 3Parallel region merged with parallel region at <location>. [OMP150]4===================================================================5 6This optimization remark indicates that a parallel region was merged with others7into a single parallel region. Parallel region merging fuses consecutive8parallel regions to reduce the team activation overhead of forking and increases9the scope of possible OpenMP-specific optimizations within merged parallel10regions. This optimization can also guard sequential code between two parallel11regions if applicable.12 13Example14-------15 16This optimization should apply to any compatible and consecutive parallel17regions. In this case the sequential region between the parallel regions will be18guarded so it is only executed by a single thread in the new merged region.19 20.. code-block:: c++21 22 void foo() {23 #pragma omp parallel24 parallel_work();25 26 sequential_work();27 28 #pragma omp parallel29 parallel_work();30 }31 32.. code-block:: console33 34 $ clang++ -fopenmp -O2 -Rpass=openmp-opt -mllvm -openmp-opt-enable-merging omp150.cpp35 omp150.cpp:2:1: remark: Parallel region merged with parallel region at merge.cpp:7:1. [OMP150]36 #pragma omp parallel37 ^38 39Diagnostic Scope40----------------41 42OpenMP optimization remark.43