Ignore:
Timestamp:
Dec 23, 2015, 4:28:42 PM (3 years ago)
Author:
nmedfort
Message:

Work on lowering + minor bug fixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/pablo/optimizers/distributivepass.cpp

    r4896 r4899  
    1616using Graph = adjacency_list<hash_setS, vecS, bidirectionalS, PabloAST *>;
    1717using Vertex = Graph::vertex_descriptor;
    18 using Map = flat_map<PabloAST *, Vertex>;
     18using SinkMap = flat_map<PabloAST *, Vertex>;
    1919using VertexSet = std::vector<Vertex>;
    2020using Biclique = std::pair<VertexSet, VertexSet>;
     
    2828 * @brief getVertex
    2929 ** ------------------------------------------------------------------------------------------------------------- */
    30 static inline Vertex getVertex(PabloAST * value, Graph & G, Map & M) {
     30static inline Vertex getVertex(PabloAST * value, Graph & G, SinkMap & M) {
    3131    const auto f = M.find(value);
    3232    if (f != M.end()) {
     
    4444 ** ------------------------------------------------------------------------------------------------------------- */
    4545VertexSet generateDistributionGraph(PabloBlock * block, Graph & G) {
    46     Map M;
     46    SinkMap M;
    4747    VertexSet distSet;
    4848    for (Statement * stmt : *block) {
     
    307307    for (;;) {
    308308
    309         FlattenAssociativeDFG::coalesce(block, false);
     309        // FlattenAssociativeDFG::coalesce(block, false);
    310310
    311311        Graph G;
     
    350350                outerOp->addOperand(G[u]);
    351351            }
     352            FlattenAssociativeDFG::coalesce(outerOp);
    352353
    353354            for (const Vertex u : sources) {
     
    358359            }
    359360            innerOp->addOperand(outerOp);
     361            FlattenAssociativeDFG::coalesce(innerOp);
    360362
    361363            for (const Vertex u : sinks) {
    362                 cast<Variadic>(G[u])->addOperand(innerOp);
    363             }
    364         }
    365 
     364                Variadic * const resultOp = cast<Variadic>(G[u]);
     365                resultOp->addOperand(innerOp);
     366                FlattenAssociativeDFG::coalesce(resultOp);
     367            }
     368        }
    366369    }
    367370}
     
    388391    #endif
    389392    Simplifier::optimize(function);
    390     FlattenAssociativeDFG::deMorgansReduction(function.getEntryBlock());
    391     #ifndef NDEBUG
    392     PabloVerifier::verify(function, "post-demorgans-reduction");
    393     #endif
    394     Simplifier::optimize(function);
    395 }
    396 
    397 
    398 }
     393//    FlattenAssociativeDFG::deMorgansReduction(function.getEntryBlock());
     394//    #ifndef NDEBUG
     395//    PabloVerifier::verify(function, "post-demorgans-reduction");
     396//    #endif
     397//    Simplifier::optimize(function);
     398}
     399
     400
     401}
Note: See TracChangeset for help on using the changeset viewer.