diff options
author | Sanjoy Das <sanjoy@playingwithpointers.com> | 2016-09-27 18:01:38 +0000 |
---|---|---|
committer | Sanjoy Das <sanjoy@playingwithpointers.com> | 2016-09-27 18:01:38 +0000 |
commit | db93375711ad7dacd33541dddd7ef31a11cda7d9 (patch) | |
tree | 9abed6d867b3a195f7c64923a2453450419b6d56 /llvm/lib/Analysis/ScalarEvolution.cpp | |
parent | 44d299082c0946060ef3e5f4aa43eb43c3a8359e (diff) | |
download | bcm5719-llvm-db93375711ad7dacd33541dddd7ef31a11cda7d9.tar.gz bcm5719-llvm-db93375711ad7dacd33541dddd7ef31a11cda7d9.zip |
[SCEV] Make PendingLoopPredicates more frugal; NFCI
I don't expect `PendingLoopPredicates` to have very many
elements (e.g. when -O3'ing the sqlite3 amalgamation,
`PendingLoopPredicates` has at most 3 elements). So now we use a
`SmallPtrSet` for it instead of the more heavyweight `DenseSet`.
llvm-svn: 282511
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp')
-rw-r--r-- | llvm/lib/Analysis/ScalarEvolution.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index c46464c6a25..038204e8839 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -8064,11 +8064,11 @@ namespace { /// currently evaluating isImpliedCond. struct MarkPendingLoopPredicate { Value *Cond; - DenseSet<Value*> &LoopPreds; + SmallPtrSetImpl<Value *> &LoopPreds; bool Pending; - MarkPendingLoopPredicate(Value *C, DenseSet<Value*> &LP) - : Cond(C), LoopPreds(LP) { + MarkPendingLoopPredicate(Value *C, SmallPtrSetImpl<Value *> &LP) + : Cond(C), LoopPreds(LP) { Pending = !LoopPreds.insert(Cond).second; } ~MarkPendingLoopPredicate() { @@ -9577,6 +9577,7 @@ ScalarEvolution::ScalarEvolution(ScalarEvolution &&Arg) : F(Arg.F), HasGuards(Arg.HasGuards), TLI(Arg.TLI), AC(Arg.AC), DT(Arg.DT), LI(Arg.LI), CouldNotCompute(std::move(Arg.CouldNotCompute)), ValueExprMap(std::move(Arg.ValueExprMap)), + PendingLoopPredicates(std::move(Arg.PendingLoopPredicates)), WalkingBEDominatingConds(false), ProvingSplitPredicate(false), BackedgeTakenCounts(std::move(Arg.BackedgeTakenCounts)), PredicatedBackedgeTakenCounts( |