diff --git a/mlir/examples/toy/Ch7/include/toy/Parser.h b/mlir/examples/toy/Ch7/include/toy/Parser.h index bbca92e957fb1f..e6df5581c6f1c4 100644 --- a/mlir/examples/toy/Ch7/include/toy/Parser.h +++ b/mlir/examples/toy/Ch7/include/toy/Parser.h @@ -253,11 +253,11 @@ class Parser { if (args.size() != 1) return parseError("", "as argument to print()"); - return std::make_unique(std::move(loc), std::move(args[0])); + return std::make_unique(loc, std::move(args[0])); } // Call to a user-defined function - return std::make_unique(std::move(loc), std::string(name), + return std::make_unique(loc, std::string(name), std::move(args)); } diff --git a/mlir/include/mlir/ExecutionEngine/MemRefUtils.h b/mlir/include/mlir/ExecutionEngine/MemRefUtils.h index 13778e9af1e72f..6ab2dc1ae3c278 100644 --- a/mlir/include/mlir/ExecutionEngine/MemRefUtils.h +++ b/mlir/include/mlir/ExecutionEngine/MemRefUtils.h @@ -198,7 +198,7 @@ class OwningMemRef { DescriptorType &operator*() { return descriptor; } DescriptorType *operator->() { return &descriptor; } T &operator[](std::initializer_list indices) { - return descriptor[std::move(indices)]; + return descriptor[indices]; } private: diff --git a/mlir/include/mlir/IR/BuiltinAttributeInterfaces.h b/mlir/include/mlir/IR/BuiltinAttributeInterfaces.h index 37635687c4d462..80ff95eca3ca88 100644 --- a/mlir/include/mlir/IR/BuiltinAttributeInterfaces.h +++ b/mlir/include/mlir/IR/BuiltinAttributeInterfaces.h @@ -38,7 +38,7 @@ struct ElementsAttrIndexer { ElementsAttrIndexer(ElementsAttrIndexer &&rhs) : isContiguous(rhs.isContiguous), isSplat(rhs.isSplat) { if (isContiguous) - conState = std::move(rhs.conState); + conState = rhs.conState; else new (&nonConState) NonContiguousState(std::move(rhs.nonConState)); } diff --git a/mlir/include/mlir/IR/BuiltinAttributes.h b/mlir/include/mlir/IR/BuiltinAttributes.h index 0852678888246c..5399718f67582a 100644 --- a/mlir/include/mlir/IR/BuiltinAttributes.h +++ b/mlir/include/mlir/IR/BuiltinAttributes.h @@ -900,8 +900,7 @@ auto SparseElementsAttr::value_begin() const -> iterator { auto valueIt = getValues().value_begin(); const std::vector flatSparseIndices(getFlattenedSparseIndices()); std::function mapFn = - [flatSparseIndices{std::move(flatSparseIndices)}, - valueIt{std::move(valueIt)}, + [flatSparseIndices{flatSparseIndices}, valueIt{std::move(valueIt)}, zeroValue{std::move(zeroValue)}](ptrdiff_t index) { // Try to map the current index to one of the sparse indices. for (unsigned i = 0, e = flatSparseIndices.size(); i != e; ++i) diff --git a/mlir/include/mlir/Support/Timing.h b/mlir/include/mlir/Support/Timing.h index 1fcd8293f3422f..8c48536fe8695b 100644 --- a/mlir/include/mlir/Support/Timing.h +++ b/mlir/include/mlir/Support/Timing.h @@ -228,8 +228,7 @@ class Timer { /// /// The `nameBuilder` function is not guaranteed to be called. Timer nest(const void *id, function_ref nameBuilder) { - return tm ? Timer(*tm, tm->nestTimer(handle, id, std::move(nameBuilder))) - : Timer(); + return tm ? Timer(*tm, tm->nestTimer(handle, id, nameBuilder)) : Timer(); } /// See above. diff --git a/mlir/include/mlir/TableGen/Format.h b/mlir/include/mlir/TableGen/Format.h index 1772a90926ee37..726a8416d03ed1 100644 --- a/mlir/include/mlir/TableGen/Format.h +++ b/mlir/include/mlir/TableGen/Format.h @@ -152,7 +152,7 @@ class FmtObjectBase { FmtObjectBase(const FmtObjectBase &that) = delete; FmtObjectBase(FmtObjectBase &&that) - : fmt(std::move(that.fmt)), context(that.context), + : fmt(that.fmt), context(that.context), adapters(), // adapters are initialized by FmtObject replacements(std::move(that.replacements)) {} diff --git a/mlir/include/mlir/Transforms/DialectConversion.h b/mlir/include/mlir/Transforms/DialectConversion.h index 63892418f4cf4e..e73b3f95b116a0 100644 --- a/mlir/include/mlir/Transforms/DialectConversion.h +++ b/mlir/include/mlir/Transforms/DialectConversion.h @@ -778,7 +778,7 @@ class ConversionTarget { StringRef name, Names... names) { SmallVector dialectNames({name, names...}); setDialectAction(dialectNames, LegalizationAction::Dynamic); - setLegalityCallback(dialectNames, std::move(callback)); + setLegalityCallback(dialectNames, callback); } template void addDynamicallyLegalDialect(DynamicLegalityCallbackFn callback) {