Skip to content

Commit 72efb11

Browse files
kazutakahiratafiigii
authored andcommitted
[Scalar] Avoid repeated hash lookups (NFC) (#168217)
1 parent 44f668f commit 72efb11

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,8 +1273,7 @@ bool StraightLineStrengthReduce::runOnFunction(Function &F) {
12731273
// Build the dependency graph and sort candidate instructions from dependency
12741274
// roots to leaves
12751275
for (auto &C : Candidates) {
1276-
if (DependencyGraph.find(C.Ins) == DependencyGraph.end())
1277-
DependencyGraph[C.Ins] = {};
1276+
DependencyGraph.try_emplace(C.Ins);
12781277
addDependency(C, C.Basis);
12791278
}
12801279
sortCandidateInstructions();

0 commit comments

Comments
 (0)