Ignore:
Timestamp:
Jan 29, 2017, 12:05:00 PM (2 years ago)
Author:
nmedfort
Message:

Continuation of work to simplify Kernel writing

File:
1 edited

Legend:

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

    r5285 r5286  
    4141// a continous buffer for the full segment (number of blocks).
    4242
    43 void expand3_4Kernel::generateDoSegmentMethod() const {
    44     IDISA::IDISA_Builder::InsertPoint savePoint = iBuilder->saveIP();
    45     Module * m = iBuilder->getModule();
    46     Function * doSegmentFunction = m->getFunction(mKernelName + doSegment_suffix);
    47     BasicBlock * expand2_3entry = BasicBlock::Create(iBuilder->getContext(), "expand2_3entry", doSegmentFunction, 0);
    48     iBuilder->SetInsertPoint(expand2_3entry);
     43void expand3_4Kernel::generateDoSegmentMethod(Function * doSegmentFunction, Value *self, Value *doFinal, const std::vector<Value *> &producerPos) const {
     44
     45    BasicBlock * expand2_3entry = iBuilder->GetInsertBlock();
    4946    BasicBlock * expand_3_4_loop = BasicBlock::Create(iBuilder->getContext(), "expand_3_4_loop", doSegmentFunction, 0);
    5047    BasicBlock * expand3_4_loop_exit = BasicBlock::Create(iBuilder->getContext(), "expand3_4_loop_exit", doSegmentFunction, 0);
     
    9188    const unsigned packAlign = iBuilder->getBitBlockWidth()/8;
    9289
    93     Function::arg_iterator args = doSegmentFunction->arg_begin();
    94     Value * self = &*(args++);
    95     Value * doFinal = &*(args++);
    96     Value * producerPos = &*(args++);
    9790    Value * processed = getProcessedItemCount(self, "sourceStream");
    98     Value * itemsAvail = iBuilder->CreateSub(producerPos, processed);
     91    Value * itemsAvail = iBuilder->CreateSub(producerPos[0], processed);
    9992   
    10093    //
     
    256249    iBuilder->CreateBr(expand3_4_exit);
    257250    iBuilder->SetInsertPoint(expand3_4_exit);
    258     iBuilder->CreateRetVoid();
    259     iBuilder->restoreIP(savePoint);
    260251}
    261252
Note: See TracChangeset for help on using the changeset viewer.