Ignore:
Timestamp:
Jan 31, 2017, 4:08:11 PM (2 years ago)
Author:
nmedfort
Message:

Removed 'function' and 'self' parameters from generateXXXMethod() functions.

File:
1 edited

Legend:

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

    r5285 r5292  
    5353// Outputs: the deleted streams, plus a partial sum popcount
    5454
    55 void DeletionKernel::generateDoBlockMethod(Function * function, Value * self, Value * blockNo) const {
    56     Value * delMaskPtr = getStream(self, "delMaskSet", blockNo, iBuilder->getInt32(0));
     55void DeletionKernel::generateDoBlockMethod(Value * blockNo) {
     56    Value * delMaskPtr = getStream("delMaskSet", blockNo, iBuilder->getInt32(0));
    5757    Value * delMask = iBuilder->CreateBlockAlignedLoad(delMaskPtr);
    5858    std::vector<Value *> move_masks = parallel_prefix_deletion_masks(iBuilder, mDeletionFieldWidth, delMask);
    5959    for (unsigned j = 0; j < mStreamCount; ++j) {
    60         Value * inputStreamPtr = getStream(self, "inputStreamSet", blockNo, iBuilder->getInt32(j));
     60        Value * inputStreamPtr = getStream("inputStreamSet", blockNo, iBuilder->getInt32(j));
    6161        Value * input = iBuilder->CreateBlockAlignedLoad(inputStreamPtr);
    6262        Value * output = apply_parallel_prefix_deletion(iBuilder, mDeletionFieldWidth, delMask, move_masks, input);
    63         Value * outputStreamPtr = getStream(self, "outputStreamSet", blockNo, iBuilder->getInt32(j));
     63        Value * outputStreamPtr = getStream("outputStreamSet", blockNo, iBuilder->getInt32(j));
    6464        iBuilder->CreateBlockAlignedStore(output, outputStreamPtr);
    6565    }
    6666    Value * delCount = partial_sum_popcount(iBuilder, mDeletionFieldWidth, iBuilder->simd_not(delMask));
    67     Value * delCountPtr = getStream(self, "deletionCounts", blockNo, iBuilder->getInt32(0));
     67    Value * delCountPtr = getStream("deletionCounts", blockNo, iBuilder->getInt32(0));
    6868    iBuilder->CreateBlockAlignedStore(iBuilder->bitCast(delCount), delCountPtr);
    6969    // Stream deletion has only been applied within fields; the actual number of data items has not yet changed.
    70     Value * produced = getProducedItemCount(self, "outputStreamSet");
     70    Value * produced = getProducedItemCount("outputStreamSet");
    7171    produced = iBuilder->CreateAdd(produced, iBuilder->getSize(iBuilder->getStride()));
    72     setProducedItemCount(self, "outputStreamSet", produced);
    73     setProducedItemCount(self, "deletionCounts", produced);
     72    setProducedItemCount("outputStreamSet", produced);
     73    setProducedItemCount("deletionCounts", produced);
    7474}
    7575
    76 void DeletionKernel::generateFinalBlockMethod(Function * function, Value * self, Value * remainingBytes, Value * blockNo) const {
     76void DeletionKernel::generateFinalBlockMethod(Value * remainingBytes, Value * blockNo) {
    7777    IntegerType * vecTy = iBuilder->getIntNTy(iBuilder->getBitBlockWidth());
    7878    Value * remaining = iBuilder->CreateZExt(remainingBytes, vecTy);
    7979    Value * EOF_del = iBuilder->bitCast(iBuilder->CreateShl(Constant::getAllOnesValue(vecTy), remaining));
    80     Value * const delmaskPtr = getStream(self, "delMaskSet", blockNo, iBuilder->getInt32(0));
     80    Value * const delmaskPtr = getStream("delMaskSet", blockNo, iBuilder->getInt32(0));
    8181    Value * const delmaskVal = iBuilder->CreateBlockAlignedLoad(delmaskPtr);
    8282    iBuilder->CreateBlockAlignedStore(iBuilder->CreateOr(EOF_del, delmaskVal), delmaskPtr);
    83     iBuilder->CreateCall(getDoBlockFunction(), {self});
     83    CreateDoBlockMethodCall();
    8484    // Adjust the produced item count
    85     Value * produced = getProducedItemCount(self, "outputStreamSet");
     85    Value * produced = getProducedItemCount("outputStreamSet");
    8686    produced = iBuilder->CreateSub(produced, iBuilder->getSize(iBuilder->getStride()));
    8787    produced =  iBuilder->CreateAdd(produced, remainingBytes);
    88     setProducedItemCount(self, "outputStreamSet", produced);
    89     setProducedItemCount(self, "deletionCounts", produced);
     88    setProducedItemCount("outputStreamSet", produced);
     89    setProducedItemCount("deletionCounts", produced);
    9090}
    9191
Note: See TracChangeset for help on using the changeset viewer.