diff options
author | Kazu Hirata <kazu@google.com> | 2024-12-20 10:28:58 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-20 10:28:58 -0800 |
commit | 0575815b70b486240ace728a33f756cea8fe58fa (patch) | |
tree | 11ee4f1e332689678fdf0a0be4b7bd1573ce8ef6 /llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp | |
parent | 9901906035c2be776674b25a3357b37a7dbbac68 (diff) | |
download | llvm-0575815b70b486240ace728a33f756cea8fe58fa.zip llvm-0575815b70b486240ace728a33f756cea8fe58fa.tar.gz llvm-0575815b70b486240ace728a33f756cea8fe58fa.tar.bz2 |
[TableGen] Avoid repeated hash lookups (NFC) (#120681)
Diffstat (limited to 'llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp')
-rw-r--r-- | llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp index 1a393be..1a61d32 100644 --- a/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp +++ b/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp @@ -3508,9 +3508,8 @@ void CodeGenDAGPatterns::FindPatternInputsAndOutputs( Val->getDef()->isSubClassOf("PointerLikeRegClass")) { if (Dest->getName().empty()) I.error("set destination must have a name!"); - if (InstResults.count(Dest->getName())) + if (!InstResults.insert_or_assign(Dest->getName(), Dest).second) I.error("cannot set '" + Dest->getName() + "' multiple times"); - InstResults[Dest->getName()] = Dest; } else if (Val->getDef()->isSubClassOf("Register")) { InstImpResults.push_back(Val->getDef()); } else { |