From: Matthew Simpson Date: Tue, 10 Oct 2017 21:33:48 +0000 (+0000) Subject: [SparsePropagation] Use SmallVector for work lists X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=26fb5a6e6c4a1569001f7f8ed63e4268549d256c;p=llvm [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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315373 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Analysis/SparsePropagation.h b/include/llvm/Analysis/SparsePropagation.h index d4cbf0eb957..1a7fded7904 100644 --- a/include/llvm/Analysis/SparsePropagation.h +++ b/include/llvm/Analysis/SparsePropagation.h @@ -101,20 +101,26 @@ public: /// Propagation with a programmable lattice function. template 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 *LatticeFunc; - DenseMap ValueState; // The state each value is in. - SmallPtrSet BBExecutable; // The bbs that are executable. + /// ValueState - Holds the lattice state associated with LLVM values. + DenseMap ValueState; - std::vector InstWorkList; // Worklist of insts to process. + /// BBExecutable - Holds the basic blocks that are executable. + SmallPtrSet BBExecutable; - std::vector BBWorkList; // The BasicBlock work list + /// InstWorkList - Holds instructions that should be processed. + SmallVector InstWorkList; + + /// BBWorkList - Holds basic blocks that should be processed. + SmallVector BBWorkList; + + using Edge = std::pair; /// KnownFeasibleEdges - Entries in this set are edges which have already had /// PHI nodes retriggered. - using Edge = std::pair; std::set KnownFeasibleEdges; public: