Skip to content

Commit

Permalink
[ARM] Avoid repeated hash lookups (NFC) (#111935)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazutakahirata authored Oct 11, 2024
1 parent 75774c1 commit eef6c09
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2532,7 +2532,6 @@ ARMPreAllocLoadStoreOpt::RescheduleLoadStoreInstrs(MachineBasicBlock *MBB) {
bool RetVal = false;

DenseMap<MachineInstr *, unsigned> MI2LocMap;
using MapIt = DenseMap<unsigned, SmallVector<MachineInstr *, 4>>::iterator;
using Base2InstMap = DenseMap<unsigned, SmallVector<MachineInstr *, 4>>;
using BaseVec = SmallVector<unsigned, 4>;
Base2InstMap Base2LdsMap;
Expand Down Expand Up @@ -2571,9 +2570,9 @@ ARMPreAllocLoadStoreOpt::RescheduleLoadStoreInstrs(MachineBasicBlock *MBB) {
int Offset = getMemoryOpOffset(MI);
bool StopHere = false;
auto FindBases = [&](Base2InstMap &Base2Ops, BaseVec &Bases) {
MapIt BI = Base2Ops.find(Base);
if (BI == Base2Ops.end()) {
Base2Ops[Base].push_back(&MI);
auto [BI, Inserted] = Base2Ops.try_emplace(Base);
if (Inserted) {
BI->second.push_back(&MI);
Bases.push_back(Base);
return;
}
Expand Down

0 comments on commit eef6c09

Please sign in to comment.