Ignore:
Timestamp:
Sep 27, 2015, 1:32:27 AM (4 years ago)
Author:
nmedfort
Message:

Progress on multi-target UCD compiler.

File:
1 edited

Legend:

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

    r4788 r4797  
    1111#include <boost/circular_buffer.hpp>
    1212#include <pablo/optimizers/pablo_simplifier.hpp>
    13 #include <boost/container/flat_set.hpp>
    14 #include <boost/container/flat_map.hpp>
    15 #include <boost/graph/adjacency_list.hpp>
    16 #include <boost/graph/topological_sort.hpp>
     13#include <pablo/analysis/pabloverifier.hpp>
    1714
    1815using namespace llvm;
     
    2825    am.initialize(function);
    2926    am.eliminateLogicallyEquivalentStatements(function);
    30 
    3127    am.shutdown();
     28    #ifndef NDEBUG
     29    PabloVerifier::verify(function, "post-bdd-minimization");
     30    #endif
    3231    return Simplifier::optimize(function);
    3332}
     
    6261                    ++variableCount;
    6362                    break;
    64                 case TypeId::Next:
    65                     if (escapes(stmt)) {
    66                         ++variableCount;
    67                     }
    68                 default:
    69                     break;
     63                default: break;
    7064            }
    7165            stmt = stmt->getNextNode();
     
    114108        if (LLVM_UNLIKELY(isa<If>(stmt))) {
    115109            eliminateLogicallyEquivalentStatements(cast<If>(stmt)->getBody(), map);
    116             for (Assign * def : cast<const If>(stmt)->getDefined()) {
    117                 // Any defined variable that wasn't used outside of the If scope would have
    118                 // been demoted by the Simplifier pass.
    119                 map.insert(mCharacterizationMap[def], def);
    120             }
    121110        } else if (LLVM_UNLIKELY(isa<While>(stmt))) {
    122111            eliminateLogicallyEquivalentStatements(cast<While>(stmt)->getBody(), map);
    123112            for (Next * var : cast<const While>(stmt)->getVariants()) {
    124                 if (escapes(var)) {
    125                     map.insert(NewVar(var), var);
    126                 } else { // we don't need to retain the BDD for this variant
     113                if (!escapes(var)) {
    127114                    Cudd_RecursiveDeref(mManager, mCharacterizationMap[var]);
    128115                    mCharacterizationMap.erase(var);
Note: See TracChangeset for help on using the changeset viewer.