[Mlir-commits] [mlir] [mlir, python] Expose replaceAllUsesExcept to Python bindings (PR #115850)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Tue Nov 12 09:49:46 PST 2024


================
@@ -956,6 +956,22 @@ MLIR_CAPI_EXPORTED MlirOpOperand mlirValueGetFirstUse(MlirValue value);
 MLIR_CAPI_EXPORTED void mlirValueReplaceAllUsesOfWith(MlirValue of,
                                                       MlirValue with);
 
+/// Replace all uses of 'of' value with 'with' value, updating anything in the
+/// IR that uses 'of' to use 'with' instead, except if the user is listed in
+/// 'exceptions'. The 'exceptions' parameter is an array of MlirOperation
+/// pointers with a length of 'numExceptions'.
+MLIR_CAPI_EXPORTED void
+mlirValueReplaceAllUsesExceptWithSet(MlirValue of, MlirValue with,
+                                     MlirOperation *exceptions,
+                                     intptr_t numExceptions);
----------------
ftynse wrote:

We systematically put the number of elements in the list _before_ the list.

```suggestion
                                     intptr_t numExceptions,
                                     MlirOperation *exceptions);
```

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


More information about the Mlir-commits mailing list