Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Flang][OpenMP] Use simdloop operation only for omp simd pragma
OpenMP standard differentiates between omp simd (2.9.3.1) and omp do/for simd (2.9.3.2 for OpenMP 5.0 standard) pragmas. The first one describes the loop which needs to be vectorized. The second pragma describes the loop which needs to be workshared between existing threads. Each thread can use SIMD instructions to execute its chunk of the loop. That's why we need to model !$omp simd do-loop as omp.simdloop operation and add compiler hints for vectorization. The worksharing loop: !$omp do simd do-loop should be represented as worksharing loop. Currently Flang denotes both type of OpenMP pragmas by omp.simdloop operation. In consequence we cannot differentiate between: !$omp parallel simd do-loop and !$omp parallel do simd do-loop The second loop should be workshared between multiple threads. The first one describes the loop which needs to be redundantly executed by multiple threads. Current Flang implementation does not perform worksharing for `!$omp do simd` pragma and generates valid code only for first case.
- Loading branch information