Changeset 5846


Ignore:
Timestamp:
Jan 29, 2018, 12:33:30 PM (13 months ago)
Author:
xwa163
Message:

Fix bug of KernelBuilder::CreateStreamCpy? when handling copy back of StreamSet? buffer

File:
1 edited

Legend:

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

    r5830 r5846  
    237237    Type * const fieldWidthTy = getIntNTy(fieldWidth);
    238238
    239     Value * const n = buf->getStreamSetCount(this, getStreamHandle(name));
     239    Value * n = buf->getStreamSetCount(this, getStreamHandle(name));
    240240
    241241    if (isConstantOne(n) || fieldWidth == blockWidth || (isConstantZero(targetOffset) && isConstantZero(sourceOffset))) {
     
    260260
    261261    } else { // either the target offset or source offset is non-zero but not both
     262        auto t = getIntNTy(fieldWidth * buf->getNumOfStreams());
     263        PointerType * const ptrTy = t->getPointerTo();
     264        target = CreateGEP(CreatePointerCast(target, ptrTy), targetOffset);
     265        source = CreateGEP(CreatePointerCast(source, ptrTy), sourceOffset);
     266        n = this->CreateUDiv(n, this->getSize(buf->getNumOfStreams()));
    262267
    263268        VectorType * const blockTy = getBitBlockType();
Note: See TracChangeset for help on using the changeset viewer.