Skip to content

Commit 7cf18ff

Browse files
[LLVMIR] Avoid repeated hash lookups (NFC) (llvm#107428)
1 parent b2dbcf4 commit 7cf18ff

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

mlir/lib/Target/LLVMIR/ModuleImport.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,9 +1021,8 @@ ModuleImport::getConstantsToConvert(llvm::Constant *constant) {
10211021
llvm::Constant *current = workList.back();
10221022
// Collect all dependencies of the current constant and add them to the
10231023
// adjacency list if none has been computed before.
1024-
auto adjacencyIt = adjacencyLists.find(current);
1025-
if (adjacencyIt == adjacencyLists.end()) {
1026-
adjacencyIt = adjacencyLists.try_emplace(current).first;
1024+
auto [adjacencyIt, inserted] = adjacencyLists.try_emplace(current);
1025+
if (inserted) {
10271026
// Add all constant operands to the adjacency list and skip any other
10281027
// values such as basic block addresses.
10291028
for (llvm::Value *operand : current->operands())

0 commit comments

Comments
 (0)