Ignore:
Timestamp:
Sep 23, 2016, 4:12:41 PM (3 years ago)
Author:
nmedfort
Message:

Initial work for incorporating Types into Pablo AST.

File:
1 edited

Legend:

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

    r5157 r5160  
    1111class BooleanReassociationPass {
    1212public:
    13     using VertexData = std::tuple<PabloAST::ClassTypeId, PabloAST *, Z3_ast>;
     13    using TypeId = PabloAST::ClassTypeId;
     14    using VertexData = std::tuple<TypeId, PabloAST *, Z3_ast>;
    1415    using Graph = boost::adjacency_list<boost::vecS, boost::vecS, boost::bidirectionalS, VertexData, PabloAST *>;
    1516    using Vertex = Graph::vertex_descriptor;
     
    4748    void distributeScope(PabloBlock * const block, CharacterizationMap & C);
    4849
     50    Vertex transcribeSel(Sel * const stmt, CharacterizationMap & C, StatementMap & S, VertexMap & M, Graph & G);
    4951    void transformAST(CharacterizationMap & C, Graph & G);
    50     void resolveNestedUsages(PabloAST * const expr, const Vertex u, CharacterizationMap &C, StatementMap & S, Graph & G, const Statement * const ignoreIfThis = nullptr) const;
     52    void resolveNestedUsages(PabloAST * const expr, const Vertex u, CharacterizationMap & C, StatementMap & S, VertexMap &M, Graph & G, const Statement * const ignoreIfThis = nullptr) const;
    5153
    52     bool contractGraph(Graph & G) const;
     54    bool contractGraph(VertexMap & M, Graph & G) const;
    5355
    54     bool reduceGraph(CharacterizationMap & C, VertexMap & M, Graph & G);
     56    void reduceVertex(const Vertex u, CharacterizationMap & C, VertexMap & M, Graph & G);
    5557
    56     enum class Reduction {
    57         NoChange
    58         , Simplified
    59         , Removed
    60     };
    61 
    62     Reduction reduceVertex(const Vertex u, CharacterizationMap & C, VertexMap & M, Graph & G, const bool use_expensive_simplification);
    63 
    64     bool factorGraph(const PabloAST::ClassTypeId typeId, Graph & G, std::vector<Vertex> & factors) const;
     58    bool factorGraph(const TypeId typeId, Graph & G, std::vector<Vertex> & factors) const;
    6559    bool factorGraph(Graph & G) const;
    6660
    67     static Vertex makeVertex(const PabloAST::ClassTypeId typeId, PabloAST * const expr, Graph & G, Z3_ast node = nullptr);
    68     static Vertex makeVertex(const PabloAST::ClassTypeId typeId, PabloAST * const expr, StatementMap & M, Graph & G, Z3_ast node = nullptr);
    69     static Vertex makeVertex(const PabloAST::ClassTypeId typeId, PabloAST * const expr, CharacterizationMap & C, StatementMap & M, Graph & G);
    70     void removeVertex(const Vertex u, StatementMap & M, Graph & G) const;
     61    static Vertex makeVertex(const TypeId typeId, PabloAST * const expr, Graph & G, Z3_ast node = nullptr);
     62    static Vertex makeVertex(const TypeId typeId, PabloAST * const expr, StatementMap & M, Graph & G, Z3_ast node = nullptr);
     63    static Vertex makeVertex(const TypeId typeId, PabloAST * const expr, CharacterizationMap & C, StatementMap & S, VertexMap & M, Graph & G);
     64
     65    void removeVertex(const Vertex u, VertexMap & M, Graph & G) const;
    7166    void removeVertex(const Vertex u, Graph & G) const;
    7267
     68    Z3_ast computeDefinition(const TypeId typeId, const Vertex u, Graph & G, const bool use_expensive_minimization = false) const;
     69    Vertex updateIntermediaryDefinition(const TypeId typeId, const Vertex u, VertexMap & M, Graph & G);
     70    Vertex updateSinkDefinition(const TypeId typeId, const Vertex u, CharacterizationMap &C, VertexMap & M, Graph & G);
    7371    bool redistributeGraph(CharacterizationMap & C, VertexMap & M, Graph & G);
    7472
    75     bool rewriteAST(CharacterizationMap & C, VertexMap &M, Graph & G);
     73    bool rewriteAST(Graph & G);
    7674
    7775    Statement * characterize(Statement * const stmt, CharacterizationMap & map);
Note: See TracChangeset for help on using the changeset viewer.