From d91460b1401f4d7b0e2e3ecae1238ec9bf5644c2 Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Thu, 3 Nov 2022 20:10:11 +0000 Subject: [PATCH] Apply clang-tidy fixes for performance-move-const-arg in IndexOps.cpp (NFC) --- mlir/lib/Dialect/Index/IR/IndexOps.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mlir/lib/Dialect/Index/IR/IndexOps.cpp b/mlir/lib/Dialect/Index/IR/IndexOps.cpp index 241fa41..2178a75 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); } //===----------------------------------------------------------------------===// -- 2.7.4