[llvm] r334343 - Use SmallPtrSet instead of SmallSet in places where we iterate over the set.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 8 22:04:20 PDT 2018
Author: ctopper
Date: Fri Jun 8 22:04:20 2018
New Revision: 334343
URL: http://llvm.org/viewvc/llvm-project?rev=334343&view=rev
Log:
Use SmallPtrSet instead of SmallSet in places where we iterate over the set.
SmallSet forwards to SmallPtrSet for pointer types. SmallPtrSet supports iteration, but a normal SmallSet doesn't. So if it wasn't for the forwarding, this wouldn't work.
These places were found by hiding the begin/end methods in the SmallSet forwarding
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/trunk/lib/Transforms/Scalar/LoopRerollPass.cpp
llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp
llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/trunk/lib/Transforms/Vectorize/VPlan.h
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=334343&r1=334342&r2=334343&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Fri Jun 8 22:04:20 2018
@@ -5357,7 +5357,7 @@ SDValue DAGCombiner::MatchLoadCombine(SD
Optional<BaseIndexOffset> Base;
SDValue Chain;
- SmallSet<LoadSDNode *, 8> Loads;
+ SmallPtrSet<LoadSDNode *, 8> Loads;
Optional<ByteProvider> FirstByteProvider;
int64_t FirstOffset = INT64_MAX;
Modified: llvm/trunk/lib/Transforms/Scalar/LoopRerollPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopRerollPass.cpp?rev=334343&r1=334342&r2=334343&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopRerollPass.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopRerollPass.cpp Fri Jun 8 22:04:20 2018
@@ -189,7 +189,7 @@ namespace {
bool PreserveLCSSA;
using SmallInstructionVector = SmallVector<Instruction *, 16>;
- using SmallInstructionSet = SmallSet<Instruction *, 16>;
+ using SmallInstructionSet = SmallPtrSet<Instruction *, 16>;
// Map between induction variable and its increment
DenseMap<Instruction *, int64_t> IVToIncMap;
Modified: llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp?rev=334343&r1=334342&r2=334343&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp Fri Jun 8 22:04:20 2018
@@ -5710,7 +5710,7 @@ static bool TryToMergeLandingPad(Landing
// We've found an identical block. Update our predecessors to take that
// path instead and make ourselves dead.
- SmallSet<BasicBlock *, 16> Preds;
+ SmallPtrSet<BasicBlock *, 16> Preds;
Preds.insert(pred_begin(BB), pred_end(BB));
for (BasicBlock *Pred : Preds) {
InvokeInst *II = cast<InvokeInst>(Pred->getTerminator());
@@ -5728,7 +5728,7 @@ static bool TryToMergeLandingPad(Landing
Inst.eraseFromParent();
}
- SmallSet<BasicBlock *, 16> Succs;
+ SmallPtrSet<BasicBlock *, 16> Succs;
Succs.insert(succ_begin(BB), succ_end(BB));
for (BasicBlock *Succ : Succs) {
Succ->removePredecessor(BB);
Modified: llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp?rev=334343&r1=334342&r2=334343&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp Fri Jun 8 22:04:20 2018
@@ -958,7 +958,7 @@ public:
: PSE(PSE), TheLoop(L), DT(DT), LI(LI), LAI(LAI) {}
~InterleavedAccessInfo() {
- SmallSet<InterleaveGroup *, 4> DelSet;
+ SmallPtrSet<InterleaveGroup *, 4> DelSet;
// Avoid releasing a pointer twice.
for (auto &I : InterleaveGroupMap)
DelSet.insert(I.second);
@@ -5345,7 +5345,7 @@ LoopVectorizationCostModel::calculateReg
for (auto &Interval : EndPoint)
TransposeEnds[Interval.second].push_back(Interval.first);
- SmallSet<Instruction *, 8> OpenIntervals;
+ SmallPtrSet<Instruction *, 8> OpenIntervals;
// Get the size of the widest register.
unsigned MaxSafeDepDist = -1U;
Modified: llvm/trunk/lib/Transforms/Vectorize/VPlan.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/VPlan.h?rev=334343&r1=334342&r2=334343&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/VPlan.h (original)
+++ llvm/trunk/lib/Transforms/Vectorize/VPlan.h Fri Jun 8 22:04:20 2018
@@ -1053,7 +1053,7 @@ private:
// VPlan. External definitions must be immutable and hold a pointer to its
// underlying IR that will be used to implement its structural comparison
// (operators '==' and '<').
- SmallSet<VPValue *, 16> VPExternalDefs;
+ SmallPtrSet<VPValue *, 16> VPExternalDefs;
/// Holds a mapping between Values and their corresponding VPValue inside
/// VPlan.
More information about the llvm-commits
mailing list