Ignore:
Timestamp:
Aug 20, 2017, 10:19:39 PM (21 months ago)
Author:
cameron
Message:

Automatic expansion of dynamic buffers in pipeline

File:
1 edited

Legend:

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

    r5612 r5615  
    696696    b->CreateCondBr(priorBufIsNonNull, freePrior, freeCurrent);
    697697    b->SetInsertPoint(freePrior);
     698    //b->CallPrintInt("releasing: ", priorBuf);
    698699    b->CreateFree(priorBuf);
    699700    b->CreateBr(freeCurrent);
     
    722723    Value * oldBufPtr = b->CreateLoad(bufBasePtrField);
    723724    Value * const currentWorkingBlocks = b->CreateLoad(workingBlocksField);
     725    //b->CallPrintInt("currentWorkingBlocks: ", currentWorkingBlocks);
    724726    Value * workingBytes = b->CreateMul(currentWorkingBlocks, blockBytes);
    725727    Value * const curAllocated = b->CreateLoad(capacityField);
     
    742744    b->CreateCondBr(priorBufIsNonNull, deallocatePrior, allocateNew);
    743745    b->SetInsertPoint(deallocatePrior);
     746    //b->CallPrintInt("deallocating: ", priorBuf);
    744747    b->CreateFree(priorBuf);
    745748    b->CreateBr(allocateNew);
     
    747750    b->CreateStore(oldBufPtr, priorBasePtrField);
    748751    Value * newBufPtr = b->CreatePointerCast(b->CreateCacheAlignedMalloc(neededCapacity), bufPtrType);
     752    //b->CallPrintInt("allocated: ", newBufPtr);
     753    //b->CallPrintInt("allocated capacity: ", neededCapacity);
     754
    749755    b->CreateStore(newBufPtr, bufBasePtrField);
    750756    createBlockCopy(b, newBufPtr, oldBufPtr, currentWorkingBlocks);
     
    754760    PHINode * bufPtr = b->CreatePHI(oldBufPtr->getType(), 2);
    755761    bufPtr->addIncoming(oldBufPtr, doubleEntry);
    756     bufPtr->addIncoming(newBufPtr, doRealloc);
     762    bufPtr->addIncoming(newBufPtr, allocateNew);
    757763    createBlockCopy(b, b->CreateGEP(bufPtr, currentWorkingBlocks), bufPtr, currentWorkingBlocks);
    758764    b->CreateStore(b->CreateAdd(currentWorkingBlocks, currentWorkingBlocks), workingBlocksField);
Note: See TracChangeset for help on using the changeset viewer.