Ignore:
Timestamp:
Nov 6, 2016, 8:37:11 PM (3 years ago)
Author:
nmedfort
Message:

Initial work on adding types to PabloAST and mutable Var objects.

File:
1 edited

Legend:

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

    r5183 r5202  
    125125     if remaining bytes is zero, no read should be performed (e.g. for mmapped buffer).
    126126     */
    127     IDISA::IDISA_Builder::InsertPoint savePoint = iBuilder->saveIP();
     127    auto savePoint = iBuilder->saveIP();
    128128    Module * m = iBuilder->getModule();
    129129    Function * doBlockFunction = m->getFunction(mKernelName + doBlock_suffix);
     
    162162   
    163163void s2pKernel::generateDoBlockLogic(Value * self, Value * blockNo) {
    164     Value * byteStreamBlock_ptr = getStreamSetBlockPtr(self, "byteStream", blockNo);
    165     Value * basisBitsBlock_ptr = getStreamSetBlockPtr(self, "basisBits", blockNo);
    166    
    167     Value * s_bytepack[8];
     164    Value * byteStream = getStreamSetBlockPtr(self, "byteStream", blockNo);
     165    Value * basisBits = getStreamSetBlockPtr(self, "basisBits", blockNo);
     166
     167    Value * bytepack[8];
    168168    for (unsigned i = 0; i < 8; i++) {
    169         s_bytepack[i] = iBuilder->CreateBlockAlignedLoad(byteStreamBlock_ptr, {iBuilder->getInt32(0), iBuilder->getInt32(0), iBuilder->getInt32(i)});
     169        bytepack[i] = iBuilder->CreateBlockAlignedLoad(byteStream, {iBuilder->getInt32(0), iBuilder->getInt32(0), iBuilder->getInt32(i)});
    170170    }
    171     Value * p_bitblock[8];
    172     s2p(iBuilder, s_bytepack, p_bitblock);
    173     for (unsigned j = 0; j < 8; ++j) {
    174         iBuilder->CreateBlockAlignedStore(p_bitblock[j], basisBitsBlock_ptr, {iBuilder->getInt32(0), iBuilder->getInt32(j)});
     171    Value * bitblock[8];
     172    s2p(iBuilder, bytepack, bitblock);
     173    for (unsigned i = 0; i < 8; ++i) {
     174        iBuilder->CreateBlockAlignedStore(bitblock[i], basisBits, {iBuilder->getInt32(0), iBuilder->getInt32(i)});
    175175    }
    176176    Value * produced = getProducedItemCount(self);
     
    180180   
    181181void s2pKernel::generateDoBlockMethod() {
    182     IDISA::IDISA_Builder::InsertPoint savePoint = iBuilder->saveIP();
    183     Module * m = iBuilder->getModule();
    184    
    185     Function * doBlockFunction = m->getFunction(mKernelName + doBlock_suffix);
     182    auto savePoint = iBuilder->saveIP();
     183
     184    Function * doBlockFunction = iBuilder->getModule()->getFunction(mKernelName + doBlock_suffix);
    186185   
    187186    iBuilder->SetInsertPoint(BasicBlock::Create(iBuilder->getContext(), "entry", doBlockFunction, 0));
     
    191190   
    192191    generateDoBlockLogic(self, blockNo);
     192
    193193    iBuilder->CreateRetVoid();
    194194    iBuilder->restoreIP(savePoint);
Note: See TracChangeset for help on using the changeset viewer.