<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/58191>58191</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [Flang][OpenMP] Implement reduction for intrinsic functions
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            openmp,
            flang:ir
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          kiranchandramohan
      </td>
    </tr>
</table>

<pre>
    The OpenMP standard supports several intrinsic functions in reduction like `max`, `min`, `iand`, `ior`, `ieor`.

```
subroutine reduction_min(y)
  integer :: x, y(:)
  x = 0
  !$omp parallel
  !$omp do reduction(min:x)
  do i=1, 100
    x = min(x, y(i))
  end do
  !$omp end do
  !$omp end parallel
  print *, x
end subroutine
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx9Uk2P3CAM_TXkghoF8jGTQw5pRyv1ULWH3iuSOAldAhGQVfbf15DOZrRbVULgZxu_Z3Bnhtfm5wz0-wr62w_qvNCDsAN127oa6x118AJWKCq1t1I72dNx072XRjv0UQvDFhFV8hkoqbJF7LgT_iUCqU8gsfYDMvYBQEQpyW4ka__uGD1WhG7rrNm81HCS_gr1-fWV8PpIokEnTGApyVtcdA8EGL8GfGbtGL_R7A4JZ4QXZlnpKrBZBepjZDAnL9YLzHm7P9TEBIlVWWBk2VvtO9kh9U2PDDfPy6AHLPCR9X_-91pX_CCPOW3g2A9vyDtf7t3DJtCwqiqzirELS4YmH-q8FomXXkFDys9PSuiJlDc0j_lAm35dVgULINP596Ox_xqQZLOqmb1fXXz9J1yT9PPWpb1ZECj1cj8-rdb8ht4jlM5t4NAor6xmydxcqisf2JhXXT_mvK9YUZQsA1FeinLMABIlOlAuKCacG1S6rGjE0eJ8jE3krbTBV94S2fCMc_yhivGyzlla1KzqBR-qkRd5X9akyGARUqVBWGrslNgmauy2yWFQSefdGRTOyUlDfLFQX2x-NrZ5llbofsaZt2IxeCaxsSZ29QeAywaW">