Changeset 5602


Ignore:
Timestamp:
Aug 6, 2017, 3:45:11 PM (3 months ago)
Author:
lindanl
Message:

editd:some fixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/editd/editd_cpu_kernel.cpp

    r5440 r5602  
    2727
    2828void editdCPUKernel::generateDoBlockMethod(const std::unique_ptr<kernel::KernelBuilder> & idb) {
    29     auto savePoint = idb->saveIP();
    3029
    3130    Type * const int32ty = idb->getInt32Ty();
     
    4140    std::vector<std::vector<int>> calculated(mPatternLen, std::vector<int>(mEditDistance + 1, 0));
    4241    Value * pattPos = idb->getInt32(0);
    43     Value * pattPtr = idb->CreateGEP(pattStartPtr, pattPos);
    44     Value * pattCh = idb->CreateLoad(pattPtr);
     42    Value * pattCh = idb->CreateLoad(idb->CreateGEP(pattStartPtr, pattPos));
    4543    Value * pattIdx = idb->CreateAnd(idb->CreateLShr(pattCh, 1), ConstantInt::get(int8ty, 3));
    4644    Value * pattStream = idb->loadInputStreamBlock("CCStream", idb->CreateZExt(pattIdx, int32ty));
     
    5351
    5452    for(unsigned i = 1; i < mPatternLen; i++){
    55         pattPtr = idb->CreateGEP(pattStartPtr, pattPos);
    56         pattCh = idb->CreateLoad(pattPtr);
     53        pattCh = idb->CreateLoad(idb->CreateGEP(pattStartPtr, pattPos));
    5754        pattIdx = idb->CreateAnd(idb->CreateLShr(pattCh, 1), ConstantInt::get(int8ty, 3));
    5855        Value * pattStream = idb->loadInputStreamBlock("CCStream", idb->CreateZExt(pattIdx, int32ty));
     
    7774        idb->storeOutputStreamBlock("ResultStream", idb->getInt32(j), idb->CreateAnd(e[mPatternLen-1][j], idb->CreateNot(e[mPatternLen-1][j-1])));
    7875    }
    79        
    80     idb->CreateRetVoid();
    81     idb->restoreIP(savePoint);
    8276}
    8377
Note: See TracChangeset for help on using the changeset viewer.