From 686d3f9576df55057706ca44475302c495637255 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Wed, 26 Feb 2025 09:12:49 -0800 Subject: [PATCH] [Support] Avoid repeated hash lookups (NFC) --- llvm/lib/Support/DAGDeltaAlgorithm.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Support/DAGDeltaAlgorithm.cpp b/llvm/lib/Support/DAGDeltaAlgorithm.cpp index 8b23b05913291..48302b8cb0621 100644 --- a/llvm/lib/Support/DAGDeltaAlgorithm.cpp +++ b/llvm/lib/Support/DAGDeltaAlgorithm.cpp @@ -201,8 +201,9 @@ DAGDeltaAlgorithmImpl::DAGDeltaAlgorithmImpl( std::set &ChangeSuccs = SuccClosure[Change]; for (pred_iterator_ty it = pred_begin(Change), ie = pred_end(Change); it != ie; ++it) { - SuccClosure[*it].insert(Change); - SuccClosure[*it].insert(ChangeSuccs.begin(), ChangeSuccs.end()); + auto &SC = SuccClosure[*it]; + SC.insert(Change); + SC.insert(ChangeSuccs.begin(), ChangeSuccs.end()); Worklist.push_back(*it); } }