[llvm] 2f01785 - [NFC][InstCombine] Aggregate reconstruction: use plain map
Roman Lebedev via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 18 15:09:46 PDT 2020
Author: Roman Lebedev
Date: 2020-08-19T01:09:25+03:00
New Revision: 2f0178585722ae289a71cfd81f9ca42235e3aefd
URL: https://github.com/llvm/llvm-project/commit/2f0178585722ae289a71cfd81f9ca42235e3aefd
DIFF: https://github.com/llvm/llvm-project/commit/2f0178585722ae289a71cfd81f9ca42235e3aefd.diff
LOG: [NFC][InstCombine] Aggregate reconstruction: use plain map
Now that we no longer require for this map to have stable iteration order,
we no longer need to pay for keeping the iteration order stable,
so switch from `SmallMapVector` to `SmallDenseMap`.
Added:
Modified:
llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
index adf3643a8514..f6cd3649e677 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
@@ -945,7 +945,7 @@ Instruction *InstCombinerImpl::foldAggregateConstructionIntoAggregateReuse(
// For each predecessor, what is the source aggregate,
// from which all the elements were originally extracted from?
// Note that we want for the map to have stable iteration order!
- SmallMapVector<BasicBlock *, Value *, 4> SourceAggregates;
+ SmallDenseMap<BasicBlock *, Value *, 4> SourceAggregates;
for (BasicBlock *Pred : Preds) {
std::pair<decltype(SourceAggregates)::iterator, bool> IV =
SourceAggregates.insert({Pred, nullptr});
More information about the llvm-commits
mailing list