Skip to content

Commit 3ce96b9

Browse files
[Analysis] Avoid repeated hash lookups (NFC) (#126402)
1 parent d204724 commit 3ce96b9

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

llvm/lib/Analysis/DependenceGraphBuilder.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,7 @@ template <class G> void AbstractDependenceGraphBuilder<G>::createDefUseEdges() {
240240
Instruction *UI = dyn_cast<Instruction>(U);
241241
if (!UI)
242242
continue;
243-
NodeType *DstNode = nullptr;
244-
if (IMap.find(UI) != IMap.end())
245-
DstNode = IMap.find(UI)->second;
243+
NodeType *DstNode = IMap.lookup(UI);
246244

247245
// In the case of loops, the scope of the subgraph is all the
248246
// basic blocks (and instructions within them) belonging to the loop. We

0 commit comments

Comments
 (0)