[llvm] 0eeabd4 - [Transforms] Use SmallMapVector::contains (NFC) (#138645)

via llvm-commits llvm-commits at lists.llvm.org
Tue May 6 07:56:11 PDT 2025


Author: Kazu Hirata
Date: 2025-05-06T07:56:08-07:00
New Revision: 0eeabd4b302cf52c4a585664ed9bc4a81ef91105

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

LOG: [Transforms] Use SmallMapVector::contains (NFC) (#138645)

Added: 
    

Modified: 
    llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 2dca2b322ee82..19b46c7eb8b52 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -5035,7 +5035,7 @@ LoopVectorizationCostModel::selectInterleaveCount(VPlan &Plan, ElementCount VF,
     }
     unsigned MaxLocalUsers = Pair.second;
     unsigned LoopInvariantRegs = 0;
-    if (R.LoopInvariantRegs.find(Pair.first) != R.LoopInvariantRegs.end())
+    if (R.LoopInvariantRegs.contains(Pair.first))
       LoopInvariantRegs = R.LoopInvariantRegs[Pair.first];
 
     unsigned TmpIC = llvm::bit_floor((TargetNumRegisters - LoopInvariantRegs) /


        


More information about the llvm-commits mailing list