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

Kernel/interface progress

File:
1 edited

Legend:

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

    r5074 r5097  
    5757    iBuilder->SetInsertPoint(BasicBlock::Create(iBuilder->getContext(), "entry", doBlockFunction, 0));
    5858   
    59     Value * inputStreamBlock = getParameter(doBlockFunction, "inputStreamSet");
    60     Value * outputStreamBlock = getParameter(doBlockFunction, "outputStreamSet");
    61     Value * delCountBlock = getParameter(doBlockFunction, "deletionCounts");
     59    Value * self = getParameter(doBlockFunction, "self");
     60   
     61    Value * blockNo = getScalarField(self, blockNoScalar);
     62    Value * inputStreamBlock = getCircularBufferBlockPointer(self, "inputStreamSet", blockNo);
     63    Value * outputStreamBlock = getCircularBufferBlockPointer(self, "outputStreamSet", blockNo);
     64    Value * delCountBlock = getCircularBufferBlockPointer(self, "deletionCounts", blockNo);
    6265   
    6366    Value * del_mask = iBuilder->CreateBlockAlignedLoad(inputStreamBlock, {iBuilder->getInt32(0), iBuilder->getInt32(mStreamCount)});
     
    8790    iBuilder->SetInsertPoint(BasicBlock::Create(iBuilder->getContext(), "entry", finalBlockFunction, 0));
    8891    Value * remainingBytes = getParameter(finalBlockFunction, "remainingBytes");
    89     Value * inputStreamBlock = getParameter(finalBlockFunction, "inputStreamSet");
     92    Value * self = getParameter(doBlockFunction, "self");
     93    Value * blockNo = getScalarField(self, blockNoScalar);
     94    Value * inputStreamBlock = getCircularBufferBlockPointer(self, "inputStreamSet", blockNo);
    9095    Value * remaining = iBuilder->CreateZExt(remainingBytes, iBuilder->getIntNTy(blockSize));
    9196    Value * EOF_del = iBuilder->bitCast(iBuilder->CreateShl(Constant::getAllOnesValue(iBuilder->getIntNTy(blockSize)), remaining));
     
    9398    Value * const delmaskVal = iBuilder->CreateBlockAlignedLoad(delmaskPtr);
    9499    iBuilder->CreateBlockAlignedStore(iBuilder->CreateOr(EOF_del, delmaskVal), delmaskPtr);
    95     Function::arg_iterator args = finalBlockFunction->arg_begin();
    96     Value * self = &*(args++);
    97     /* Skip "remaining" arg */ args++;
    98     std::vector<Value *> doBlockArgs = {self};
    99     while (args != finalBlockFunction->arg_end()){
    100         doBlockArgs.push_back(&*args++);
    101     }
    102     iBuilder->CreateCall(doBlockFunction, doBlockArgs);   
     100    iBuilder->CreateCall(doBlockFunction, {self});
    103101    iBuilder->CreateRetVoid();
    104102    iBuilder->restoreIP(savePoint);
Note: See TracChangeset for help on using the changeset viewer.