Ignore:
Timestamp:
Nov 14, 2015, 5:38:36 PM (4 years ago)
Author:
nmedfort
Message:

Bug fix for Multiplexing. Added ability to set the body of a If/While? node after creation.

File:
1 edited

Legend:

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

    r4845 r4870  
    3333        for (Statement * stmt : *pb) {
    3434            if (If * ifStatement = dyn_cast<If>(stmt)) {
    35                 count += doScopeCount(&ifStatement->getBody());
     35                count += doScopeCount(ifStatement->getBody());
    3636            }
    3737            else if (While * whileStatement = dyn_cast<While>(stmt)) {
    38                 count += doScopeCount(&whileStatement->getBody());
     38                count += doScopeCount(whileStatement->getBody());
    3939            }
    4040        }
     
    151151        }
    152152        else if (If * ifStatement = dyn_cast<If>(stmt)) {
    153             const unsigned ifCarryDataBits = enumerate(&ifStatement->getBody(), ifDepth+1, whileDepth);
    154             PabloBlockCarryData * nestedBlockData = mCarryInfoVector[ifStatement->getBody().getScopeIndex()];
     153            const unsigned ifCarryDataBits = enumerate(ifStatement->getBody(), ifDepth+1, whileDepth);
     154            PabloBlockCarryData * nestedBlockData = mCarryInfoVector[ifStatement->getBody()->getScopeIndex()];
    155155            if (mITEMS_PER_PACK == mPACK_SIZE) {  // PACKING
    156156                if (cd->roomInFinalPack(nestedOffset) < ifCarryDataBits) {
     
    168168        }
    169169        else if (While * whileStatement = dyn_cast<While>(stmt)) {
    170             const unsigned whileCarryDataBits = enumerate(&whileStatement->getBody(), ifDepth, whileDepth+1);
    171             PabloBlockCarryData * nestedBlockData = mCarryInfoVector[whileStatement->getBody().getScopeIndex()];
     170            const unsigned whileCarryDataBits = enumerate(whileStatement->getBody(), ifDepth, whileDepth+1);
     171            PabloBlockCarryData * nestedBlockData = mCarryInfoVector[whileStatement->getBody()->getScopeIndex()];
    172172            //if (whileStatement->isMultiCarry()) whileCarryDataBits *= whileStatement->getMaxIterations();
    173173            if (mITEMS_PER_PACK == mPACK_SIZE) {  // PACKING
     
    625625        for (Statement * stmt : *mCurrentScope) {
    626626            if (If * innerIf = dyn_cast<If>(stmt)) {
    627                 PabloBlock * inner_blk = & innerIf->getBody();
     627                PabloBlock * inner_blk = innerIf->getBody();
    628628                enterScope(inner_blk);
    629629                if (blockHasCarries()) {
     
    633633            }
    634634            else if (While * innerWhile = dyn_cast<While>(stmt)) {
    635                 PabloBlock * inner_blk = & innerWhile->getBody();
     635                PabloBlock * inner_blk = innerWhile->getBody();
    636636                enterScope(inner_blk);
    637637                if (blockHasCarries()) {
Note: See TracChangeset for help on using the changeset viewer.