Op can not convert to mlir::Value

I’ve customized a Dialect to match my custom languages. I followed the official toy tutorial to generate the MLIR. But the operation I defined cannot be converted to a Vaule. I follow the steps of the official tutorial and I want to know what went wrong. Below is a screenshot of my error

Here is the op defined in my TD file.

If the result is optional then this op is probably not implicitly convertible to Value like single result ops (llvm-project/OpDefinition.h at f0d527b28d07f2ce321e7055efb6635a62829eac · llvm/llvm-project · GitHub), so you’d probably have to use use .bit() and dereference explicitly.

1 Like