[llvm] a0c43be - [TableGen] Avoid repeated hash lookups (NFC) (#107710)

via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 7 11:23:47 PDT 2024


Author: Kazu Hirata
Date: 2024-09-07T11:23:44-07:00
New Revision: a0c43be0e912bca178cec3f00b9f9f7388e9dbef

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

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

Added: 
    

Modified: 
    llvm/utils/TableGen/DXILEmitter.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/utils/TableGen/DXILEmitter.cpp b/llvm/utils/TableGen/DXILEmitter.cpp
index 9cc1b5ccb8acb9..39b4a3ac375ed6 100644
--- a/llvm/utils/TableGen/DXILEmitter.cpp
+++ b/llvm/utils/TableGen/DXILEmitter.cpp
@@ -402,10 +402,8 @@ static void emitDXILOperationTable(std::vector<DXILOperationDesc> &Ops,
   for (auto &Op : Ops) {
     OpStrings.add(Op.OpName);
 
-    if (ClassSet.contains(Op.OpClass))
-      continue;
-    ClassSet.insert(Op.OpClass);
-    OpClassStrings.add(Op.OpClass.data());
+    if (ClassSet.insert(Op.OpClass).second)
+      OpClassStrings.add(Op.OpClass.data());
   }
 
   // Layout names.


        


More information about the llvm-commits mailing list