Skip to content

Commit 8a58f83

Browse files
[X86] Avoid repeated hash lookups (NFC) (#128130)
1 parent 8c1207b commit 8a58f83

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

llvm/lib/Target/X86/X86PreTileConfig.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,10 @@ INITIALIZE_PASS_END(X86PreTileConfig, "tilepreconfig",
234234
void X86PreTileConfig::collectShapeInfo(MachineInstr &MI, unsigned Shapes) {
235235
auto RecordShape = [&](MachineInstr *MI, MachineBasicBlock *MBB) {
236236
MIRef MIR(MI, MBB);
237-
auto I = llvm::lower_bound(ShapeBBs[MBB], MIR);
238-
if (I == ShapeBBs[MBB].end() || *I != MIR)
239-
ShapeBBs[MBB].insert(I, MIR);
237+
auto &Refs = ShapeBBs[MBB];
238+
auto I = llvm::lower_bound(Refs, MIR);
239+
if (I == Refs.end() || *I != MIR)
240+
Refs.insert(I, MIR);
240241
};
241242

242243
// All shapes have same row in multi-tile operand.

0 commit comments

Comments
 (0)