Ignore:
Timestamp:
Mar 1, 2017, 4:17:24 PM (3 years ago)
Author:
nmedfort
Message:

Progress on parenthesis matching example

File:
1 edited

Legend:

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

    r5351 r5353  
    211211
    212212    BasicBlock * whileEntryBlock = iBuilder->GetInsertBlock();
    213     BasicBlock * whileBodyBlock = mKernel->CreateBasicBlock("while.body");
    214     BasicBlock * whileEndBlock = mKernel->CreateBasicBlock("while.end");
    215213
    216214    const auto escaped = whileStatement->getEscaped();
     
    238236
    239237    mCarryManager->enterLoopScope(whileBody);
     238
     239    BasicBlock * whileBodyBlock = mKernel->CreateBasicBlock("while.body");
    240240
    241241    iBuilder->CreateBr(whileBodyBlock);
     
    290290    BasicBlock * const whileExitBlock = iBuilder->GetInsertBlock();
    291291
    292     mCarryManager->leaveLoopBody(whileExitBlock);
    293 
    294292    // Terminate the while loop body with a conditional branch back.
    295293    Value * condition = compileExpression(whileStatement->getCondition());
    296294    if (condition->getType() == iBuilder->getBitBlockType()) {
    297         condition = iBuilder->bitblock_any(condition);
    298     }
     295        condition = iBuilder->bitblock_any(mCarryManager->generateSummaryTest(condition));
     296    }
     297
     298    mCarryManager->leaveLoopBody(whileExitBlock);
     299
     300
    299301#ifdef ENABLE_BOUNDED_WHILE
    300302    if (whileStatement->getBound()) {
     
    338340    }
    339341
     342    BasicBlock * whileEndBlock = mKernel->CreateBasicBlock("while.end");
     343
    340344    iBuilder->CreateCondBr(condition, whileBodyBlock, whileEndBlock);
    341 
    342     whileEndBlock->moveAfter(whileExitBlock);
    343345
    344346    iBuilder->SetInsertPoint(whileEndBlock);
Note: See TracChangeset for help on using the changeset viewer.