Ignore:
Timestamp:
Jul 17, 2016, 11:12:34 AM (3 years ago)
Author:
cameron
Message:

Simplify kernel DoBlock? interface

File:
1 edited

Legend:

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

    r5074 r5096  
    4848    Type * scanwordVectorType =  VectorType::get(T, fieldCount);
    4949
    50     Function * doBlockFunction = m->getFunction(mKernelName + "_DoBlock");
     50    Function * doBlockFunction = m->getFunction(mKernelName + doBlock_suffix);
    5151
    5252    iBuilder->SetInsertPoint(BasicBlock::Create(iBuilder->getContext(), "entry", doBlockFunction, 0));
    5353    Value * kernelStuctParam = getParameter(doBlockFunction, "self");
    54     Value * scanwordPos = getScalarField(kernelStuctParam, "BlockNo");
    55     scanwordPos = iBuilder->CreateMul(scanwordPos, ConstantInt::get(scanwordPos->getType(), iBuilder->getBitBlockWidth()));
     54    Value * blockNo = getScalarField(kernelStuctParam, blockNoScalar);
     55    Value * scanwordPos = iBuilder->CreateMul(blockNo, ConstantInt::get(blockNo->getType(), iBuilder->getBitBlockWidth()));
    5656   
    5757    Value * recordStart = getScalarField(kernelStuctParam, "LineStart");
    5858    Value * recordNum = getScalarField(kernelStuctParam, "LineNum");
    59     Value * matchResultsPtr = getParameter(doBlockFunction, "matchResults");
     59   
     60    Value * matchResultsPtr = getCircularBufferBlockPointer(kernelStuctParam, "matchResults", blockNo);
     61   
    6062    Value * matches = iBuilder->CreateBlockAlignedLoad(matchResultsPtr, {iBuilder->getInt32(0), iBuilder->getInt32(0)});
    6163    Value * linebreaks = iBuilder->CreateBlockAlignedLoad(matchResultsPtr, {iBuilder->getInt32(0), iBuilder->getInt32(1)});
     
    7274    setScalarField(kernelStuctParam, "LineStart", recordStart);
    7375    setScalarField(kernelStuctParam, "LineNum", recordNum);
    74     setScalarField(kernelStuctParam, "BlockNo", iBuilder->CreateAdd(getScalarField(kernelStuctParam, "BlockNo"), iBuilder->getInt64(1)));
    7576    iBuilder -> CreateRetVoid();
    7677    iBuilder->restoreIP(savePoint);
Note: See TracChangeset for help on using the changeset viewer.