[Mlir-commits] [mlir] [mlir][spirv] Add gpu printf op lowering to spirv.CL.printf op (PR #78510)
Jakub Kuderski
llvmlistbot at llvm.org
Wed Jan 17 21:08:41 PST 2024
================
@@ -875,7 +875,7 @@ def SPIRV_CLPrintfOp : SPIRV_CLOp<"printf", 184, []> {
#### Example:
```mlir
- %0 = spirv.CL.printf %0 %1 %2 : (!spirv.ptr<i8, UniformConstant>, (i32, i32)) -> i32
+ %0 = spirv.CL.printf %0 : !spirv.ptr<i8, UniformConstant>(%1, %2 : i32, i32) -> i32
----------------
kuhar wrote:
This syntax seems unusual to me in the context of the SPIR-V dialect. Why would we prefer it like this?
If we were to update it, I think something like this would be the most canonical form:
```mlir
%x = spirv.CL.printf %0, %1, %2 : !spirv.ptr<i8, UniformConstant>, i32, i32 -> i32
```
BTW, `%0` is redefined in this example
https://github.com/llvm/llvm-project/pull/78510
More information about the Mlir-commits
mailing list