aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2025-03-08 01:03:13 -0800
committerGitHub <noreply@github.com>2025-03-08 01:03:13 -0800
commit0cffcd3932c5ff6a681026b9d2c482b28be85eba (patch)
tree513f2efee67f7aa1b8a7d204931ce24f61db9cdc /llvm/lib
parent49cf69a46b0527eaa7ac2eb1f4be898dd99727ba (diff)
downloadllvm-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.cpp5
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) {