[llvm] 70af83f - [X86] Avoid repeated hash lookups (NFC) (#129360)

via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 1 08:14:20 PST 2025


Author: Kazu Hirata
Date: 2025-03-01T08:14:17-08:00
New Revision: 70af83ff5f87f2b36c5dbbbb050f705ec4389e24

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

LOG: [X86] Avoid repeated hash lookups (NFC) (#129360)

Added: 
    

Modified: 
    llvm/lib/Target/X86/X86LowerAMXType.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/X86/X86LowerAMXType.cpp b/llvm/lib/Target/X86/X86LowerAMXType.cpp
index 2ea78d44d67cf..eacdc8a3f639a 100644
--- a/llvm/lib/Target/X86/X86LowerAMXType.cpp
+++ b/llvm/lib/Target/X86/X86LowerAMXType.cpp
@@ -154,8 +154,8 @@ class ShapeCalculator {
 
 Value *ShapeCalculator::getRowFromCol(Instruction *II, Value *V,
                                       unsigned Granularity) {
-  if (Col2Row.count(V))
-    return Col2Row[V];
+  if (auto It = Col2Row.find(V); It != Col2Row.end())
+    return It->second;
   IRBuilder<> Builder(II);
   Value *RealRow = nullptr;
   if (isa<ConstantInt>(V))


        


More information about the llvm-commits mailing list