From 9dee6c4170bbc2875a2c329489d6b7746e775d87 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Wed, 19 Mar 2025 08:00:04 -0700 Subject: [PATCH] [PowerPC] Avoid repeated hash lookups (NFC) --- llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp b/llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp index 800b96c45aecc..26cca52c2c480 100644 --- a/llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp +++ b/llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp @@ -936,9 +936,9 @@ bool PPCLoopInstrFormPrep::prepareBaseForDispFormChain(Bucket &BucketChain, // 1 X form. unsigned MaxCountRemainder = 0; for (unsigned j = 0; j < (unsigned)Form; j++) - if ((RemainderOffsetInfo.contains(j)) && - RemainderOffsetInfo[j].second > - RemainderOffsetInfo[MaxCountRemainder].second) + if (auto It = RemainderOffsetInfo.find(j); + It != RemainderOffsetInfo.end() && + It->second.second > RemainderOffsetInfo[MaxCountRemainder].second) MaxCountRemainder = j; // Abort when there are too few insts with common base.