Ignore:
Timestamp:
Apr 11, 2018, 5:48:08 PM (13 months ago)
Author:
nmedfort
Message:

Updated LZ4SwizzledMatchCopy + minor changes

File:
1 edited

Legend:

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

    r5957 r5967  
    8282            itemCount = CreateExactUDiv(itemCount, ConstantInt::get(itemCount->getType(), r.denominator()));
    8383        }
    84     } else if (LLVM_UNLIKELY(rate.isPopCount())) {
    85         Port port; unsigned index;
    86         std::tie(port, index) = mKernel->getStreamPort(rate.getReference());
    87 
    88 
    89 
    90 
    9184    } else {
    9285        itemCount = getScalarField(name + suffix);
     
    422415    Value * const addr = mKernel->getStreamSetInputAddress(name);
    423416    if (addr) {
    424         return CreateGEP(addr, {blockOffset, streamIndex});
     417        return CreateGEP(addr, {blockOffset ? blockOffset : getInt32(0), streamIndex});
    425418    } else {
    426419        const StreamSetBuffer * const buf = mKernel->getInputStreamSetBuffer(name);
    427420        Value * blockIndex = CreateLShr(getProcessedItemCount(name), std::log2(getBitBlockWidth()));
    428         blockIndex = CreateAdd(blockIndex, blockOffset);
     421        if (blockOffset) {
     422            assert (blockIndex->getType() == blockOffset->getType());
     423            blockIndex = CreateAdd(blockIndex, blockOffset);
     424        }
    429425        return buf->getStreamBlockPtr(this, getStreamHandle(name), getBaseAddress(name), streamIndex, blockIndex, true);
    430426    }
     
    434430    Value * const addr = mKernel->getStreamSetOutputAddress(name);
    435431    if (addr) {
    436         return CreateGEP(addr, {blockOffset, streamIndex});
     432        return CreateGEP(addr, {blockOffset ? blockOffset : getInt32(0), streamIndex});
    437433    } else {
    438434        const StreamSetBuffer * const buf = mKernel->getOutputStreamSetBuffer(name);
    439         Value * const blockIndex = CreateLShr(getProducedItemCount(name), std::log2(getBitBlockWidth()));
     435        Value * blockIndex = CreateLShr(getProducedItemCount(name), std::log2(getBitBlockWidth()));
     436        if (blockOffset) {
     437            assert (blockIndex->getType() == blockOffset->getType());
     438            blockIndex = CreateAdd(blockIndex, blockOffset);
     439        }
    440440        return buf->getStreamBlockPtr(this, getStreamHandle(name), getBaseAddress(name), streamIndex, blockIndex, false);
    441441    }
Note: See TracChangeset for help on using the changeset viewer.