Changeset 5499


Ignore:
Timestamp:
Jun 10, 2017, 12:51:29 AM (23 months ago)
Author:
nmedfort
Message:

Bug fix for source kernel.

File:
1 edited

Legend:

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

    r5497 r5499  
    243243
    244244    Value * const expandedCapacity = iBuilder->CreateShl(capacity, 1);
    245     Value * const expandedBuffer = iBuilder->CreatePointerCast(iBuilder->CreateCacheAlignedMalloc(expandedCapacity), codeUnitPtrTy);
    246     iBuilder->CreateMemCpy(expandedBuffer, unconsumedPtr, remaining, 1);
     245    Value * const expandedBuffer = iBuilder->CreateCacheAlignedMalloc(expandedCapacity);
     246    Value * const expandedBufferPtr = iBuilder->CreatePointerCast(expandedBuffer, codeUnitPtrTy);
     247    iBuilder->CreateMemCpy(expandedBufferPtr, unconsumedPtr, remaining, 1);
    247248    iBuilder->CreateFree(buffer);
    248249    iBuilder->setScalarField("buffer", expandedBuffer);
     
    254255    PHINode * const baseAddress = iBuilder->CreatePHI(codeUnitPtrTy, 2);
    255256    baseAddress->addIncoming(buffer, copyBack);
    256     baseAddress->addIncoming(expandedBuffer, expandAndCopyBack);
     257    baseAddress->addIncoming(expandedBufferPtr, expandAndCopyBack);
    257258    Value * const modifiedPtr = iBuilder->CreateGEP(baseAddress, remaining);
    258259    Value * const logicalAddress = iBuilder->CreateGEP(baseAddress, iBuilder->CreateNeg(consumed));
Note: See TracChangeset for help on using the changeset viewer.