[llvm] [Scalar] Use std::move (NFC) (PR #136264)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 18 01:23:37 PDT 2025


================
@@ -3327,7 +3327,7 @@ static void computeLiveInValues(DominatorTree &DT, Function &F,
     Data.LiveOut[BB] = LiveOut;
 
     // Apply the effects of this basic block
-    SetVector<Value *> LiveTmp = LiveOut;
+    SetVector<Value *> LiveTmp = std::move(LiveOut);
----------------
nikic wrote:

If I'm reading the code above right, we're first copying `Data.LiveOut[BB]` into `LiveOut`, then we're updating `LiveOut`, and then we copy back into `Data.LiveOut[BB]`. Wouldn't it make more sense to make `LiveOut` a reference? In that case this one here would stay a copy.

https://github.com/llvm/llvm-project/pull/136264


More information about the llvm-commits mailing list