[llvm] 0afbefa - [TableGen] Avoid repeated hash lookups (NFC) (#126190)

via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 7 08:00:26 PST 2025


Author: Kazu Hirata
Date: 2025-02-07T08:00:21-08:00
New Revision: 0afbefa282add55ca2dc2389e6b75b864b37c196

URL: https://github.com/llvm/llvm-project/commit/0afbefa282add55ca2dc2389e6b75b864b37c196
DIFF: https://github.com/llvm/llvm-project/commit/0afbefa282add55ca2dc2389e6b75b864b37c196.diff

LOG: [TableGen] Avoid repeated hash lookups (NFC) (#126190)

Added: 
    

Modified: 
    llvm/utils/TableGen/AsmWriterEmitter.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/utils/TableGen/AsmWriterEmitter.cpp b/llvm/utils/TableGen/AsmWriterEmitter.cpp
index e7606b9df4626b1..795185c677e3020 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
             }


        


More information about the llvm-commits mailing list