Changeset 4813


Ignore:
Timestamp:
Oct 2, 2015, 9:03:15 AM (2 years ago)
Author:
cameron
Message:

Phi out all carry data for ifs nested within whiles

File:
1 edited

Legend:

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

    r4811 r4813  
    530530   
    531531void CarryManager::buildCarryDataPhisAfterIfBody(BasicBlock * ifEntryBlock, BasicBlock * ifBodyFinalBlock) {
     532    if (mCarryInfo->getWhileDepth() > 0) {
     533        // We need to phi out everything for the while carry accumulation process.
     534        const unsigned scopeCarryPacks = mCarryInfo->getScopeCarryPackCount();
     535        const unsigned currentScopeBase = scopeBasePack();
     536        for (unsigned index = currentScopeBase; index < currentScopeBase + scopeCarryPacks; ++index) {
     537            PHINode * phi_out = mBuilder->CreatePHI(mCarryPackType, 2);
     538            phi_out->addIncoming(mZeroInitializer,ifEntryBlock);
     539            phi_out->addIncoming(mCarryOutPack[index],ifBodyFinalBlock);
     540            mCarryOutPack[index] = phi_out;
     541        }
     542        return;
     543    }
    532544    unsigned const ifScopeCarrySize = mCarryInfo->scopeCarryDataSize;
    533545    if (ifScopeCarrySize == 0) {
     
    546558    }
    547559    if (mCarryInfo->getIfDepth() > 1) {
     560        // Our parent block is also an if.  It needs access to our summary to compute
     561        // its own summary.
    548562        const unsigned summaryIndex = summaryPackIndex();
    549563        PHINode * summary_phi = mBuilder->CreatePHI(mCarryPackType, 2, "summary");
Note: See TracChangeset for help on using the changeset viewer.