Skip to content

Commit

Permalink
[Target] Use llvm::replace (NFC) (llvm#105942)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazutakahirata authored and dmpolukhin committed Sep 2, 2024
1 parent 286e1e7 commit 186f814
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
4 changes: 1 addition & 3 deletions llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2517,9 +2517,7 @@ static void updateRegisterMapForDbgValueListAfterMove(
if (RegIt == RegisterMap.end())
return;
auto &InstrVec = RegIt->getSecond();
for (unsigned I = 0; I < InstrVec.size(); I++)
if (InstrVec[I] == InstrToReplace)
InstrVec[I] = DbgValueListInstr;
llvm::replace(InstrVec, InstrToReplace, DbgValueListInstr);
});
}

Expand Down
5 changes: 1 addition & 4 deletions llvm/lib/Target/Hexagon/HexagonISelDAGToDAGHVX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2002,10 +2002,7 @@ SmallVector<uint32_t, 8> HvxSelector::getPerfectCompletions(ShuffleMask SM,
if ((unsigned)llvm::popcount(P) < Count) {
// Reset all occurences of P, if there are more occurrences of P
// than there are bits in P.
for (unsigned &Q : Worklist) {
if (Q == P)
Q = 0;
}
llvm::replace(Worklist, P, 0U);
}
}

Expand Down
4 changes: 1 addition & 3 deletions llvm/lib/Target/X86/X86ISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35781,9 +35781,7 @@ X86TargetLowering::EmitLoweredIndirectThunk(MachineInstr &MI,
// Zero out any registers that are already used.
for (const auto &MO : MI.operands()) {
if (MO.isReg() && MO.isUse())
for (unsigned &Reg : AvailableRegs)
if (Reg == MO.getReg())
Reg = 0;
llvm::replace(AvailableRegs, static_cast<unsigned>(MO.getReg()), 0U);
}

// Choose the first remaining non-zero available register.
Expand Down

0 comments on commit 186f814

Please sign in to comment.