Changeset 5783


Ignore:
Timestamp:
Dec 16, 2017, 2:19:11 AM (9 months ago)
Author:
nmedfort
Message:

Bug fix

File:
1 edited

Legend:

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

    r5782 r5783  
    792792
    793793            b->SetInsertPoint(copyFromBack);
    794             Value * const temporarySize = b->CreateMul(tempBuffer->getArraySize(), b->getSize(mStride));
     794            Value * const arraySize = b->CreateZExt(tempBuffer->getArraySize(), b->getInt64Ty());
     795            Value * const temporarySize = b->CreateTrunc(b->CreateMul(arraySize, b->getInt64(mStride)), unprocessed->getType());
    795796            Value * const temporaryAvailable = b->CreateUMin(unprocessed, temporarySize);
    796797            if (LLVM_UNLIKELY(codegen::DebugOptionIsSet(codegen::EnableAsserts))) {
     
    799800            }
    800801            Value * const offset = b->CreateAnd(processed, BLOCK_WIDTH_MASK);
    801             Value * const bufferSize = b->CreateMul(ConstantExpr::getSizeOf(tempBuffer->getAllocatedType()), tempBuffer->getArraySize());
     802            Value * const bufferSize = b->CreateMul(ConstantExpr::getSizeOf(tempBuffer->getAllocatedType()), arraySize);
    802803            b->CreateMemZero(tempBuffer, bufferSize, blockAlignment);
    803804            const auto copyAlignment = getItemAlignment(mStreamSetInputs[i]);
Note: See TracChangeset for help on using the changeset viewer.