RegAlloc: Use SmallSet instead of std::set
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Sat, 23 Jul 2022 23:58:24 +0000 (19:58 -0400)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 12 Sep 2022 11:55:10 +0000 (07:55 -0400)
There shouldn't be more than a small handful of hints at most.

llvm/lib/CodeGen/CalcSpillWeights.cpp

index 519b24c..fb8f350 100644 (file)
@@ -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))