Ignore:
Timestamp:
Mar 13, 2017, 3:02:13 PM (2 years ago)
Author:
nmedfort
Message:

Work on non-carry collapsing mode.

File:
1 edited

Legend:

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

    r5353 r5361  
    153153    compileBlock(ifBody);
    154154
    155     BasicBlock * ifExitBlock = iBuilder->GetInsertBlock();   
    156 
    157     mCarryManager->leaveIfBody(ifExitBlock);
     155    mCarryManager->leaveIfBody(iBuilder->GetInsertBlock());
     156
     157    BasicBlock * ifExitBlock = iBuilder->GetInsertBlock();
    158158
    159159    iBuilder->CreateBr(ifEndBlock);
     
    282282    mCarryManager->enterLoopBody(whileEntryBlock);
    283283
    284     //
    285     // Now compile the loop body proper.  Carry-out accumulated values
    286     // and iterated values of Next nodes will be computed.
    287284    compileBlock(whileBody);
    288285
    289286    // After the whileBody has been compiled, we may be in a different basic block.
    290     BasicBlock * const whileExitBlock = iBuilder->GetInsertBlock();
    291 
    292     // Terminate the while loop body with a conditional branch back.
    293     Value * condition = compileExpression(whileStatement->getCondition());
    294     if (condition->getType() == iBuilder->getBitBlockType()) {
    295         condition = iBuilder->bitblock_any(mCarryManager->generateSummaryTest(condition));
    296     }
    297 
    298     mCarryManager->leaveLoopBody(whileExitBlock);
     287
     288    mCarryManager->leaveLoopBody(iBuilder->GetInsertBlock());
    299289
    300290
     
    306296    }
    307297#endif
     298
     299    BasicBlock * const whileExitBlock = iBuilder->GetInsertBlock();
    308300
    309301    // and for any variant nodes in the loop body
     
    341333
    342334    BasicBlock * whileEndBlock = mKernel->CreateBasicBlock("while.end");
     335
     336    // Terminate the while loop body with a conditional branch back.
     337    Value * condition = compileExpression(whileStatement->getCondition());
     338    if (condition->getType() == iBuilder->getBitBlockType()) {
     339        condition = iBuilder->bitblock_any(mCarryManager->generateSummaryTest(condition));
     340    }
    343341
    344342    iBuilder->CreateCondBr(condition, whileBodyBlock, whileEndBlock);
Note: See TracChangeset for help on using the changeset viewer.