[llvm] 864981d - [NFC][MachineLICM] Use SmallDenseSet instead of SmallSet (#95201)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 12 02:34:57 PDT 2024
Author: Pierre van Houtryve
Date: 2024-06-12T11:34:54+02:00
New Revision: 864981d72b3b4077053479def6a43b5826aea462
URL: https://github.com/llvm/llvm-project/commit/864981d72b3b4077053479def6a43b5826aea462
DIFF: https://github.com/llvm/llvm-project/commit/864981d72b3b4077053479def6a43b5826aea462.diff
LOG: [NFC][MachineLICM] Use SmallDenseSet instead of SmallSet (#95201)
All values are small so no reason to ever use SmallSet really. In large
programs we'll end up using std::set which is extremely slow compared to
DenseSet. This brings a decent speedup to the pass in large programs.
Added:
Modified:
llvm/lib/CodeGen/MachineLICM.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/MachineLICM.cpp b/llvm/lib/CodeGen/MachineLICM.cpp
index edf8988512c78..6c5170e918e00 100644
--- a/llvm/lib/CodeGen/MachineLICM.cpp
+++ b/llvm/lib/CodeGen/MachineLICM.cpp
@@ -155,7 +155,7 @@ namespace {
}
// Track 'estimated' register pressure.
- SmallSet<Register, 32> RegSeen;
+ SmallDenseSet<Register> RegSeen;
SmallVector<unsigned, 8> RegPressure;
// Register pressure "limit" per register pressure set. If the pressure
@@ -224,7 +224,7 @@ namespace {
MachineBasicBlock *CurPreheader);
void ProcessMI(MachineInstr *MI, BitVector &RUDefs, BitVector &RUClobbers,
- SmallSet<int, 32> &StoredFIs,
+ SmallDenseSet<int> &StoredFIs,
SmallVectorImpl<CandidateInfo> &Candidates,
MachineLoop *CurLoop);
@@ -464,7 +464,7 @@ static void applyBitsNotInRegMaskToRegUnitsMask(const TargetRegisterInfo &TRI,
/// gather register def and frame object update information.
void MachineLICMBase::ProcessMI(MachineInstr *MI, BitVector &RUDefs,
BitVector &RUClobbers,
- SmallSet<int, 32> &StoredFIs,
+ SmallDenseSet<int> &StoredFIs,
SmallVectorImpl<CandidateInfo> &Candidates,
MachineLoop *CurLoop) {
bool RuledOut = false;
@@ -568,7 +568,7 @@ void MachineLICMBase::HoistRegionPostRA(MachineLoop *CurLoop,
BitVector RUClobbers(NumRegUnits); // RUs defined more than once.
SmallVector<CandidateInfo, 32> Candidates;
- SmallSet<int, 32> StoredFIs;
+ SmallDenseSet<int> StoredFIs;
// Walk the entire region, count number of defs for each register, and
// collect potential LICM candidates.
More information about the llvm-commits
mailing list