diff options
author | Florian Hahn <florian.hahn@arm.com> | 2018-06-12 11:16:56 +0000 |
---|---|---|
committer | Florian Hahn <florian.hahn@arm.com> | 2018-06-12 11:16:56 +0000 |
commit | a1cc848399f1a5196659038ec07a8da8fb37ee6b (patch) | |
tree | d99790e13d6a1dd9e93e3092396eacdd205dd253 /llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp | |
parent | 74fb5e678982ea7e09da5dc19866ff24979d1e20 (diff) | |
download | bcm5719-llvm-a1cc848399f1a5196659038ec07a8da8fb37ee6b.tar.gz bcm5719-llvm-a1cc848399f1a5196659038ec07a8da8fb37ee6b.zip |
Use SmallPtrSet explicitly for SmallSets with pointer types (NFC).
Currently SmallSet<PointerTy> inherits from SmallPtrSet<PointerTy>. This
patch replaces such types with SmallPtrSet, because IMO it is slightly
clearer and allows us to get rid of unnecessarily including SmallSet.h
Reviewers: dblaikie, craig.topper
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D47836
llvm-svn: 334492
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp b/llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp index 7f882191d1f..19bd9ebcc15 100644 --- a/llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp +++ b/llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp @@ -25,7 +25,7 @@ #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/DepthFirstIterator.h" #include "llvm/ADT/STLExtras.h" -#include "llvm/ADT/SmallSet.h" +#include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Statistic.h" #include "llvm/Analysis/AliasAnalysis.h" @@ -179,7 +179,7 @@ public: // forward and backward dependences qualify. Disqualify loads that have // other unknown dependences. - SmallSet<Instruction *, 4> LoadsWithUnknownDepedence; + SmallPtrSet<Instruction *, 4> LoadsWithUnknownDepedence; for (const auto &Dep : *Deps) { Instruction *Source = Dep.getSource(LAI); @@ -302,7 +302,7 @@ public: /// We need a check if one is a pointer for a candidate load and the other is /// a pointer for a possibly intervening store. bool needsChecking(unsigned PtrIdx1, unsigned PtrIdx2, - const SmallSet<Value *, 4> &PtrsWrittenOnFwdingPath, + const SmallPtrSet<Value *, 4> &PtrsWrittenOnFwdingPath, const std::set<Value *> &CandLoadPtrs) { Value *Ptr1 = LAI.getRuntimePointerChecking()->getPointerInfo(PtrIdx1).PointerValue; @@ -316,7 +316,7 @@ public: /// forwarding store to a load. /// /// These pointers need to be alias-checked against the forwarding candidates. - SmallSet<Value *, 4> findPointersWrittenOnForwardingPath( + SmallPtrSet<Value *, 4> findPointersWrittenOnForwardingPath( const SmallVectorImpl<StoreToLoadForwardingCandidate> &Candidates) { // From FirstStore to LastLoad neither of the elimination candidate loads // should overlap with any of the stores. @@ -354,7 +354,7 @@ public: // We're looking for stores after the first forwarding store until the end // of the loop, then from the beginning of the loop until the last // forwarded-to load. Collect the pointer for the stores. - SmallSet<Value *, 4> PtrsWrittenOnFwdingPath; + SmallPtrSet<Value *, 4> PtrsWrittenOnFwdingPath; auto InsertStorePtr = [&](Instruction *I) { if (auto *S = dyn_cast<StoreInst>(I)) @@ -374,11 +374,11 @@ public: SmallVector<RuntimePointerChecking::PointerCheck, 4> collectMemchecks( const SmallVectorImpl<StoreToLoadForwardingCandidate> &Candidates) { - SmallSet<Value *, 4> PtrsWrittenOnFwdingPath = + SmallPtrSet<Value *, 4> PtrsWrittenOnFwdingPath = findPointersWrittenOnForwardingPath(Candidates); // Collect the pointers of the candidate loads. - // FIXME: SmallSet does not work with std::inserter. + // FIXME: SmallPtrSet does not work with std::inserter. std::set<Value *> CandLoadPtrs; transform(Candidates, std::inserter(CandLoadPtrs, CandLoadPtrs.begin()), |