aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/Local.cpp
diff options
context:
space:
mode:
authorRoman Lebedev <lebedev.ri@gmail.com>2021-03-25 22:58:10 +0300
committerRoman Lebedev <lebedev.ri@gmail.com>2021-03-25 23:25:40 +0300
commit1c55dcbca71d2df2fee4564ad53b62505fdbb819 (patch)
treeb45477e3c71480b55cef0aa6e82b80ea968068fa /llvm/lib/Transforms/Utils/Local.cpp
parent93a636d9f6385543a1c77506880a08e10c50792f (diff)
downloadllvm-1c55dcbca71d2df2fee4564ad53b62505fdbb819.zip
llvm-1c55dcbca71d2df2fee4564ad53b62505fdbb819.tar.gz
llvm-1c55dcbca71d2df2fee4564ad53b62505fdbb819.tar.bz2
[NFCI][SimplifyCFG] Don't pay for a Small{Map,Set}Vector when plain SmallSet will suffice
This *only* changes the cases where we *really* don't care about the iteration order of the underlying contained, namely when we will use the values from it to form DTU updates.
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/Local.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index 5b3472c..5eabb10 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -258,7 +258,7 @@ bool llvm::ConstantFoldTerminator(BasicBlock *BB, bool DeleteDeadConditions,
Builder.CreateBr(TheOnlyDest);
BasicBlock *BB = SI->getParent();
- SmallSetVector<BasicBlock *, 8> RemovedSuccessors;
+ SmallSet<BasicBlock *, 8> RemovedSuccessors;
// Remove entries from PHI nodes which we no longer branch to...
BasicBlock *SuccToKeep = TheOnlyDest;
@@ -330,7 +330,7 @@ bool llvm::ConstantFoldTerminator(BasicBlock *BB, bool DeleteDeadConditions,
if (auto *BA =
dyn_cast<BlockAddress>(IBI->getAddress()->stripPointerCasts())) {
BasicBlock *TheOnlyDest = BA->getBasicBlock();
- SmallSetVector<BasicBlock *, 8> RemovedSuccessors;
+ SmallSet<BasicBlock *, 8> RemovedSuccessors;
// Insert the new branch.
Builder.CreateBr(TheOnlyDest);
@@ -2132,7 +2132,7 @@ unsigned llvm::changeToUnreachable(Instruction *I, bool UseLLVMTrap,
if (MSSAU)
MSSAU->changeToUnreachable(I);
- SmallSetVector<BasicBlock *, 8> UniqueSuccessors;
+ SmallSet<BasicBlock *, 8> UniqueSuccessors;
// Loop over all of the successors, removing BB's entry from any PHI
// nodes.
@@ -2393,7 +2393,7 @@ static bool markAliveBlocks(Function &F,
}
};
- SmallMapVector<BasicBlock *, int, 8> NumPerSuccessorCases;
+ SmallDenseMap<BasicBlock *, int, 8> NumPerSuccessorCases;
// Set of unique CatchPads.
SmallDenseMap<CatchPadInst *, detail::DenseSetEmpty, 4,
CatchPadDenseMapInfo, detail::DenseSetPair<CatchPadInst *>>
@@ -2507,7 +2507,7 @@ bool llvm::removeUnreachableBlocks(Function &F, DomTreeUpdater *DTU,
// their internal references. Update DTU if available.
std::vector<DominatorTree::UpdateType> Updates;
for (auto *BB : BlocksToRemove) {
- SmallSetVector<BasicBlock *, 8> UniqueSuccessors;
+ SmallSet<BasicBlock *, 8> UniqueSuccessors;
for (BasicBlock *Successor : successors(BB)) {
// Only remove references to BB in reachable successors of BB.
if (Reachable.count(Successor))