diff --git a/llvm/lib/Analysis/DependenceGraphBuilder.cpp b/llvm/lib/Analysis/DependenceGraphBuilder.cpp index 7ee2adf49ebb4..c076e52ce6e14 100644 --- a/llvm/lib/Analysis/DependenceGraphBuilder.cpp +++ b/llvm/lib/Analysis/DependenceGraphBuilder.cpp @@ -240,9 +240,7 @@ template void AbstractDependenceGraphBuilder::createDefUseEdges() { Instruction *UI = dyn_cast(U); if (!UI) continue; - NodeType *DstNode = nullptr; - if (IMap.find(UI) != IMap.end()) - DstNode = IMap.find(UI)->second; + NodeType *DstNode = IMap.lookup(UI); // In the case of loops, the scope of the subgraph is all the // basic blocks (and instructions within them) belonging to the loop. We