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

    r5285 r5292  
    121121#endif
    122122   
    123 void S2PKernel::generateDoBlockMethod(llvm::Function * function, llvm::Value * self, llvm::Value * blockNo) const {
     123void S2PKernel::generateDoBlockMethod(llvm::Value * blockNo) {
    124124    Value * bytepack[8];
    125125    for (unsigned i = 0; i < 8; i++) {
    126         Value * byteStream = getStream(self, "byteStream", blockNo, iBuilder->getInt32(0), iBuilder->getInt32(i));
     126        Value * byteStream = getStream("byteStream", blockNo, iBuilder->getInt32(0), iBuilder->getInt32(i));
    127127        bytepack[i] = iBuilder->CreateBlockAlignedLoad(byteStream);
    128128    }
     
    130130    s2p(iBuilder, bytepack, basisbits);
    131131    for (unsigned i = 0; i < 8; ++i) {
    132         Value * basisBits = getStream(self, "basisBits", blockNo, iBuilder->getInt32(i));
     132        Value * basisBits = getStream("basisBits", blockNo, iBuilder->getInt32(i));
    133133        iBuilder->CreateBlockAlignedStore(basisbits[i], basisBits);
    134134    }
    135135}
    136136
    137 void S2PKernel::generateFinalBlockMethod(llvm::Function * function, llvm::Value * self, Value * remainingBytes, llvm::Value * blockNo) const {
     137void S2PKernel::generateFinalBlockMethod(Value * remainingBytes, llvm::Value * blockNo) {
    138138    /* Prepare the s2p final block function:
    139139     assumption: if remaining bytes is greater than 0, it is safe to read a full block of bytes.
     
    141141     */
    142142   
    143     BasicBlock * finalPartialBlock = BasicBlock::Create(iBuilder->getContext(), "partial", function, 0);
    144     BasicBlock * finalEmptyBlock = BasicBlock::Create(iBuilder->getContext(), "empty", function, 0);
    145     BasicBlock * exitBlock = BasicBlock::Create(iBuilder->getContext(), "exit", function, 0);
     143    BasicBlock * finalPartialBlock = CreateBasicBlock("partial");
     144    BasicBlock * finalEmptyBlock = CreateBasicBlock("empty");
     145    BasicBlock * exitBlock = CreateBasicBlock("exit");
    146146   
    147147    Value * emptyBlockCond = iBuilder->CreateICmpEQ(remainingBytes, iBuilder->getSize(0));
    148148    iBuilder->CreateCondBr(emptyBlockCond, finalEmptyBlock, finalPartialBlock);
    149149    iBuilder->SetInsertPoint(finalPartialBlock);
    150     iBuilder->CreateCall(getDoBlockFunction(), {self});
     150    CreateDoBlockMethodCall();
    151151   
    152152    iBuilder->CreateBr(exitBlock);
    153153   
    154154    iBuilder->SetInsertPoint(finalEmptyBlock);
    155     Value * basisBitsPtr = getStreamView(self, "basisBits", blockNo, iBuilder->getInt64(0));
     155    Value * basisBitsPtr = getStreamView("basisBits", blockNo, iBuilder->getInt64(0));
    156156    iBuilder->CreateStore(Constant::getNullValue(basisBitsPtr->getType()->getPointerElementType()), basisBitsPtr);
    157157    iBuilder->CreateBr(exitBlock);
Note: See TracChangeset for help on using the changeset viewer.