[PATCH] D94218: Fix two pessimizing moves.

Christian Sigg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 7 00:41:02 PST 2021


csigg created this revision.
Herald added subscribers: teijeong, dexonsmith, rdzhabarov, tatianashp, msifontes, jurahul, Kayjukh, grosul1, Joonsoo, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, antiagainst, shauheen, rriddle, mehdi_amini, sanjoy.google.
csigg requested review of this revision.
Herald added subscribers: llvm-commits, stephenneuendorffer, nicolasvasilache.
Herald added projects: MLIR, LLVM.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D94218

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


Index: mlir/include/mlir/Parser.h
===================================================================
--- mlir/include/mlir/Parser.h
+++ mlir/include/mlir/Parser.h
@@ -67,7 +67,7 @@
   // contain the operations inside of it.
   if (failed(op.verify()))
     return OwningOpRef<ContainerOpT>();
-  return std::move(opRef);
+  return opRef;
 }
 } // end namespace detail
 
Index: llvm/include/llvm/Support/TaskQueue.h
===================================================================
--- llvm/include/llvm/Support/TaskQueue.h
+++ llvm/include/llvm/Support/TaskQueue.h
@@ -98,7 +98,7 @@
         IsTaskInFlight = true;
       }
     }
-    return std::move(F);
+    return F;
   }
 
 private:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94218.315064.patch
Type: text/x-patch
Size: 692 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210107/bac15eef/attachment.bin>


More information about the llvm-commits mailing list