[llvm] r282511 - [SCEV] Make PendingLoopPredicates more frugal; NFCI
Sanjoy Das via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 27 11:01:38 PDT 2016
Author: sanjoy
Date: Tue Sep 27 13:01:38 2016
New Revision: 282511
URL: http://llvm.org/viewvc/llvm-project?rev=282511&view=rev
Log:
[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`.
Modified:
llvm/trunk/include/llvm/Analysis/ScalarEvolution.h
llvm/trunk/lib/Analysis/ScalarEvolution.cpp
Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolution.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolution.h?rev=282511&r1=282510&r2=282511&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/ScalarEvolution.h (original)
+++ llvm/trunk/include/llvm/Analysis/ScalarEvolution.h Tue Sep 27 13:01:38 2016
@@ -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.
Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=282511&r1=282510&r2=282511&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Tue Sep 27 13:01:38 2016
@@ -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(ScalarE
: 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(
More information about the llvm-commits
mailing list