From 3c53d3a7338f5c22dd17f9d196fce164c4161ec2 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 28 Feb 2022 15:25:03 +0100 Subject: [PATCH] [InlineCost] Use SmallPtrSet for DeadBlocks (NFC) This set is only used with contains operations, so there is no need to use a SetVector. --- llvm/lib/Analysis/InlineCost.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp index 2a1a976..25cb242 100644 --- a/llvm/lib/Analysis/InlineCost.cpp +++ b/llvm/lib/Analysis/InlineCost.cpp @@ -352,7 +352,7 @@ protected: DenseMap> ConstantOffsetPtrs; /// Keep track of dead blocks due to the constant arguments. - SetVector DeadBlocks; + SmallPtrSet DeadBlocks; /// The mapping of the blocks to their known unique successors due to the /// constant arguments. @@ -2552,7 +2552,7 @@ void CallAnalyzer::findDeadBlocks(BasicBlock *CurrBB, BasicBlock *NextBB) { NewDead.push_back(Succ); while (!NewDead.empty()) { BasicBlock *Dead = NewDead.pop_back_val(); - if (DeadBlocks.insert(Dead)) + if (DeadBlocks.insert(Dead).second) // Continue growing the dead block lists. for (BasicBlock *S : successors(Dead)) if (IsNewlyDead(S)) -- 2.7.4