[llvm] r315373 - [SparsePropagation] Use SmallVector for work lists

Matthew Simpson via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 10 14:33:48 PDT 2017


Author: mssimpso
Date: Tue Oct 10 14:33:48 2017
New Revision: 315373

URL: http://llvm.org/viewvc/llvm-project?rev=315373&view=rev
Log:
[SparsePropagation] Use SmallVector for work lists

This patch changes the work lists from std::vector to SmallVector, which
matches the SCCP implementation. This patch also updates some related comments.

Modified:
    llvm/trunk/include/llvm/Analysis/SparsePropagation.h

Modified: llvm/trunk/include/llvm/Analysis/SparsePropagation.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/SparsePropagation.h?rev=315373&r1=315372&r2=315373&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/SparsePropagation.h (original)
+++ llvm/trunk/include/llvm/Analysis/SparsePropagation.h Tue Oct 10 14:33:48 2017
@@ -101,20 +101,26 @@ public:
 /// Propagation with a programmable lattice function.
 template <class LatticeVal> class SparseSolver {
 
-  /// LatticeFunc - This is the object that knows the lattice and how to do
+  /// LatticeFunc - This is the object that knows the lattice and how to
   /// compute transfer functions.
   AbstractLatticeFunction<LatticeVal> *LatticeFunc;
 
-  DenseMap<Value *, LatticeVal> ValueState;   // The state each value is in.
-  SmallPtrSet<BasicBlock *, 16> BBExecutable; // The bbs that are executable.
+  /// ValueState - Holds the lattice state associated with LLVM values.
+  DenseMap<Value *, LatticeVal> ValueState;
 
-  std::vector<Instruction *> InstWorkList; // Worklist of insts to process.
+  /// BBExecutable - Holds the basic blocks that are executable.
+  SmallPtrSet<BasicBlock *, 16> BBExecutable;
 
-  std::vector<BasicBlock *> BBWorkList; // The BasicBlock work list
+  /// InstWorkList - Holds instructions that should be processed.
+  SmallVector<Instruction *, 64> InstWorkList;
+
+  /// BBWorkList - Holds basic blocks that should be processed.
+  SmallVector<BasicBlock *, 64> BBWorkList;
+
+  using Edge = std::pair<BasicBlock *, BasicBlock *>;
 
   /// KnownFeasibleEdges - Entries in this set are edges which have already had
   /// PHI nodes retriggered.
-  using Edge = std::pair<BasicBlock *, BasicBlock *>;
   std::set<Edge> KnownFeasibleEdges;
 
 public:




More information about the llvm-commits mailing list