aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/InlineCost.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2022-02-28 15:25:03 +0100
committerNikita Popov <npopov@redhat.com>2022-02-28 15:26:22 +0100
commit3c53d3a7338f5c22dd17f9d196fce164c4161ec2 (patch)
tree0b6c5cd0d450a284d8a4252cc04ecf6f3596b0fe /llvm/lib/Analysis/InlineCost.cpp
parent220da125c423b71ce1507df84b75f54d274bc63d (diff)
downloadllvm-3c53d3a7338f5c22dd17f9d196fce164c4161ec2.zip
llvm-3c53d3a7338f5c22dd17f9d196fce164c4161ec2.tar.gz
llvm-3c53d3a7338f5c22dd17f9d196fce164c4161ec2.tar.bz2
[InlineCost] Use SmallPtrSet for DeadBlocks (NFC)
This set is only used with contains operations, so there is no need to use a SetVector.
Diffstat (limited to 'llvm/lib/Analysis/InlineCost.cpp')
-rw-r--r--llvm/lib/Analysis/InlineCost.cpp4
1 files 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<Value *, std::pair<Value *, APInt>> ConstantOffsetPtrs;
/// Keep track of dead blocks due to the constant arguments.
- SetVector<BasicBlock *> DeadBlocks;
+ SmallPtrSet<BasicBlock *, 16> 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))