[Mlir-commits] [mlir] [MLIR] emitc: Add fmtArgs to verbatim (PR #123294)

Simon Camphausen llvmlistbot at llvm.org
Thu Jan 30 04:59:30 PST 2025


simon-camp wrote:

I have two high level questions before reviewing in detail.

Can you show a case on how you intend to use this feature. It looks like this can be used (and abused) to do all kinds of side effecting operations to MLIR values, and I'm not sure how this interacts with the whole system.

```mlir
emitc.verbatim "{}++;" args %arg0 : i32
```

I'm not directly against it, but I think discussions about it might be helpful.

For the generalization of opaque types; Do you use it for other things than templated types? I have considered having a template type like `!emitc.template<"std::vector", [i32]>`. This would be more structured than string formatting, but maybe it is too limiting for your use cases.

If we agree to land this, can we somehow back the formatting on [llvm utilities](https://llvm.org/docs/ProgrammersManual.html#formatting-strings-the-formatv-function)?

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


More information about the Mlir-commits mailing list