[Mlir-commits] [mlir] MLIR: Enable importing inlineasm calls (PR #121624)

Tobias Gysi llvmlistbot at llvm.org
Sat Jan 4 02:15:44 PST 2025


================
@@ -535,6 +535,16 @@ define void @indirect_vararg_call(ptr addrspace(42) %fn) {
 
 ; // -----
 
+; CHECK-LABEL: @inlineasm
+; CHECK-SAME:  %[[ARG1:[a-zA-Z0-9]+]]
+define i32 @inlineasm(i32 %arg1) {
+  %1 = call i32 asm "bswap $0", "=r,r"(i32 %arg1)
+  ; CHECK:  llvm.inline_asm "bswap $0", "=r,r" %[[ARG1]] : (i32) -> i32
----------------
gysit wrote:

```suggestion
  ; CHECK:  llvm.inline_asm "bswap $0", "=r,r" %[[ARG1]] : (i32) -> i32
  %1 = call i32 asm "bswap $0", "=r,r"(i32 %arg1)
```
nit: we usually put the check line above the converted instruction.

https://github.com/llvm/llvm-project/pull/121624


More information about the Mlir-commits mailing list