diff options
author | Kazu Hirata <kazu@google.com> | 2025-03-08 01:03:13 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-08 01:03:13 -0800 |
commit | 0cffcd3932c5ff6a681026b9d2c482b28be85eba (patch) | |
tree | 513f2efee67f7aa1b8a7d204931ce24f61db9cdc /llvm/lib | |
parent | 49cf69a46b0527eaa7ac2eb1f4be898dd99727ba (diff) | |
download | llvm-0cffcd3932c5ff6a681026b9d2c482b28be85eba.zip llvm-0cffcd3932c5ff6a681026b9d2c482b28be85eba.tar.gz llvm-0cffcd3932c5ff6a681026b9d2c482b28be85eba.tar.bz2 |
[X86] Avoid repeated hash lookups (NFC) (#130393)
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/X86/X86PreTileConfig.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Target/X86/X86PreTileConfig.cpp b/llvm/lib/Target/X86/X86PreTileConfig.cpp index e8d90da..f2ec436 100644 --- a/llvm/lib/Target/X86/X86PreTileConfig.cpp +++ b/llvm/lib/Target/X86/X86PreTileConfig.cpp @@ -400,8 +400,9 @@ bool X86PreTileConfig::runOnMachineFunction(MachineFunction &MF) { // A given point might be forked due to shape conditions are not met. for (MIRef I : InsertPoints) { // Make sure we insert ldtilecfg after the last shape def in MBB. - if (ShapeBBs.count(I.MBB) && I < ShapeBBs[I.MBB].back()) - I = ShapeBBs[I.MBB].back(); + auto It = ShapeBBs.find(I.MBB); + if (It != ShapeBBs.end() && I < It->second.back()) + I = It->second.back(); // There're chances the MBB is sunk more than once. Record it to avoid // multi insert. if (VisitedOrInserted.insert(I).second) { |