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/s2p_kernel.cpp

    r5292 r5297  
    88#include <llvm/IR/Constant.h>      // for Constant
    99#include <llvm/IR/Module.h>
     10#include <llvm/Support/raw_ostream.h>
    1011namespace llvm { class BasicBlock; }
    1112namespace llvm { class Function; }
     
    121122#endif
    122123   
    123 void S2PKernel::generateDoBlockMethod(llvm::Value * blockNo) {
     124void S2PKernel::generateDoBlockMethod() {
    124125    Value * bytepack[8];
    125126    for (unsigned i = 0; i < 8; i++) {
    126         Value * byteStream = getStream("byteStream", blockNo, iBuilder->getInt32(0), iBuilder->getInt32(i));
     127        Value * byteStream = getInputStream("byteStream", iBuilder->getInt32(0), iBuilder->getInt32(i));
    127128        bytepack[i] = iBuilder->CreateBlockAlignedLoad(byteStream);
    128129    }
     
    130131    s2p(iBuilder, bytepack, basisbits);
    131132    for (unsigned i = 0; i < 8; ++i) {
    132         Value * basisBits = getStream("basisBits", blockNo, iBuilder->getInt32(i));
     133        Value * basisBits = getOutputStream("basisBits", iBuilder->getInt32(i));
    133134        iBuilder->CreateBlockAlignedStore(basisbits[i], basisBits);
    134135    }
    135136}
    136137
    137 void S2PKernel::generateFinalBlockMethod(Value * remainingBytes, llvm::Value * blockNo) {
     138void S2PKernel::generateFinalBlockMethod(Value * remainingBytes) {
    138139    /* Prepare the s2p final block function:
    139140     assumption: if remaining bytes is greater than 0, it is safe to read a full block of bytes.
     
    153154   
    154155    iBuilder->SetInsertPoint(finalEmptyBlock);
    155     Value * basisBitsPtr = getStreamView("basisBits", blockNo, iBuilder->getInt64(0));
    156     iBuilder->CreateStore(Constant::getNullValue(basisBitsPtr->getType()->getPointerElementType()), basisBitsPtr);
     156
     157    for (unsigned i = 0; i < 8; ++i) {
     158        Value * basisBitsPtr = getOutputStream("basisBits", iBuilder->getInt64(i));
     159        iBuilder->CreateBlockAlignedStore(Constant::getNullValue(iBuilder->getBitBlockType()), basisBitsPtr);
     160    }
     161
    157162    iBuilder->CreateBr(exitBlock);
    158163   
Note: See TracChangeset for help on using the changeset viewer.