Changeset 6205


Ignore:
Timestamp:
Nov 19, 2018, 2:55:53 PM (5 months ago)
Author:
cameron
Message:

Fixes for AbortOnNull?

Location:
icGREP/icgrep-devel/icgrep
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/grep/grep_engine.h

    r6203 r6205  
    3636public:
    3737    GrepCallBackObject() : mBinaryFile(false) {}
     38    virtual ~GrepCallBackObject() {}
    3839    virtual void handle_signal(unsigned signal);
    3940    bool binaryFileSignalled() {return mBinaryFile;}
     
    4546public:
    4647    MatchAccumulator() {}
     48    virtual ~MatchAccumulator() {}
    4749    virtual void accumulate_match(const size_t lineNum, char * line_start, char * line_end) = 0;
    4850    virtual void finalize_match(char * buffer_end) {}  // default: no op
  • icGREP/icgrep-devel/icgrep/kernels/grep_kernel.cpp

    r6203 r6205  
    429429
    430430    Value * const numOfBlocks = b->CreateMul(numOfStrides, BLOCKS_PER_STRIDE);
    431     Value * availItems = b->getAvailableItemCount("byteData");
     431    Value * itemsToDo = b->getAccessibleItemCount("byteData");
    432432    //
    433433    // Fast loop to prove that there are no null bytes in a multiblock region.
     
    481481   
    482482    b->SetInsertPoint(finalStride);
    483     b->CreateMemCpy(b->CreatePointerCast(outputStreamBasePtr, voidPtrTy), b->CreatePointerCast(byteStreamBasePtr, voidPtrTy), availItems, 1);
     483    b->CreateMemCpy(b->CreatePointerCast(outputStreamBasePtr, voidPtrTy), b->CreatePointerCast(byteStreamBasePtr, voidPtrTy), itemsToDo, 1);
    484484    b->CreateBr(nullByteDetection);
    485485   
     
    487487    //  Find the exact location using memchr, which should be fast enough.
    488488    //
    489     Value * ptrToNull = b->CreateMemChr(b->CreatePointerCast(byteStreamBasePtr, voidPtrTy), b->getInt32(0), availItems);
     489    Value * ptrToNull = b->CreateMemChr(b->CreatePointerCast(byteStreamBasePtr, voidPtrTy), b->getInt32(0), itemsToDo);
    490490    Value * ptrAddr = b->CreatePtrToInt(ptrToNull, intPtrTy);
    491491    b->CreateCondBr(b->CreateICmpEQ(ptrAddr, ConstantInt::getNullValue(intPtrTy)), segmentDone, nullByteFound);
     
    503503    PHINode * const produced = b->CreatePHI(b->getSizeTy(), 3);
    504504    produced->addIncoming(nullPosn, nullByteFound);
    505     produced->addIncoming(availItems, stridesDone);
    506     produced->addIncoming(availItems, nullByteDetection);
     505    produced->addIncoming(itemsToDo, stridesDone);
     506    produced->addIncoming(itemsToDo, nullByteDetection);
    507507    Value * producedCount = b->getProducedItemCount("untilNull");
    508508    producedCount = b->CreateAdd(producedCount, produced);
Note: See TracChangeset for help on using the changeset viewer.