diff --git a/flang/lib/Lower/OpenMP.cpp b/flang/lib/Lower/OpenMP.cpp index 2019b5631a46bb..1684c4a8a01acc 100644 --- a/flang/lib/Lower/OpenMP.cpp +++ b/flang/lib/Lower/OpenMP.cpp @@ -3789,7 +3789,16 @@ static void genOMP(Fortran::lower::AbstractConverter &converter, } // 2.9.3.1 SIMD construct - if (llvm::omp::allSimdSet.test(ompDirective)) { + // Process simd loop: + // !$ omp simd + // do-loop + // Worksharing loops like: + // !$ omp do simd + // do-loop + // should be processed as other worksharing loops + // and they should be represented by omp.wsloop operation + if ((llvm::omp::OMPD_simd == ompDirective) || + (llvm::omp::OMPD_target_simd == ompDirective)) { createSimdLoop(converter, eval, ompDirective, loopOpClauseList, currentLocation); } else {