[Mlir-commits] [mlir] 3bab7cb - [MLIR][python bindings][fix] implement `replace_all_uses_with` on `PyValue`

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Apr 24 09:17:32 PDT 2023


Author: max
Date: 2023-04-24T11:17:08-05:00
New Revision: 3bab7cb089d92cc7025ebc57ef3a74d3ce94ecd8

URL: https://github.com/llvm/llvm-project/commit/3bab7cb089d92cc7025ebc57ef3a74d3ce94ecd8
DIFF: https://github.com/llvm/llvm-project/commit/3bab7cb089d92cc7025ebc57ef3a74d3ce94ecd8.diff

LOG: [MLIR][python bindings][fix] implement `replace_all_uses_with` on `PyValue`

Differential Revision: https://reviews.llvm.org/D148816

Added: 
    

Modified: 
    mlir/test/CAPI/ir.c

Removed: 
    


################################################################################
diff  --git a/mlir/test/CAPI/ir.c b/mlir/test/CAPI/ir.c
index b816936c9a139..bcde60ae1a41d 100644
--- a/mlir/test/CAPI/ir.c
+++ b/mlir/test/CAPI/ir.c
@@ -1860,7 +1860,7 @@ int testOperands(void) {
       mlirOperationStateGet(mlirStringRefCreateFromCString("dummy.op2"), loc);
   MlirValue initialOperands2[] = {constOneValue};
   mlirOperationStateAddOperands(&op2State, 1, initialOperands2);
-  (void)mlirOperationCreate(&op2State);
+  MlirOperation op2 = mlirOperationCreate(&op2State);
 
   MlirOpOperand use3 = mlirValueGetFirstUse(constOneValue);
   fprintf(stderr, "First use owner: ");
@@ -1896,6 +1896,7 @@ int testOperands(void) {
   // CHECK: Second replacement use owner: "dummy.op2"
 
   mlirOperationDestroy(op);
+  mlirOperationDestroy(op2);
   mlirOperationDestroy(mlirOpResultGetOwner(constZeroValue));
   mlirOperationDestroy(mlirOpResultGetOwner(constOneValue));
   mlirOperationDestroy(mlirOpResultGetOwner(constTwoValue));
@@ -1913,7 +1914,6 @@ int testClone(void) {
   registerAllUpstreamDialects(ctx);
 
   mlirContextGetOrLoadDialect(ctx, mlirStringRefCreateFromCString("func"));
-  MlirLocation loc = mlirLocationUnknownGet(ctx);
   MlirStringRef valueStringRef = mlirStringRefCreateFromCString("value");
 
   MlirValue constZeroValue = makeConstantLiteral(ctx, "0", "index");


        


More information about the Mlir-commits mailing list