[llvm] f5aad24 - [IROutliner] Avoid repeated hash lookups (NFC) (#107726)

via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 8 00:07:50 PDT 2024


Author: Kazu Hirata
Date: 2024-09-08T00:07:45-07:00
New Revision: f5aad24820fb717be709e424a7344cbc6472c0e5

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

LOG: [IROutliner] Avoid repeated hash lookups (NFC) (#107726)

Added: 
    

Modified: 
    llvm/lib/Transforms/IPO/IROutliner.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/IPO/IROutliner.cpp b/llvm/lib/Transforms/IPO/IROutliner.cpp
index 96c803c0186ef4..aecae7c59afa43 100644
--- a/llvm/lib/Transforms/IPO/IROutliner.cpp
+++ b/llvm/lib/Transforms/IPO/IROutliner.cpp
@@ -1333,11 +1333,10 @@ findExtractedOutputToOverallOutputMapping(Module &M, OutlinableRegion &Region,
       if (!isa<PointerType>(Group.ArgumentTypes[Jdx]))
         continue;
 
-      if (AggArgsUsed.contains(Jdx))
+      if (!AggArgsUsed.insert(Jdx).second)
         continue;
 
       TypeFound = true;
-      AggArgsUsed.insert(Jdx);
       Region.ExtractedArgToAgg.insert(std::make_pair(OriginalIndex, Jdx));
       Region.AggArgToExtracted.insert(std::make_pair(Jdx, OriginalIndex));
       AggArgIdx = Jdx;


        


More information about the llvm-commits mailing list