Changeset 6038


Ignore:
Timestamp:
May 14, 2018, 11:42:21 AM (7 days ago)
Author:
xwa163
Message:

revert r6035

File:
1 edited

Legend:

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

    r6037 r6038  
    124124    Type * fieldTy = kb->getIntNTy(mPEXTWidth);
    125125    Type * fieldPtrTy = PointerType::get(fieldTy, 0);
    126     Constant * fieldTyZero = kb->getIntN(mPEXTWidth, 0);
    127126    Constant * PEXT_func = nullptr;
    128127    Constant * popc_func = Intrinsic::getDeclaration(getModule(), Intrinsic::ctpop, fieldTy);
     
    146145    Value * unitCountPtr = kb->getOutputStreamBlockPtr("unitCounts", ZERO, blockOffsetPhi);
    147146    unitCountPtr = kb->CreatePointerCast(unitCountPtr, fieldPtrTy);
    148 
    149     Value* remainingMask = kb->getAvailableItemCount("extractionMask");
    150     Value* PEXTWidth = kb->getSize(mPEXTWidth);
    151147    for (unsigned i = 0; i < fieldsPerBlock; i++) {
    152148        mask[i] = kb->CreateLoad(kb->CreateGEP(extractionMaskPtr, kb->getInt32(i)));
    153         Value* hasFullMask = kb->CreateICmpUGE(remainingMask, PEXTWidth);
    154         Value* shiftAmount = kb->CreateSub(PEXTWidth, remainingMask);
    155         Value * targetMask = kb->CreateSelect(
    156                 hasFullMask,
    157                 mask[i],
    158                 kb->CreateShl(mask[i], shiftAmount)
    159         );
    160         targetMask = kb->CreateSelect(kb->CreateICmpEQ(remainingMask, kb->getSize(0)), fieldTyZero, targetMask);
    161         Value * popc = kb->CreateCall(popc_func, targetMask);
     149        Value * popc = kb->CreateCall(popc_func, mask[i]);
    162150        kb->CreateStore(popc, kb->CreateGEP(unitCountPtr, kb->getInt32(i)));
    163         remainingMask = kb->CreateSelect(
    164                 hasFullMask,
    165                 kb->CreateSub(remainingMask, kb->getSize(mPEXTWidth)),
    166                 kb->getSize(0)
    167         );
    168151    }
    169152    for (unsigned j = 0; j < mStreamCount; ++j) {
Note: See TracChangeset for help on using the changeset viewer.