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

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Tue May 6 00:17:37 PDT 2025


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/138645

None

>From 1d1113fa6c4e1f5fd2b2a7a4e6d9c3ab19e60f5e Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Tue, 6 May 2025 00:12:49 -0700
Subject: [PATCH] [Transforms] Use SmallMapVector::contains (NFC)

---
 llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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