Skip to content

Commit 00414c3

Browse files
[Hexagon] Avoid repeated hash lookups (NFC) (#129357)
1 parent cc5d8a4 commit 00414c3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Target/Hexagon/HexagonCopyHoisting.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,14 +180,15 @@ bool HexagonCopyHoisting::analyzeCopy(MachineBasicBlock *BB) {
180180
bool IsSafetoMove = true;
181181
for (MachineBasicBlock *SuccBB : BB->successors()) {
182182
auto &SuccBBCopyInst = CopyMIList[SuccBB->getNumber()];
183-
if (!SuccBBCopyInst.count(Key)) {
183+
auto It = SuccBBCopyInst.find(Key);
184+
if (It == SuccBBCopyInst.end()) {
184185
// Same copy not present in this successor
185186
IsSafetoMove = false;
186187
break;
187188
}
188189
// If present, make sure that it's safe to pull this copy instruction
189190
// into the predecessor.
190-
MachineInstr *SuccMI = SuccBBCopyInst[Key];
191+
MachineInstr *SuccMI = It->second;
191192
if (!isSafetoMove(SuccMI)) {
192193
IsSafetoMove = false;
193194
break;

0 commit comments

Comments
 (0)