[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
This commit is contained in:
Sanjoy Das 2016-09-27 18:01:38 +00:00
parent 44d299082c
commit db93375711
2 changed files with 5 additions and 4 deletions

View File

@ -533,7 +533,7 @@ private:
ValueExprMapType ValueExprMap;
/// Mark predicate values currently being processed by isImpliedCond.
DenseSet<Value *> PendingLoopPredicates;
SmallPtrSet<Value *, 6> PendingLoopPredicates;
/// Set to true by isLoopBackedgeGuardedByCond when we're walking the set of
/// conditions dominating the backedge of a loop.

View File

@ -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(