From 6a68177c1a4691e7ba9a07af7657fbc97c16b4bc Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Thu, 6 Feb 2025 16:14:15 -0800 Subject: [PATCH] [TableGen] Avoid repeated hash lookups (NFC) --- llvm/utils/TableGen/AsmWriterEmitter.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/llvm/utils/TableGen/AsmWriterEmitter.cpp b/llvm/utils/TableGen/AsmWriterEmitter.cpp index e7606b9df4626..795185c677e30 100644 --- a/llvm/utils/TableGen/AsmWriterEmitter.cpp +++ b/llvm/utils/TableGen/AsmWriterEmitter.cpp @@ -967,12 +967,11 @@ void AsmWriterEmitter::EmitPrintAliasInstruction(raw_ostream &O) { IAP.addOperand(ROName, MIOpNum, PrintMethodIdx); // There might be an additional predicate on the MCOperand - unsigned Entry = MCOpPredicateMap[Rec]; + unsigned &Entry = MCOpPredicateMap[Rec]; if (!Entry) { if (!Rec->isValueUnset("MCOperandPredicate")) { MCOpPredicates.push_back(Rec); Entry = MCOpPredicates.size(); - MCOpPredicateMap[Rec] = Entry; } else break; // No conditions on this operand at all }