Changeset 6027


Ignore:
Timestamp:
May 10, 2018, 8:30:13 PM (11 days ago)
Author:
cameron
Message:

Bug fix for scanmatch processedItemCount

File:
1 edited

Legend:

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

    r5985 r6027  
    6060    Value * const blockNo = b->getScalarField("BlockNo");
    6161    Value * const scanwordPos = b->CreateShl(blockNo, floor_log2(b->getBitBlockWidth()));
    62     Value * const lastRecordStart = b->getProcessedItemCount("InputStream");
    63     Value * const lastRecordNum = b->getScalarField("LineNum");
     62    Value * const consumed = b->getProcessedItemCount("InputStream");
     63    Value * const consumedLines = b->getScalarField("LineNum");
    6464    b->CreateBr(scanWordIteration);
    6565
     
    7171        PHINode * const phiScanwordPos = b->CreatePHI(scanwordPos->getType(), 2, "pos");
    7272        phiScanwordPos->addIncoming(scanwordPos, initialBlock);
    73         PHINode * const phiLineStart = b->CreatePHI(lastRecordStart->getType(), 2, "recordstart");
    74         phiLineStart->addIncoming(lastRecordStart, initialBlock);
    75         PHINode * const phiLineNum = b->CreatePHI(lastRecordNum->getType(), 2, "recordnum");
    76         phiLineNum->addIncoming(lastRecordNum, initialBlock);
     73        PHINode * const phiLineStart = b->CreatePHI(consumed->getType(), 2, "recordstart");
     74        phiLineStart->addIncoming(consumed, initialBlock);
     75        PHINode * const phiLineNum = b->CreatePHI(consumedLines->getType(), 2, "recordnum");
     76        phiLineNum->addIncoming(consumedLines, initialBlock);
    7777
    7878        Value * const matchWord = b->CreateExtractElement(matches, phiIndex);
     
    197197
    198198    b->SetInsertPoint(callFinalizeScan);
    199     Value * bufSize = b->getBufferedSize("InputStream");
    200     b->setProcessedItemCount("InputStream", bufSize);
     199    Value * avail = b->getAvailableItemCount("InputStream");
     200    b->setProcessedItemCount("InputStream", b->CreateAdd(avail, scanwordPos));
    201201    Function * finalizer = m->getFunction("finalize_match_wrapper"); assert (finalizer);
    202202    Value * const buffer_base = b->getRawInputPointer("InputStream", ZERO);
    203     Value * buffer_end_address = b->CreateGEP(buffer_base, bufSize);
     203    Value * buffer_end_address = b->CreateGEP(buffer_base, avail);
    204204    b->CreateCall(finalizer, {accumulator, buffer_end_address});
    205205    b->CreateBr(scanReturn);
Note: See TracChangeset for help on using the changeset viewer.