[flang-commits] [flang] [Flang][OpenMP][Lower] Add lowering support of OpenMP distribute to MLIR (PR #67798)

Sergio Afonso via flang-commits flang-commits at lists.llvm.org
Wed Jan 31 05:04:02 PST 2024


skatrak wrote:

> This needs some more discussion or explanation. Could you construct a table of the lowerings for the various distribute combinations? Could you also mark if any of these are composite constructs?

The different constructs where DISTRIBUTE appears at the top, using the 5.0 spec (sect 2.9.4) as reference, are listed in the table below. All these can appear combined with TEAMS and TARGET, in which case they would be represented the same way but nested inside in the following manner:

```
!$omp teams distribute ...

omp.teams {
  omp.distribute {
    ...
  }
  omp.terminator
}
```

```
!$omp target teams distribute ...

omp.target {
  omp.teams {
    omp.distribute {
      ...
    }
    omp.terminator
  }
  omp.terminator
}
```

<table>
<tr>
<td>

**Construct**

</td>
<td>

**Composite**

</td>
<td>

**MLIR**

</td>
</tr>
<tr>
<td>

`!$omp distribute`

</td>
<td> No </td>
<td>

```mlir
omp.distribute {
  omp.wsloop ... {
    ...
  }
  omp.terminator
}
```

</td>
</tr>
<tr>
<td>

`!$omp distribute parallel do`

</td>
<td> Yes </td>
<td>

```mlir
omp.distribute {
  omp.parallel {
    omp.wsloop ... {
      ...
    }
    omp.terminator
  }
  omp.terminator
}
```

</td>
</tr>
<tr>
<td>

`!$omp distribute parallel do simd`

</td>
<td> Yes </td>
<td>

```mlir
omp.distribute {
  omp.parallel {
    omp.wsloop ... {
      <omp.simd?>
      ...
    }
    omp.terminator
  }
  omp.terminator
}
```

</td>
</tr>
<tr>
<td>

`!$omp distribute simd`

</td>
<td> Yes </td>
<td>

```mlir
omp.distribute {
  omp.simdloop ... {
    ...
  }
  omp.terminator
}
```

</td>
</tr>
</table>

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


More information about the flang-commits mailing list