[flang-commits] [flang] [Flang][OpenMP] Use simdloop operation only for omp simd pragma (PR #79559)

Sergio Afonso via flang-commits flang-commits at lists.llvm.org
Fri Jan 26 02:52:25 PST 2024


================
@@ -3377,10 +3414,17 @@ static void genOMP(Fortran::lower::AbstractConverter &converter,
                               ")");
   }
 
-  // 2.9.3.1 SIMD construct
   if (llvm::omp::allSimdSet.test(ompDirective)) {
-    createSimdLoop(converter, eval, ompDirective, loopOpClauseList,
-                   currentLocation);
+    if (isWorkshareSimdConstruct(ompDirective)) {
----------------
skatrak wrote:

We can use one of the existing directive sets here instead:
```suggestion
    if (llvm::omp::allDoSet.test(ompDirective)) {
```
We could also remove the need for a nested 'if' as well:
```c++
if (llvm::omp::allDoSimdSet.test(ompDirective))
  createSimdWsLoop(...);
else if (llvm::omp::allSimdSet.test(ompDirective))
  createSimdLoop(...);
else
  createWsLoop(...);
```

https://github.com/llvm/llvm-project/pull/79559


More information about the flang-commits mailing list