Apply clang-tidy fixes for performance-move-const-arg in IndexOps.cpp (NFC)
authorMehdi Amini <joker.eph@gmail.com>
Thu, 3 Nov 2022 20:10:11 +0000 (20:10 +0000)
committerMehdi Amini <joker.eph@gmail.com>
Mon, 7 Nov 2022 21:22:56 +0000 (21:22 +0000)
mlir/lib/Dialect/Index/IR/IndexOps.cpp

index 241fa41..2178a75 100644 (file)
@@ -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);
 }
 
 //===----------------------------------------------------------------------===//