[llvm] r243616 - [LoopVer] Add missing std::move

Adam Nemet anemet at apple.com
Wed Jul 29 21:21:13 PDT 2015


Author: anemet
Date: Wed Jul 29 23:21:13 2015
New Revision: 243616

URL: http://llvm.org/viewvc/llvm-project?rev=243616&view=rev
Log:
[LoopVer] Add missing std::move

The reason I was passing this vector by value in the constructor so that
I wouldn't have to copy when initializing the corresponding member but
then I forgot the std::move.

The use-case is LoopDistribution which filters the checks then
std::moves it to LoopVersioning's constructor.  With this interface we
can avoid any copies.

Modified:
    llvm/trunk/lib/Transforms/Utils/LoopVersioning.cpp

Modified: llvm/trunk/lib/Transforms/Utils/LoopVersioning.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LoopVersioning.cpp?rev=243616&r1=243615&r2=243616&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/LoopVersioning.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/LoopVersioning.cpp Wed Jul 29 23:21:13 2015
@@ -27,7 +27,8 @@ LoopVersioning::LoopVersioning(
     const LoopAccessInfo &LAI, Loop *L, LoopInfo *LI, DominatorTree *DT,
     const SmallVector<int, 8> *PtrToPartition)
     : VersionedLoop(L), NonVersionedLoop(nullptr),
-      PtrToPartition(PtrToPartition), Checks(Checks), LAI(LAI), LI(LI), DT(DT) {
+      PtrToPartition(PtrToPartition), Checks(std::move(Checks)), LAI(LAI),
+      LI(LI), DT(DT) {
   assert(L->getExitBlock() && "No single exit block");
   assert(L->getLoopPreheader() && "No preheader");
 }





More information about the llvm-commits mailing list