[Mlir-commits] [mlir] b2b63d1 - Reset operation when canceling root update transaction

Yi Zhang llvmlistbot at llvm.org
Wed Sep 22 13:12:47 PDT 2021


Author: Yi Zhang
Date: 2021-09-22T16:05:08-04:00
New Revision: b2b63d1b9122befaf44bf91a3ed1e8a71c6ffe06

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

LOG: Reset operation when canceling root update transaction

Should reset the operation to original state when canceling the updates.

Reviewed By: rriddle, ftynse

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

Added: 
    

Modified: 
    mlir/lib/Transforms/Utils/DialectConversion.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Transforms/Utils/DialectConversion.cpp b/mlir/lib/Transforms/Utils/DialectConversion.cpp
index 4f1c8cfa70c5..a748eb9164f3 100644
--- a/mlir/lib/Transforms/Utils/DialectConversion.cpp
+++ b/mlir/lib/Transforms/Utils/DialectConversion.cpp
@@ -1485,6 +1485,7 @@ void ConversionPatternRewriter::cancelRootUpdate(Operation *op) {
   auto &rootUpdates = impl->rootUpdates;
   auto it = llvm::find_if(llvm::reverse(rootUpdates), stateHasOp);
   assert(it != rootUpdates.rend() && "no root update started on op");
+  (*it).resetOperation();
   int updateIdx = std::prev(rootUpdates.rend()) - it;
   rootUpdates.erase(rootUpdates.begin() + updateIdx);
 }


        


More information about the Mlir-commits mailing list