<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/62744>62744</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Add gfx90a min/max atomicrmw lowering
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ivanrodriguez3753
</td>
</tr>
</table>
<pre>
Currently, for fmin/fmax atomicrmw instructions on gfx90a, `AtomicExpansionKind::CmpXChg` is returned in both `SITargetLowering::shouldExpandAtomicRMWInIR` and `AMDGPUTargetLowering::shouldExpandAtomicRMWInIR`.
https://github.com/llvm/llvm-project/blob/195621aacb96a4e2f49f5d888e2fc7af20e6e797/llvm/lib/Target/AMDGPU/SIISelLowering.cpp#LL13202C12-L13202C12
https://github.com/llvm/llvm-project/blob/64d169c74d2cd3730893dffacd0061b937e55169/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp#LL5117C6-L5117C6
Does AMD plan on adding support for lowering `atomicrmw [fmin|fmax]` to `[global|flat]_atomic_max_f64` (on gfx90a) anytime soon? I am doing this work as part of my work at Cray and was looking to upstream it. It seems like it would just be adding some more checks/special casing in `SITargetLowering::shouldExpandAtomicRMWInIR` and the code for adding the LLVM IR -> AMDGCN mapping, which seems straightforward.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyklN9v4ygQx_8a8jJqhLGN4wc_pM56FV16OrX3660aG2yzxWAB3jT3159w0t2edNJq1ReDYL7D18yHQe_VYKSsSH5P8sMGlzBaV6mvaJwVTg2L_Cct8nTTWnGp6sU5aYK-EFZDbx30kzKENf2Er4DBTqpz0xmU8cEtXVDWeLAGhv61pBg1hNP9GvbpdUbjlTW_KCNIuifpvp7mv-txIJyC8uBkWJyRApSB1oYxSp-Ov6MbZDjZs3TKDFedH-2ixZpQXJM_Pvx1NMfHmAmNWA99OHz-7Y-fVW8JPRC6v37HEGYfNawhrBlUGJd229mJsEbrr2_D3ezsF9kFwppW25awJilzzhLEri05ZpL1WdnnYrfbSdZ3BfaMSi6LsniXR0Xd1SxhzdU7Yc3T8fgk9Zv9bTfPhKWnU5IyyuqE3X2bfcwwz0TCy67IBOtEWqR0V6ai77ETlPKkLdNC5nnCyx8bvk7-13SeJEXN727j-3s-WOlh_3CAWaOJ9KAQygzgl3m2LqzY6Vu6WNrv2JH8fuWxqCOPJD9EAIKNQSS_H7RtUcdNjYHkh-er8HnC1-eeZzGWsN07WktAcwlqkuCtNSRt4Ag4gbDx4DAqD2frXgA9zOgC2B6my20pQO3wssJ3Rg_a2pdVZGGZfXASJ1BhC8cAXsrJg1YvElSAc2QRviw-QCu__bidJEzWSehG2b14who_y06hhg59jFDmA68jjBI6K-R6sbcj49rp9OcDHB_hjqSfYj0-17_ChPMcM7MazqPqxpt9HxyqYQy9dWd0YgsbUaWiTEvcyCrhu4zxhO3oZqx4L4ukaPtW5JTnWcfFTiYdz0SO2LfINqpilKU0T3iyYwmjW8ZTmvM2lWVZUEwZyaicUOltZG9r3bBR3i-y4qzIso3GVmq_NjPGjDzDukkYi73NVSvw7TJ4klGtfPDfswQVtKz2QtzqD9fO9t_G9sbdZnG6-un3tXqJ5Vu9_hsAAP__gf3FzQ">