Ignore:
Timestamp:
Jul 13, 2015, 3:55:59 PM (4 years ago)
Author:
nmedfort
Message:

Made pablo compiler reenterant through alternate compile method that takes a Module parameter.

File:
1 edited

Legend:

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

    r4659 r4665  
    109109    AutoMultiplexing am;
    110110    RECORD_TIMESTAMP(start_initialize);
    111     am.initialize(function);
     111    const bool fewerThanThreeAdvances = am.initialize(function);
    112112    RECORD_TIMESTAMP(end_initialize);
    113113
     
    115115
    116116    LOG_NUMBER_OF_ADVANCES(function.getEntryBlock());
     117
     118    if (fewerThanThreeAdvances) {
     119        return false;
     120    }
    117121
    118122    RECORD_TIMESTAMP(start_characterize);
     
    162166/** ------------------------------------------------------------------------------------------------------------- *
    163167 * @brief initialize
    164  * @param vars the input vars for this program
    165  * @param entry the entry block
     168 * @param function the function to optimize
     169 * @returns true if there are fewer than three advances in this function
    166170 *
    167171 * Scan through the program to identify any advances and calls then initialize the BDD engine with
    168172 * the proper variable ordering.
    169173 ** ------------------------------------------------------------------------------------------------------------- */
    170 void AutoMultiplexing::initialize(PabloFunction & function) {
     174bool AutoMultiplexing::initialize(PabloFunction & function) {
    171175
    172176    flat_map<const PabloAST *, unsigned> map;   
     
    212216    }
    213217
     218    // If there are fewer than three Advances in this program, just abort. We cannot reduce it.
     219    if (mAdvanceMap.size() < 3) {
     220        return true;
     221    }
     222
    214223    // Create the transitive closure matrix of graph. From this we'll construct
    215224    // two graphs restricted to the relationships between advances. The first will
     
    298307        mCharacterizationMap[var] = Cudd_bddIthVar(mManager, i++);
    299308    }
     309
     310    return false;
    300311}
    301312
Note: See TracChangeset for help on using the changeset viewer.