Skip to content

Commit e1e696d

Browse files
[Scalar] Avoid repeated hash lookups (NFC) (#168217)
1 parent ea0ecd6 commit e1e696d

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
@@ -1275,8 +1275,7 @@ bool StraightLineStrengthReduce::runOnFunction(Function &F) {
12751275
// Build the dependency graph and sort candidate instructions from dependency
12761276
// roots to leaves
12771277
for (auto &C : Candidates) {
1278-
if (DependencyGraph.find(C.Ins) == DependencyGraph.end())
1279-
DependencyGraph[C.Ins] = {};
1278+
DependencyGraph.try_emplace(C.Ins);
12801279
addDependency(C, C.Basis);
12811280
}
12821281
sortCandidateInstructions();

0 commit comments

Comments
 (0)