zlktree: replace std::vector<bool> by bitvect in ACD

On the example from previous patch, the number of instruction fetches
goes from 18490399159 down to 18248898077.

* spot/twaalgos/zlktree.cc, spot/twaalgos/zlktree.hh (acd): Use
bitvect instead of std::vector<bool> in nodes.  This make is easier to
update an edge of a bitvector shared by multiple nodes set after
pruning non-maximal sets from an SCC.  Also compute the set of states
hit by the edges at the very end, once all nodes are known.
* spot/twaalgos/sccinfo.cc, spot/twaalgos/sccinfo.hh,
spot/twaalgos/genem.cc, spot/twaalgos/genem.hh: Adjust to work with
bitvect as filter.
This commit is contained in:
Alexandre Duret-Lutz 2021-09-10 14:07:26 +02:00
parent 6aa2079079
commit 2d1cb0ddcd
6 changed files with 41 additions and 33 deletions

View file

@ -21,6 +21,8 @@
#include <iosfwd>
#include <deque>
#include <memory>
#include <spot/misc/bitvect.hh>
#include <spot/twa/twagraph.hh>
#include <spot/twaalgos/sccinfo.hh>
@ -285,9 +287,9 @@ namespace spot
unsigned first_child = 0;
unsigned level;
unsigned scc;
std::vector<bool>& edges;
std::vector<bool>& states;
acd_node(std::vector<bool>& e, std::vector<bool>& s) noexcept
bitvect& edges;
bitvect& states;
acd_node(bitvect& e, bitvect& s) noexcept
: edges(e), states(s)
{
}
@ -297,7 +299,7 @@ namespace spot
std::deque<acd_node> nodes_;
// Likewise for bitvectors: this is the support for all edge vectors
// and state vectors used in acd_node.
std::deque<std::vector<bool>> bitvectors;
std::deque<std::unique_ptr<bitvect>> bitvectors;
// Information about a tree of the ACD. Each tree correspond
// to an SCC.
struct scc_data