]> granicus.if.org Git - llvm/commitdiff
[SparsePropagation] Use SmallVector for work lists
authorMatthew Simpson <mssimpso@codeaurora.org>
Tue, 10 Oct 2017 21:33:48 +0000 (21:33 +0000)
committerMatthew Simpson <mssimpso@codeaurora.org>
Tue, 10 Oct 2017 21:33:48 +0000 (21:33 +0000)
This patch changes the work lists from std::vector to SmallVector, which
matches the SCCP implementation. This patch also updates some related comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315373 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/SparsePropagation.h

index d4cbf0eb9570be2e269942641ccda8f4713b3007..1a7fded790413f7d743f807046a007e2f42d9bb6 100644 (file)
@@ -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: