[llvm] d27175d - [Scalar] Avoid repeated hash lookups (NFC) (#135751)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 17 23:03:42 PDT 2025
Author: Kazu Hirata
Date: 2025-04-17T23:03:39-07:00
New Revision: d27175d26e20ebc112b003c877692c06046d195b
URL: https://github.com/llvm/llvm-project/commit/d27175d26e20ebc112b003c877692c06046d195b
DIFF: https://github.com/llvm/llvm-project/commit/d27175d26e20ebc112b003c877692c06046d195b.diff
LOG: [Scalar] Avoid repeated hash lookups (NFC) (#135751)
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 329bd45902242..7eee0283e20e6 100644
--- a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
+++ b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
@@ -3332,10 +3332,10 @@ static void computeLiveInValues(DominatorTree &DT, Function &F,
LiveTmp.set_subtract(Data.KillSet[BB]);
assert(Data.LiveIn.count(BB));
- const SetVector<Value *> &OldLiveIn = Data.LiveIn[BB];
- // assert: OldLiveIn is a subset of LiveTmp
- if (OldLiveIn.size() != LiveTmp.size()) {
- Data.LiveIn[BB] = LiveTmp;
+ SetVector<Value *> &LiveIn = Data.LiveIn[BB];
+ // assert: LiveIn is a subset of LiveTmp
+ if (LiveIn.size() != LiveTmp.size()) {
+ LiveIn = std::move(LiveTmp);
Worklist.insert_range(predecessors(BB));
}
} // while (!Worklist.empty())
More information about the llvm-commits
mailing list