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

    <tr>
        <th>Summary</th>
        <td>
             [AMDGPU][SILowerSGPRSpills][OpenMP] Commit breaks OpenMC on AMD MI250
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    Commit 7a98f084c4d121244ef7286bc6503b6a181d446e breaks the OpenMC app when running on AMD GPUs via OpenMP offloading. When this commit is reverted, OpenMC runs correctly.

The behavior we see with OpenMC with this commit varies. Sometimes it runs cleanly but produces slightly incorrect results, and sometimes OpenMC crashes at runtime, giving a variety of memory related errors, e.g.:

```
AMDGPU fatal error 1: Memory access fault by GPU 2 (agent 0x56135fcf2f00) at virtual address 0x7fe62f1f5000. Reasons: Unknown (0)
```

OpenMC can be downloaded, compiled, installed, and tested for correctness via script at: https://github.com/jtramm/openmc_offloading_builder

I'm also happy to test out any proposed patches. In the interim, I'd vote that we revert 7a98f084c4d121244ef7286bc6503b6a181d446e in main until a fix is found.

Another notable issue with 7a98f084c4d121244ef7286bc6503b6a181d446e is that it increases OpenMC's compile time from about 10 minutes up to 15 minutes. No significant performance gains are noted from the patch, so in OpenMC's case at least, the extra compile time doesn't seem to be worth it.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVE2P2zgM_TXKhaghK7GdHHJIJ8hggJ3dQWcHeyxom47VypIh0cnk3y8YJ-0UWCwKBI4_yMenx0diSvboibaq-KyK_QIn7kPcfuOIw7CoQ3vZPoRhsAwVbtadXq-aVZub3KxW1FVmXdZNWehlXWK-ztvVqiSoI-H3BNwT_DWSf34AHEc49-QhTt5bf4TgYfe8h8eXtwQni3PcC4SucwFb648Z_CPx3NsEzVzfJoh0osjUKvNwh46T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