[llvm] 6c44a71 - RegAlloc: Use SmallSet instead of std::set

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 12 05:15:13 PDT 2022


Author: Matt Arsenault
Date: 2022-09-12T07:55:10-04:00
New Revision: 6c44a7179f1747ec38d580e6b50bde98555ad811

URL: https://github.com/llvm/llvm-project/commit/6c44a7179f1747ec38d580e6b50bde98555ad811
DIFF: https://github.com/llvm/llvm-project/commit/6c44a7179f1747ec38d580e6b50bde98555ad811.diff

LOG: RegAlloc: Use SmallSet instead of std::set

There shouldn't be more than a small handful of hints at most.

Added: 
    

Modified: 
    llvm/lib/CodeGen/CalcSpillWeights.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/CalcSpillWeights.cpp b/llvm/lib/CodeGen/CalcSpillWeights.cpp
index 519b24c21d7a..fb8f350fa06d 100644
--- a/llvm/lib/CodeGen/CalcSpillWeights.cpp
+++ b/llvm/lib/CodeGen/CalcSpillWeights.cpp
@@ -278,7 +278,7 @@ float VirtRegAuxInfo::weightCalcHelper(LiveInterval &LI, SlotIndex *Start,
     if (TargetHint.first == 0 && TargetHint.second)
       MRI.clearSimpleHint(LI.reg());
 
-    std::set<Register> HintedRegs;
+    SmallSet<Register, 4> HintedRegs;
     for (const auto &Hint : CopyHints) {
       if (!HintedRegs.insert(Hint.Reg).second ||
           (TargetHint.first != 0 && Hint.Reg == TargetHint.second))


        


More information about the llvm-commits mailing list