Ignore:
Timestamp:
Sep 13, 2015, 1:17:44 AM (4 years ago)
Author:
nmedfort
Message:

Progress on reassociation pass

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/pablo/optimizers/booleanreassociationpass.h

    r4768 r4769  
    33
    44#include <pablo/codegenstate.h>
     5#include <boost/container/flat_set.hpp>
    56#include <boost/container/flat_map.hpp>
    67#include <boost/graph/adjacency_list.hpp>
     
    1011class BooleanReassociationPass {
    1112public:
    12     using Graph = boost::adjacency_list<boost::hash_setS, boost::vecS, boost::bidirectionalS, PabloAST *, PabloAST *>;
     13    using VertexData = std::pair<PabloAST::ClassTypeId, PabloAST *>;
     14    using Graph = boost::adjacency_list<boost::vecS, boost::vecS, boost::bidirectionalS, VertexData, PabloAST *>;
    1315    using Vertex = Graph::vertex_descriptor;
    1416    using Map = std::unordered_map<const PabloAST *, Vertex>;
     
    2325    void processScope(PabloFunction & function, PabloBlock & block);
    2426    void summarizeAST(PabloBlock & block, Graph & G) const;
    25     static bool summarizeGraph(PabloBlock & block, Graph & G);
     27    static void summarizeGraph(Graph & G, std::vector<Vertex> & mapping);
    2628    void resolveUsages(const Vertex u, PabloAST * expr, PabloBlock & block, Graph & G, Map & M, Statement * ignoreIfThis = nullptr) const;
    27     bool redistributeAST(PabloBlock & block, Graph & G) const;
     29    void redistributeAST(const PabloBlock & block, Graph & G) const;
     30public:
     31    static bool isOptimizable(const VertexData & data);
     32    static bool isMutable(const VertexData & data, const PabloBlock &block);
     33    static bool isNonEscaping(const VertexData & data);
     34    static bool isSameType(const VertexData & data1, const VertexData & data2);
    2835private:
    2936    boost::container::flat_map<PabloBlock *, Statement *> mResolvedScopes;
Note: See TracChangeset for help on using the changeset viewer.