<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/64493>64493</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[mlir] incomplete support in the `gpu-to-llvm` lowering
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Colloportus0
</td>
</tr>
</table>
<pre>
MLIR built at commit 1d9f77f5
Reproduced with:
`mlir-opt --gpu-to-llvm temp.mlir`
temp.mlir:
``` milr
module {
func.func @func1(){
%c1 = arith.constant 1 : index
%alloc_6 = memref.alloc() : memref<2x3xf32>
memref.alloca_scope {
%41 = memref.generic_atomic_rmw %alloc_6[%c1, %c1] : memref<2x3xf32> {
^bb0(%arg0: f32):
memref.atomic_yield %arg0 : f32
}
}
return
}
}
```
```console
temp.mlir:6:13: error: 'llvm.cmpxchg' op operand #1 must be integer or LLVM pointer type, but got 'f32'
%41 = memref.generic_atomic_rmw %alloc_6[%c1, %c1] : memref<2x3xf32> {
^
temp.mlir:6:13: note: see current operation: %26 = "llvm.cmpxchg"(%23, %25, %25) <{failure_ordering = 2 : i64, success_ordering = 6 : i64}> : (!llvm.ptr, f32, f32) -> !llvm.struct<(f32, i1)>
```
Here is the fix for the main issue here https://reviews.llvm.org/D145901, but it won't fix the lowering completely, because cmpxchg does not accept floats. @ftynse, is there any workaround to make it work? I found this related discussion https://lists.llvm.org/pipermail/llvm-dev/2020-August/144314.html
_Originally posted by @pifon2a in https://github.com/llvm/llvm-project/issues/59182#issuecomment-1465648577_
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8VU2P4jgT_jXmUgIlTpyQAwemafSO1KNXmsNekXEqwduOHfmjaf79yk5gQo92D3tYhPJRfqrqqarHMXdO9hpxR9g3wg4rHvzF2N2LUcqMxvrgstXZtLfdj7fvP-EcpPLAPQgzDNID5G3T1XXHSHYg2f4njta0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