Ignore:
Timestamp:
Jun 6, 2017, 6:20:55 PM (2 years ago)
Author:
cameron
Message:

Restore check-ins from the last several days

File:
1 edited

Legend:

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

    r5486 r5493  
    150150    Type * i8ptr = iBuilder->getInt8PtrTy();
    151151    unsigned alignment = iBuilder->getBitBlockWidth() / 8;
    152     unsigned numStreams = getType()->getArrayNumElements();
    153     auto elemTy = getType()->getArrayElementType();
    154     unsigned fieldWidth = isa<ArrayType>(elemTy) ? elemTy->getArrayNumElements() : 1;
     152    uint64_t numStreams = 1;
     153    if (isa<ArrayType>(mBaseType)) {
     154        numStreams = mBaseType->getArrayNumElements();
     155    }
     156    const auto fieldWidth = mBaseType->getArrayElementType()->getScalarSizeInBits();
    155157    Value * blockCopyBytes = iBuilder->CreateMul(blocksToCopy, iBuilder->getSize(iBuilder->getBitBlockWidth() * numStreams * fieldWidth/8));
    156158    iBuilder->CreateMemMove(iBuilder->CreateBitCast(targetBlockPtr, i8ptr), iBuilder->CreateBitCast(sourceBlockPtr, i8ptr), blockCopyBytes, alignment);
     
    161163    const unsigned alignment = iBuilder->getBitBlockWidth() / 8;
    162164    Constant * const blockSize = iBuilder->getSize(iBuilder->getBitBlockWidth());
    163     const unsigned numStreams = getType()->getArrayNumElements();
    164     const auto elemTy = getType()->getArrayElementType();
    165     const auto fieldWidth = isa<ArrayType>(elemTy) ? elemTy->getArrayNumElements() : 1;
     165    uint64_t numStreams = 1;
     166    if (isa<ArrayType>(mBaseType)) {
     167        numStreams = mBaseType->getArrayNumElements();
     168    }
     169    const auto fieldWidth = mBaseType->getArrayElementType()->getScalarSizeInBits();
    166170    if (numStreams == 1) {
    167171        Value * copyBits = iBuilder->CreateMul(itemsToCopy, iBuilder->getSize(fieldWidth));
Note: See TracChangeset for help on using the changeset viewer.