Skip to content

Commit d50d961

Browse files
[MCA] Avoid repeated hash lookups (NFC) (#110622)
1 parent 0089f39 commit d50d961

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/MCA/InstrBuilder.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -665,8 +665,9 @@ InstrBuilder::getOrCreateInstrDesc(const MCInst &MCI,
665665
SchedClassID = *VariantSchedClassIDOrErr;
666666

667667
auto VDKey = std::make_pair(hashMCInst(MCI), SchedClassID);
668-
if (VariantDescriptors.contains(VDKey))
669-
return *VariantDescriptors[VDKey];
668+
auto It = VariantDescriptors.find(VDKey);
669+
if (It != VariantDescriptors.end())
670+
return *It->second;
670671

671672
return createInstrDescImpl(MCI, IVec);
672673
}

0 commit comments

Comments
 (0)