Ignore:
Timestamp:
Feb 3, 2017, 1:25:53 PM (2 years ago)
Author:
nmedfort
Message:

Partial removal of BlockNo?

File:
1 edited

Legend:

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

    r5292 r5297  
    88#include <llvm/IR/Value.h>
    99#include <llvm/IR/Module.h>
     10#include <llvm/Support/raw_ostream.h>
    1011
    1112using namespace llvm;
     
    5354// Outputs: the deleted streams, plus a partial sum popcount
    5455
    55 void DeletionKernel::generateDoBlockMethod(Value * blockNo) {
    56     Value * delMaskPtr = getStream("delMaskSet", blockNo, iBuilder->getInt32(0));
     56void DeletionKernel::generateDoBlockMethod() {
     57    Value * delMaskPtr = getInputStream("delMaskSet", iBuilder->getInt32(0));
    5758    Value * delMask = iBuilder->CreateBlockAlignedLoad(delMaskPtr);
    58     std::vector<Value *> move_masks = parallel_prefix_deletion_masks(iBuilder, mDeletionFieldWidth, delMask);
     59    const auto move_masks = parallel_prefix_deletion_masks(iBuilder, mDeletionFieldWidth, delMask);
    5960    for (unsigned j = 0; j < mStreamCount; ++j) {
    60         Value * inputStreamPtr = getStream("inputStreamSet", blockNo, iBuilder->getInt32(j));
     61        Value * inputStreamPtr = getInputStream("inputStreamSet", iBuilder->getInt32(j));
    6162        Value * input = iBuilder->CreateBlockAlignedLoad(inputStreamPtr);
    6263        Value * output = apply_parallel_prefix_deletion(iBuilder, mDeletionFieldWidth, delMask, move_masks, input);
    63         Value * outputStreamPtr = getStream("outputStreamSet", blockNo, iBuilder->getInt32(j));
     64        Value * outputStreamPtr = getOutputStream("outputStreamSet", iBuilder->getInt32(j));
    6465        iBuilder->CreateBlockAlignedStore(output, outputStreamPtr);
    6566    }
    6667    Value * delCount = partial_sum_popcount(iBuilder, mDeletionFieldWidth, iBuilder->simd_not(delMask));
    67     Value * delCountPtr = getStream("deletionCounts", blockNo, iBuilder->getInt32(0));
     68    Value * delCountPtr = getOutputStream("deletionCounts", iBuilder->getInt32(0));
    6869    iBuilder->CreateBlockAlignedStore(iBuilder->bitCast(delCount), delCountPtr);
    6970    // Stream deletion has only been applied within fields; the actual number of data items has not yet changed.
     
    7475}
    7576
    76 void DeletionKernel::generateFinalBlockMethod(Value * remainingBytes, Value * blockNo) {
     77void DeletionKernel::generateFinalBlockMethod(Value * remainingBytes) {
    7778    IntegerType * vecTy = iBuilder->getIntNTy(iBuilder->getBitBlockWidth());
    7879    Value * remaining = iBuilder->CreateZExt(remainingBytes, vecTy);
    7980    Value * EOF_del = iBuilder->bitCast(iBuilder->CreateShl(Constant::getAllOnesValue(vecTy), remaining));
    80     Value * const delmaskPtr = getStream("delMaskSet", blockNo, iBuilder->getInt32(0));
     81    Value * const delmaskPtr = getInputStream("delMaskSet", iBuilder->getInt32(0));
    8182    Value * const delmaskVal = iBuilder->CreateBlockAlignedLoad(delmaskPtr);
    8283    iBuilder->CreateBlockAlignedStore(iBuilder->CreateOr(EOF_del, delmaskVal), delmaskPtr);
Note: See TracChangeset for help on using the changeset viewer.