[llvm] 47cbc87 - [Scalar] Avoid repeated hash lookups (NFC) (#135585)

via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 13 21:24:42 PDT 2025


Author: Kazu Hirata
Date: 2025-04-13T21:24:39-07:00
New Revision: 47cbc8706cb5d73f2db101165bf213d558f8b0cb

URL: https://github.com/llvm/llvm-project/commit/47cbc8706cb5d73f2db101165bf213d558f8b0cb
DIFF: https://github.com/llvm/llvm-project/commit/47cbc8706cb5d73f2db101165bf213d558f8b0cb.diff

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

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 22d41be4edb90..f98a693804645 100644
--- a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
+++ b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
@@ -3287,8 +3287,9 @@ static void computeLiveInValues(DominatorTree &DT, Function &F,
   // Seed the liveness for each individual block
   for (BasicBlock &BB : F) {
     Data.KillSet[&BB] = computeKillSet(&BB, GC);
-    Data.LiveSet[&BB].clear();
-    computeLiveInValues(BB.rbegin(), BB.rend(), Data.LiveSet[&BB], GC);
+    auto &LiveSet = Data.LiveSet[&BB];
+    LiveSet.clear();
+    computeLiveInValues(BB.rbegin(), BB.rend(), LiveSet, GC);
 
 #ifndef NDEBUG
     for (Value *Kill : Data.KillSet[&BB])


        


More information about the llvm-commits mailing list