Skip to content

Commit fc278e4

Browse files
[Scalar] Avoid repeated hash lookups (NFC) (#131961)
1 parent f97a852 commit fc278e4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,13 +1138,12 @@ static Value *findBasePointer(Value *I, DefiningValueMapTy &Cache,
11381138
auto getBaseForInput = [&](Value *Input, Instruction *InsertPt) {
11391139
Value *BDV = findBaseOrBDV(Input, Cache, KnownBases);
11401140
Value *Base = nullptr;
1141-
if (!States.count(BDV)) {
1141+
if (auto It = States.find(BDV); It == States.end()) {
11421142
assert(areBothVectorOrScalar(BDV, Input));
11431143
Base = BDV;
11441144
} else {
11451145
// Either conflict or base.
1146-
assert(States.count(BDV));
1147-
Base = States[BDV].getBaseValue();
1146+
Base = It->second.getBaseValue();
11481147
}
11491148
assert(Base && "Can't be null");
11501149
// The cast is needed since base traversal may strip away bitcasts

0 commit comments

Comments
 (0)