Skip to content

Conversation

@kazutakahirata
Copy link
Contributor

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Nov 15, 2025

@llvm/pr-subscribers-llvm-transforms

Author: Kazu Hirata (kazutakahirata)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/168217.diff

1 Files Affected:

  • (modified) llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp (+1-2)
diff --git a/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp
index a62804d3ef201..e5399bdd767e2 100644
--- a/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp
+++ b/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp
@@ -1275,8 +1275,7 @@ bool StraightLineStrengthReduce::runOnFunction(Function &F) {
   // Build the dependency graph and sort candidate instructions from dependency
   // roots to leaves
   for (auto &C : Candidates) {
-    if (DependencyGraph.find(C.Ins) == DependencyGraph.end())
-      DependencyGraph[C.Ins] = {};
+    DependencyGraph.try_emplace(C.Ins);
     addDependency(C, C.Basis);
   }
   sortCandidateInstructions();

@kazutakahirata kazutakahirata merged commit e1e696d into llvm:main Nov 16, 2025
12 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20251115_repeated_hash_StraightLine branch November 16, 2025 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants