Skip to content

Commit 0cffcd3

Browse files
[X86] Avoid repeated hash lookups (NFC) (llvm#130393)
1 parent 49cf69a commit 0cffcd3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Target/X86/X86PreTileConfig.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,9 @@ bool X86PreTileConfig::runOnMachineFunction(MachineFunction &MF) {
400400
// A given point might be forked due to shape conditions are not met.
401401
for (MIRef I : InsertPoints) {
402402
// Make sure we insert ldtilecfg after the last shape def in MBB.
403-
if (ShapeBBs.count(I.MBB) && I < ShapeBBs[I.MBB].back())
404-
I = ShapeBBs[I.MBB].back();
403+
auto It = ShapeBBs.find(I.MBB);
404+
if (It != ShapeBBs.end() && I < It->second.back())
405+
I = It->second.back();
405406
// There're chances the MBB is sunk more than once. Record it to avoid
406407
// multi insert.
407408
if (VisitedOrInserted.insert(I).second) {

0 commit comments

Comments
 (0)