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

    <tr>
        <th>Summary</th>
        <td>
            [OpenMP] Incompatible attributes emitted when optimizing 'omp_get_schedule'
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            openmp
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
            jdoerfert,
            shiltian,
            jhuber6
      </td>
    </tr>

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

<pre>
    When running `-O2` on the following code, we emit `readnone` and `writeonly` on the `omp_get_schedule` function. See https://godbolt.org/z/a1djE7Ghe for the reproducer.
```llvm
define void @omp_get_schedule(ptr %ScheduleKind, ptr %ChunkSize) {
entry:
  ret void
}

!llvm.module.flags = !{!0}

!0 = !{i32 7, !"openmp", i32 51}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxkUk1vpDoQ_DXNxQoyzddw4JBkHk9PT6uslMMeI2P3gGeNjWyTUfLrV2ZmN9FGQkCXu4squkQIerJEPdQPgHhWjvyJfAREwEdADLM2UQv7BzjP20i-SXV9zMQWZ-f7G5iNTr31P2ayzG_WajsxaPjdE0LDmbMszsROzhh3SUfSKQJ8ZBditOiYWj0JZZ2l1C-sStDF60jOmrdPHNBwt6wvE8WXIGdSm9knTpuVUTubs2ciNse4BijvAQfAYXJqdCbmzk-AwzvgIAp1_qf9d5fkd1pPq3dqk-Rz4Efg99Dw62XM63KFFJ20JfbqtGJQfZWBhzV6Blg_35D_tVXJ5Q1-nDf781m_E2DHoH24spKN_i1p3SvGPMX9EzcZ7fH2cr1jkfTki0v8-cmIKTAojwywSIxY8K8T_FOHLpG1SVMqEd1KdlmvC2bprC4-5n__gUz1perKTmTUF03XFlXTYp3NvWwPVLd1V3HJBdWVOnEpK1l2SlYd75pM98ixLHiBWJSHqs7Htu46rJp6rIpayBIqTovQJt9dOT9lOoSN-ubQlTwzYiQTbvn8kFofM9-ngbtxmwJU3OgQwwdF1NHsqX5ayX77DvWR_WelW1YR9WiIiRi9HrdIYQ9fJMUuKbdujXrR73t0sf263jbbvOn_ypaO8zbm0i2Awx6V6-Nu9e5MMgIOu6MAOOymfgUAAP__EaoOUA">