Ignore:
Timestamp:
Jul 24, 2015, 6:31:27 PM (4 years ago)
Author:
nmedfort
Message:

Temporary check in.

File:
1 edited

Legend:

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

    r4692 r4699  
    22#define PABLO_BDDMINIMIZATION_H
    33
    4 #include <pablo/codegenstate.h>
    5 #include <slab_allocator.h>
    6 #include <queue>
    7 #include <boost/graph/adjacency_list.hpp>
    8 #include <boost/graph/adjacency_matrix.hpp>
    9 #include <boost/graph/edge_list.hpp>
    10 #include <boost/container/flat_map.hpp>
    11 #include <boost/container/flat_set.hpp>
    12 #include <boost/numeric/ublas/matrix.hpp>
    13 #include <random>
    14 #include <stdint.h>
    154#include <llvm/ADT/DenseMap.h>
    165
     
    209namespace pablo {
    2110
     11class PabloAST;
     12class PabloBlock;
     13class PabloFunction;
     14class Statement;
     15
    2216class BDDMinimizationPass {
    2317
    2418    using CharacterizationMap = llvm::DenseMap<const PabloAST *, DdNode *>;
     19    using StatementVector = std::vector<PabloAST *>;
    2520
    2621    struct SubsitutionMap {
     
    3025            auto f = mMap.find(node);
    3126            if (f == mMap.end()) {
    32                 return mParent ? mParent->find(node) : nullptr;
     27                return mParent ? mParent->operator [](node) : nullptr;
    3328            }
    3429            return f->second;
     
    4641    static bool optimize(PabloFunction & function);
    4742protected:
    48     void initialize(PabloFunction & function);
    49     void characterize(const PabloBlock &block);
     43    void initialize(const PabloFunction & function);
     44    void characterize(const PabloBlock & block);
    5045    DdNode * characterize(const Statement * const stmt);
    5146    void eliminateLogicallyEquivalentStatements(PabloBlock & entry);
    5247    void eliminateLogicallyEquivalentStatements(PabloBlock & block, SubsitutionMap & parent);
    53     void simplify(PabloBlock & entry);
    54     PabloAST * simplify(DdNode * bdd);
     48    void simplifyAST(PabloFunction & function);
     49    void simplifyAST(PabloBlock & block);
     50    void simplifyAST(PabloBlock & block, PabloAST * const stmt);
    5551
    5652private:
     
    6460    DdNode * Not(DdNode * x) const;
    6561    DdNode * Ite(DdNode * const x, DdNode * const y, DdNode * const z);
    66     DdNode * NewVar();
     62    DdNode * NewVar(Statement * const stmt);
    6763    bool noSatisfyingAssignment(DdNode * const x);
    6864    void shutdown();
     
    7167    unsigned                mVariables;
    7268    CharacterizationMap     mCharacterizationMap;
     69    StatementVector         mStatementVector;
    7370};
    7471
     72}
    7573
    7674#endif // PABLO_BDDMINIMIZATION_H
Note: See TracChangeset for help on using the changeset viewer.