Ignore:
Timestamp:
Mar 22, 2016, 5:14:05 PM (3 years ago)
Author:
nmedfort
Message:

First attempt at dynamic segment size intergration.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/kernels/symboltablepipeline.cpp

    r4974 r4986  
    186186    BasicBlock * exitBlock = BasicBlock::Create(mMod->getContext(), "exit", main, 0);
    187187
    188     Instance * s2pInstance = mS2PKernel->instantiate();
    189     Instance * leadingInstance = mLeadingKernel->instantiate();
    190     Instance * sortingInstance = mSortingKernel->instantiate();
    191 
    192     Value * basisBits = s2pInstance->getOutputStreamSet();
    193     Value * leadingData = leadingInstance->getOutputStreamSet();
     188    Instance * s2pInstance = mS2PKernel->instantiate(inputStream);
     189    Instance * leadingInstance = mLeadingKernel->instantiate(s2pInstance->getOutputStreamSet());
     190    Instance * sortingInstance = mSortingKernel->instantiate(leadingInstance->getOutputStreamSet());
    194191
    195192    const unsigned leadingBlocks = (mLongestLookahead + iBuilder->getBitBlockWidth() - 1) / iBuilder->getBitBlockWidth();
     
    216213    iBuilder->CreateCondBr(leadingBlocksCond, leadingBodyBlock, regularTestBlock);
    217214    iBuilder->SetInsertPoint(leadingBodyBlock);
    218     s2pInstance->call(iBuilder->CreateGEP(inputStream, blockNo));
    219     leadingInstance->call(basisBits);
     215    s2pInstance->CreateDoBlockCall();
     216    leadingInstance->CreateDoBlockCall();
    220217    blockNo->addIncoming(iBuilder->CreateAdd(blockNo, iBuilder->getInt64(1)), leadingBodyBlock);
    221218    remainingBytes->addIncoming(iBuilder->CreateSub(remainingBytes, blockSize), leadingBodyBlock);
     
    231228    iBuilder->CreateCondBr(remainingBytesCond, regularBodyBlock, regularExitBlock);
    232229    iBuilder->SetInsertPoint(regularBodyBlock);
    233     s2pInstance->call(iBuilder->CreateGEP(inputStream, blockNo2));
    234     leadingInstance->call(basisBits);
    235     sortingInstance->call(leadingData);
     230    s2pInstance->CreateDoBlockCall();
     231    leadingInstance->CreateDoBlockCall();
     232    sortingInstance->CreateDoBlockCall();
    236233    blockNo2->addIncoming(iBuilder->CreateAdd(blockNo2, iBuilder->getInt64(1)), regularBodyBlock);
    237234    remainingBytes2->addIncoming(iBuilder->CreateSub(remainingBytes2, blockSize), regularBodyBlock);
     
    246243    // If we do, process it and mask out the data
    247244    iBuilder->SetInsertPoint(partialBlock);
    248     s2pInstance->call(iBuilder->CreateGEP(inputStream, blockNo2));
     245    s2pInstance->CreateDoBlockCall();
    249246    Value * partialLeadingData[2];
    250247    for (unsigned i = 0; i < 2; ++i) {
    251248        partialLeadingData[i] = leadingInstance->getOutputStream(i);
    252249    }
    253     leadingInstance->call(basisBits);
     250    leadingInstance->CreateDoBlockCall();
    254251    Type * fullBitBlockType = iBuilder->getIntNTy(mBlockSize);
    255252    Value * remaining = iBuilder->CreateZExt(iBuilder->CreateSub(blockSize, remainingBytes2), fullBitBlockType);
     
    263260        iBuilder->CreateBlockAlignedStore(ConstantInt::getNullValue(mBitBlockType), leadingInstance->getOutputStream(i));
    264261    }
    265     sortingInstance->call(leadingData);
     262    sortingInstance->CreateDoBlockCall();
    266263    iBuilder->CreateBr(finalTestBlock);
    267264
     
    283280    iBuilder->CreateStore(blockNoValue, blockNoPtr);
    284281
    285     sortingInstance->call(leadingData);
     282    sortingInstance->CreateDoBlockCall();
    286283
    287284    remainingFullBlocks->addIncoming(iBuilder->CreateSub(remainingFullBlocks, iBuilder->getInt64(1)), finalBodyBlock);
Note: See TracChangeset for help on using the changeset viewer.