[Mlir-commits] [mlir] bb6119e - Apply clang-tidy fixes for performance-for-range-copy in SCFInterfaceImpl.cpp (NFC)

Mehdi Amini llvmlistbot at llvm.org
Sun Jan 30 11:49:42 PST 2022


Author: Mehdi Amini
Date: 2022-01-30T19:49:22Z
New Revision: bb6119eb77fe5818985d375cef415f9fbc0b4757

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

LOG: Apply clang-tidy fixes for performance-for-range-copy in SCFInterfaceImpl.cpp (NFC)

Added: 
    

Modified: 
    mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp b/mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp
index a622a17080efc..f26f7b9ec890e 100644
--- a/mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp
+++ b/mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp
@@ -95,7 +95,7 @@ struct ExecuteRegionOpInterface
     auto yieldOp = cast<scf::YieldOp>(newBlock->getTerminator());
     rewriter.setInsertionPoint(yieldOp);
     SmallVector<Value> newYieldValues;
-    for (auto it : llvm::enumerate(yieldOp.getResults())) {
+    for (const auto &it : llvm::enumerate(yieldOp.getResults())) {
       Value val = it.value();
       if (val.getType().isa<TensorType>()) {
         newYieldValues.push_back(rewriter.create<bufferization::ToMemrefOp>(
@@ -109,7 +109,7 @@ struct ExecuteRegionOpInterface
     // Update all uses of the old op.
     rewriter.setInsertionPointAfter(newOp);
     SmallVector<Value> newResults;
-    for (auto it : llvm::enumerate(executeRegionOp->getResultTypes())) {
+    for (const auto &it : llvm::enumerate(executeRegionOp->getResultTypes())) {
       if (it.value().isa<TensorType>()) {
         newResults.push_back(rewriter.create<bufferization::ToTensorOp>(
             executeRegionOp.getLoc(), newOp->getResult(it.index())));


        


More information about the Mlir-commits mailing list