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

Perry Gibson llvmlistbot at llvm.org
Tue Nov 12 10:15:56 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,
----------------
Wheest wrote:

Have done this, and also unified into a single function (no more `mlirValueReplaceAllUsesExceptWithSet` + `mlirValueReplaceAllUsesExceptWithSingle`.

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


More information about the Mlir-commits mailing list