[Mlir-commits] [mlir] [MLIR][Python] Impl XOpInterface(s) from Python, with X=Transform and X=MemoryEffects (PR #176920)

Rolf Morel llvmlistbot at llvm.org
Fri Jan 30 23:53:30 PST 2026


================
@@ -1044,6 +1049,9 @@ MLIR_CAPI_EXPORTED bool mlirValueIsABlockArgument(MlirValue value);
 /// Returns 1 if the value is an operation result, 0 otherwise.
 MLIR_CAPI_EXPORTED bool mlirValueIsAOpResult(MlirValue value);
 
+/// Cast the value to an OpResult. Asserts if the value is not an op result.
+MLIR_CAPI_EXPORTED MlirOpResult mlirValueToOpResult(MlirValue value);
----------------
rolfmorel wrote:

The docs are actually clear on that this lack of type safety is intentional (whether it's justified is another thing): https://mlir.llvm.org/docs/CAPI/#type-hierarchies

Will change it.

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


More information about the Mlir-commits mailing list