Ignore:
Timestamp:
Jan 14, 2017, 3:49:56 PM (3 years ago)
Author:
nmedfort
Message:

Changes working towards simplifying accessing stream elements + some modifications to simplify include / forward declarations within the CodeGen? library.

File:
1 edited

Legend:

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

    r5252 r5260  
    33 *  This software is licensed to the public under the Open Software License 3.0.
    44 */
     5
    56#include "s2p_kernel.h"
    6 #include <kernels/kernel.h>
    7 #include <IR_Gen/idisa_builder.h>
    8 #include <llvm/Support/raw_ostream.h>
     7#include <IR_Gen/idisa_builder.h>  // for IDISA_Builder
     8#include <llvm/IR/Constant.h>      // for Constant
     9#include <llvm/IR/Module.h>
     10namespace llvm { class BasicBlock; }
     11namespace llvm { class Function; }
     12namespace llvm { class Value; }
     13
     14using namespace llvm;
    915
    1016namespace kernel {
    11 using namespace llvm;
    1217
    1318const int PACK_LANES = 1;
     
    151156    iBuilder->SetInsertPoint(finalEmptyBlock);
    152157    Value * blockNo = getScalarField(self, blockNoScalar);
    153     Value * basisBitsBlock_ptr = getStreamSetBlockPtr(self, "basisBits", blockNo);
    154     iBuilder->CreateStore(Constant::getNullValue(basisBitsBlock_ptr->getType()->getPointerElementType()), basisBitsBlock_ptr);
     158    Value * basisBitsPtr = getStreamView(self, "basisBits", blockNo, iBuilder->getInt64(0));
     159    iBuilder->CreateStore(Constant::getNullValue(basisBitsPtr->getType()->getPointerElementType()), basisBitsPtr);
    155160    iBuilder->CreateBr(exitBlock);
    156161   
     
    159164    iBuilder->restoreIP(savePoint);
    160165}
    161 
    162166   
    163167void S2PKernel::generateDoBlockLogic(Value * self, Value * blockNo) const {
    164 
    165     Value * byteStream = getStreamSetBlockPtr(self, "byteStream", blockNo);
    166     Value * basisBits = getStreamSetBlockPtr(self, "basisBits", blockNo);
    167 
    168168    Value * bytepack[8];
    169169    for (unsigned i = 0; i < 8; i++) {
    170         Value * ptr = iBuilder->CreateGEP(byteStream, {iBuilder->getInt32(0), iBuilder->getInt32(0), iBuilder->getInt32(i)});
    171         bytepack[i] = iBuilder->CreateBlockAlignedLoad(ptr);
     170        Value * byteStream = getStream(self, "byteStream", blockNo, iBuilder->getInt32(0), iBuilder->getInt32(i));
     171        bytepack[i] = iBuilder->CreateBlockAlignedLoad(byteStream);
    172172    }
    173173    Value * basisbits[8];
    174174    s2p(iBuilder, bytepack, basisbits);
    175175    for (unsigned i = 0; i < 8; ++i) {
    176         iBuilder->CreateBlockAlignedStore(basisbits[i], basisBits, {iBuilder->getInt32(0), iBuilder->getInt32(i)});
     176        Value * basisBits = getStream(self, "basisBits", blockNo, iBuilder->getInt32(i));
     177        iBuilder->CreateBlockAlignedStore(basisbits[i], basisBits);
    177178    }
    178179    Value * produced = getProducedItemCount(self, "basisBits");
Note: See TracChangeset for help on using the changeset viewer.