[llvm] 5fdc747 - [AArch64] Replace SmallSet with SmallPtrSet (NFC) (#154264)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 18 22:39:56 PDT 2025
Author: Kazu Hirata
Date: 2025-08-18T22:39:53-07:00
New Revision: 5fdc7478a636ddfdec77e582b36f11c593bb2560
URL: https://github.com/llvm/llvm-project/commit/5fdc7478a636ddfdec77e582b36f11c593bb2560
DIFF: https://github.com/llvm/llvm-project/commit/5fdc7478a636ddfdec77e582b36f11c593bb2560.diff
LOG: [AArch64] Replace SmallSet with SmallPtrSet (NFC) (#154264)
This patch replaces SmallSet<T *, N> with SmallPtrSet<T *, N>. Note
that SmallSet.h "redirects" SmallSet to SmallPtrSet for pointer
element types:
template <typename PointeeType, unsigned N>
class SmallSet<PointeeType*, N> : public SmallPtrSet<PointeeType*, N>
{};
We only have 30 instances that rely on this "redirection". Since the
redirection doesn't improve readability, this patch replaces SmallSet
with SmallPtrSet for pointer element types.
I'm planning to remove the redirection eventually.
Added:
Modified:
llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
index 6a8e7a472bf51..c987a2950f152 100644
--- a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
+++ b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
@@ -7498,7 +7498,7 @@ static bool getGatherLanePattern(MachineInstr &Root,
// limit.
auto MBBItr = Root.getIterator();
unsigned RemainingSteps = GatherOptSearchLimit;
- SmallSet<const MachineInstr *, 16> RemainingLoadInstrs;
+ SmallPtrSet<const MachineInstr *, 16> RemainingLoadInstrs;
RemainingLoadInstrs.insert(LoadInstrs.begin(), LoadInstrs.end());
const MachineBasicBlock *MBB = Root.getParent();
More information about the llvm-commits
mailing list