Changeset 5038 for icGREP


Ignore:
Timestamp:
May 10, 2016, 2:10:45 PM (3 years ago)
Author:
xuedongx
Message:

Bug fixes for '-c'

File:
1 edited

Legend:

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

    r5037 r5038  
    138138        }
    139139        for (unsigned i = 0; i < segmentSize; ++i) {
    140             icGrepInstance->CreateDoBlockCall();
    141             if (CountOnly) {
    142                 Value * popcount_for = Cal_Count(icGrepInstance, iBuilder);
    143                 Value * temp_countfor = iBuilder->CreateLoad(count);
    144                 Value * add_for = iBuilder->CreateAdd(temp_countfor, popcount_for);
    145                 iBuilder->CreateStore(add_for, count);
    146             }
     140            Value * match = (icGrepInstance->getOutputStream(0, 0));
     141            icGrepInstance->CreateDoBlockCall();
     142            Value * temp = iBuilder->CreateLoad(match);
     143            Value * matches = iBuilder->CreateBitCast(temp, iBuilder->getIntNTy(mBlockSize));
     144            Value * popcount_for = generatePopcount(iBuilder, matches);
     145            if(CountOnly){
     146                Value * temp_count = iBuilder->CreateLoad(count);
     147                Value * prev_count = iBuilder->CreateBitCast(temp_count, iBuilder->getIntNTy(mBlockSize));
     148                Value * add_for = iBuilder->CreateAdd(prev_count, popcount_for);
     149                iBuilder->CreateStore(add_for, count);
     150            }
    147151        }
    148152        if (!CountOnly) {
Note: See TracChangeset for help on using the changeset viewer.