[llvm] 77fcdb9 - [Scalar] Avoid repeated hash lookups (NFC) (#132660)

via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 13 04:35:24 PDT 2025


Author: Kazu Hirata
Date: 2025-04-13T04:35:20-07:00
New Revision: 77fcdb9f26d2d9da04767894b23b71e52e5ac7ce

URL: https://github.com/llvm/llvm-project/commit/77fcdb9f26d2d9da04767894b23b71e52e5ac7ce
DIFF: https://github.com/llvm/llvm-project/commit/77fcdb9f26d2d9da04767894b23b71e52e5ac7ce.diff

LOG: [Scalar] Avoid repeated hash lookups (NFC) (#132660)

Added: 
    

Modified: 
    llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
index 2f5cf45a1d3d8..22d41be4edb90 100644
--- a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
+++ b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
@@ -3295,12 +3295,12 @@ static void computeLiveInValues(DominatorTree &DT, Function &F,
       assert(!Data.LiveSet[&BB].count(Kill) && "live set contains kill");
 #endif
 
-    Data.LiveOut[&BB] = SetVector<Value *>();
-    computeLiveOutSeed(&BB, Data.LiveOut[&BB], GC);
-    Data.LiveIn[&BB] = Data.LiveSet[&BB];
-    Data.LiveIn[&BB].set_union(Data.LiveOut[&BB]);
-    Data.LiveIn[&BB].set_subtract(Data.KillSet[&BB]);
-    if (!Data.LiveIn[&BB].empty())
+    auto &Out = Data.LiveOut[&BB] = SetVector<Value *>();
+    computeLiveOutSeed(&BB, Out, GC);
+    auto &In = Data.LiveIn[&BB] = Data.LiveSet[&BB];
+    In.set_union(Out);
+    In.set_subtract(Data.KillSet[&BB]);
+    if (!In.empty())
       Worklist.insert_range(predecessors(&BB));
   }
 


        


More information about the llvm-commits mailing list