[Mlir-commits] [mlir] d91460b - Apply clang-tidy fixes for performance-move-const-arg in IndexOps.cpp (NFC)
    Mehdi Amini 
    llvmlistbot at llvm.org
       
    Mon Nov  7 13:23:21 PST 2022
    
    
  
Author: Mehdi Amini
Date: 2022-11-07T21:22:56Z
New Revision: d91460b1401f4d7b0e2e3ecae1238ec9bf5644c2
URL: https://github.com/llvm/llvm-project/commit/d91460b1401f4d7b0e2e3ecae1238ec9bf5644c2
DIFF: https://github.com/llvm/llvm-project/commit/d91460b1401f4d7b0e2e3ecae1238ec9bf5644c2.diff
LOG: Apply clang-tidy fixes for performance-move-const-arg in IndexOps.cpp (NFC)
Added: 
    
Modified: 
    mlir/lib/Dialect/Index/IR/IndexOps.cpp
Removed: 
    
################################################################################
diff  --git a/mlir/lib/Dialect/Index/IR/IndexOps.cpp b/mlir/lib/Dialect/Index/IR/IndexOps.cpp
index 241fa416eddab..2178a758b3dc2 100644
--- a/mlir/lib/Dialect/Index/IR/IndexOps.cpp
+++ b/mlir/lib/Dialect/Index/IR/IndexOps.cpp
@@ -74,7 +74,7 @@ static OpFoldResult foldBinaryOpUnchecked(
     return {};
   assert(result->trunc(32) ==
          calculate(lhs.getValue().trunc(32), rhs.getValue().trunc(32)));
-  return IntegerAttr::get(IndexType::get(lhs.getContext()), std::move(*result));
+  return IntegerAttr::get(IndexType::get(lhs.getContext()), *result);
 }
 
 /// Fold an index operation only if the truncated 64-bit result matches the
@@ -107,8 +107,7 @@ static OpFoldResult foldBinaryOpChecked(
   if (result64->trunc(32) != *result32)
     return {};
   // The operation can be folded for these particular operands.
-  return IntegerAttr::get(IndexType::get(lhs.getContext()),
-                          std::move(*result64));
+  return IntegerAttr::get(IndexType::get(lhs.getContext()), *result64);
 }
 
 //===----------------------------------------------------------------------===//
        
    
    
More information about the Mlir-commits
mailing list