[Mlir-commits] [mlir] 2fe625e - Fix two pessimizing moves.

Christian Sigg llvmlistbot at llvm.org
Fri Jan 8 02:44:42 PST 2021


Author: Christian Sigg
Date: 2021-01-08T11:44:29+01:00
New Revision: 2fe625e9abd037b8721977e9736c822ef872487f

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

LOG: Fix two pessimizing moves.

See https://en.cppreference.com/w/cpp/language/return#Automatic_move_from_local_variables_and_parameters

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D94218

Added: 
    

Modified: 
    llvm/include/llvm/Support/TaskQueue.h
    mlir/include/mlir/Parser.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Support/TaskQueue.h b/llvm/include/llvm/Support/TaskQueue.h
index 4ceb056391af..6901a550b62f 100644
--- a/llvm/include/llvm/Support/TaskQueue.h
+++ b/llvm/include/llvm/Support/TaskQueue.h
@@ -98,7 +98,7 @@ class TaskQueue {
         IsTaskInFlight = true;
       }
     }
-    return std::move(F);
+    return F;
   }
 
 private:

diff  --git a/mlir/include/mlir/Parser.h b/mlir/include/mlir/Parser.h
index b9e4d170a044..cec60474d23d 100644
--- a/mlir/include/mlir/Parser.h
+++ b/mlir/include/mlir/Parser.h
@@ -67,7 +67,7 @@ inline OwningOpRef<ContainerOpT> constructContainerOpForParserIfNecessary(
   // contain the operations inside of it.
   if (failed(op.verify()))
     return OwningOpRef<ContainerOpT>();
-  return std::move(opRef);
+  return opRef;
 }
 } // end namespace detail
 


        


More information about the Mlir-commits mailing list