Ignore:
Timestamp:
Jan 28, 2017, 3:12:03 PM (2 years ago)
Author:
nmedfort
Message:

Start of work to simplify kernel writing. Removed generateDoBlockLogic method.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/pablo/pablo_compiler.cpp

    r5283 r5285  
    4848}
    4949   
    50 void PabloCompiler::compile(Value * const self, Function * function) {
    51 
    52     // Make sure that we generate code into the right module.
     50void PabloCompiler::compile(Function * function, Value * const self, Value * const blockNo) {
     51
    5352    mSelf = self;
     53
    5454    mFunction = function;
    55 
    56     //Generate Kernel//
    57     iBuilder->SetInsertPoint(BasicBlock::Create(iBuilder->getContext(), "entry", function, 0));
    5855
    5956    mCarryManager->initializeCodeGen(self, function);
     
    6259    mMarker.emplace(entryBlock->createZeroes(), iBuilder->allZeroes());
    6360    mMarker.emplace(entryBlock->createOnes(), iBuilder->allOnes());
    64 
    65     Value * const blockNo = mKernel->getScalarField(mSelf, blockNoScalar);
    6661
    6762    for (unsigned i = 0; i < mKernel->getNumOfInputs(); ++i) {
     
    482477            const unsigned block_shift = (l->getAmount() / iBuilder->getBitBlockWidth());
    483478            std::string inputName = cast<Var>(var)->getName().str();
    484             Value * blockNo = mKernel->getScalarField(mSelf, blockNoScalar);
     479            Value * blockNo = mKernel->getBlockNo(mSelf);
    485480            Value * lookAhead_blockPtr  = mKernel->getStreamSetPtr(mSelf, inputName, iBuilder->CreateAdd(blockNo, iBuilder->getSize(block_shift)));
    486481            Value * lookAhead_inputPtr = iBuilder->CreateGEP(lookAhead_blockPtr, {iBuilder->getInt32(0), iBuilder->getInt32(index)});
Note: See TracChangeset for help on using the changeset viewer.