aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2025-03-20 09:11:32 -0700
committerGitHub <noreply@github.com>2025-03-20 09:11:32 -0700
commit93507f6c6779d9585e5b2d0eb775354929626757 (patch)
treecbda98d12f6d68e8cc9114781188a3b8bfe224ec
parentbc9cee163c35262efab2805649c0a566ec8951fb (diff)
downloadllvm-93507f6c6779d9585e5b2d0eb775354929626757.zip
llvm-93507f6c6779d9585e5b2d0eb775354929626757.tar.gz
llvm-93507f6c6779d9585e5b2d0eb775354929626757.tar.bz2
[PowerPC] Avoid repeated hash lookups (NFC) (#132145)
-rw-r--r--llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp b/llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp
index 800b96c..26cca52 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.