Skip to content

Commit dbe8122

Browse files
[TableGen] Avoid repeated hash lookups (NFC) (llvm#126344)
1 parent 1c497c4 commit dbe8122

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/utils/TableGen/X86InstrMappingEmitter.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,9 @@ void X86InstrMappingEmitter::emitCompressEVEXTable(
228228
// For each pre-compression instruction look for a match in the
229229
// appropriate vector (instructions with the same opcode) using function
230230
// object IsMatch.
231-
auto Match = llvm::find_if(CompressedInsts[Opcode], IsMatch(Inst));
232-
if (Match != CompressedInsts[Opcode].end())
231+
const auto &Insts = CompressedInsts[Opcode];
232+
auto Match = llvm::find_if(Insts, IsMatch(Inst));
233+
if (Match != Insts.end())
233234
NewInst = *Match;
234235
}
235236

0 commit comments

Comments
 (0)