Ignore:
Timestamp:
Sep 21, 2017, 3:10:34 PM (2 years ago)
Author:
nmedfort
Message:

Minor clean up. Bug fix for object cache when the same cached kernel is used twice in a single run. Improvement to RE Minimizer.

File:
1 edited

Legend:

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

    r5641 r5646  
    140140}
    141141
    142 Value * StreamSetBuffer::getLinearlyAccessibleItems(IDISA::IDISA_Builder * const iBuilder, Value * self, Value * fromPosition, bool reverse) const {
     142Value * StreamSetBuffer::getLinearlyAccessibleItems(IDISA::IDISA_Builder * const iBuilder, Value * self, Value * fromPosition, bool reverse, const unsigned lookAhead) const {
    143143    Constant * bufSize = iBuilder->getSize(mBufferBlocks * iBuilder->getStride());
    144144    Value * bufRem = iBuilder->CreateURem(fromPosition, bufSize);
     
    149149}
    150150
    151 Value * StreamSetBuffer::getLinearlyAccessibleBlocks(IDISA::IDISA_Builder * const iBuilder, Value * self, Value * fromBlock, bool reverse) const {
     151Value * StreamSetBuffer::getLinearlyAccessibleBlocks(IDISA::IDISA_Builder * const iBuilder, Value * self, Value * fromBlock, bool reverse, const unsigned lookAhead) const {
    152152    Constant * bufBlocks = iBuilder->getSize(mBufferBlocks);
    153153    Value * bufRem = iBuilder->CreateURem(fromBlock, bufBlocks);
     
    264264}
    265265
    266 Value * SourceBuffer::getLinearlyAccessibleItems(IDISA::IDISA_Builder * const iBuilder, Value * self, Value * fromPosition, bool reverse) const {
     266Value * SourceBuffer::getLinearlyAccessibleItems(IDISA::IDISA_Builder * const iBuilder, Value * self, Value * fromPosition, bool reverse, const unsigned lookAhead) const {
    267267    if (reverse) report_fatal_error("SourceBuffer cannot be accessed in reverse");
    268268    return iBuilder->CreateSub(getCapacity(iBuilder, self), fromPosition);
    269269}
    270270
    271 Value * SourceBuffer::getLinearlyAccessibleBlocks(IDISA::IDISA_Builder * const iBuilder, Value * self, Value * fromBlock, bool reverse) const {
     271Value * SourceBuffer::getLinearlyAccessibleBlocks(IDISA::IDISA_Builder * const iBuilder, Value * self, Value * fromBlock, bool reverse, const unsigned lookAhead) const {
    272272    if (reverse) report_fatal_error("SourceBuffer cannot be accessed in reverse");
    273273    return iBuilder->CreateSub(iBuilder->CreateUDiv(getCapacity(iBuilder, self), iBuilder->getSize(iBuilder->getBitBlockWidth())), fromBlock);
     
    301301}
    302302
    303 Value * ExternalBuffer::getLinearlyAccessibleItems(IDISA::IDISA_Builder * const, Value *, Value *, bool reverse) const {
     303Value * ExternalBuffer::getLinearlyAccessibleItems(IDISA::IDISA_Builder * const, Value *, Value *, bool, const unsigned) const {
    304304    report_fatal_error("External buffers: getLinearlyAccessibleItems is not supported.");
    305305}
     
    591591}
    592592
    593 Value * ExpandableBuffer::getLinearlyAccessibleItems(IDISA::IDISA_Builder * const iBuilder, Value * self, Value *, bool reverse) const {
     593Value * ExpandableBuffer::getLinearlyAccessibleItems(IDISA::IDISA_Builder * const, Value *, Value *, bool, const unsigned) const {
    594594    report_fatal_error("Expandable buffers: getLinearlyAccessibleItems is not supported.");
    595595}
     
    682682
    683683
    684 Value * DynamicBuffer::getLinearlyAccessibleItems(IDISA::IDISA_Builder * const b, Value * handle, Value * fromPosition, bool reverse) const {
     684Value * DynamicBuffer::getLinearlyAccessibleItems(IDISA::IDISA_Builder * const b, Value * handle, Value * fromPosition, bool reverse, const unsigned lookAhead) const {
    685685    Constant * blockSize = b->getSize(b->getBitBlockWidth());
    686686    Value * const bufBlocks = b->CreateLoad(b->CreateGEP(handle, {b->getInt32(0), b->getInt32(int(Field::WorkingBlocks))}));
     
    690690        return b->CreateSelect(b->CreateICmpEQ(bufRem, b->getSize(0)), bufSize, bufRem);
    691691    }
    692     else return b->CreateSub(bufSize, bufRem, "linearItems");
     692    return b->CreateSub(bufSize, bufRem, "linearItems");
    693693}
    694694
     
    699699}
    700700
    701 Value * DynamicBuffer::getLinearlyAccessibleBlocks(IDISA::IDISA_Builder * const b, Value * handle, Value * fromBlock, bool reverse) const {
     701Value * DynamicBuffer::getLinearlyAccessibleBlocks(IDISA::IDISA_Builder * const b, Value * handle, Value * fromBlock, bool reverse, const unsigned lookAhead) const {
    702702    Value * const bufBlocks = b->CreateLoad(b->CreateGEP(handle, {b->getInt32(0), b->getInt32(int(Field::WorkingBlocks))}));
    703703    Value * bufRem = b->CreateURem(fromBlock, bufBlocks);
     
    705705        return b->CreateSelect(b->CreateICmpEQ(bufRem, b->getSize(0)), bufBlocks, bufRem);
    706706    }
    707     else return b->CreateSub(bufBlocks, bufRem, "linearBlocks");
     707    return b->CreateSub(bufBlocks, bufRem, "linearBlocks");
    708708}
    709709
Note: See TracChangeset for help on using the changeset viewer.