Ignore:
Timestamp:
Jun 7, 2018, 11:59:41 AM (11 months ago)
Author:
xwa163
Message:

fix some warning in lz4 related kernels

File:
1 edited

Legend:

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

    r6055 r6066  
    103103    Value* m0MarkerBasePtr = iBuilder->CreatePointerCast(iBuilder->getInputStreamBlockPtr("M0Marker", SIZE_0), I64_PTR_TY); // i64*
    104104    vector<Value*> sourceStreamBasePtrs, outputStreamBasePtrs; // <4 * i64>*
    105     for (int i = 0; i < mStreamSize; i++) {
     105    for (unsigned i = 0; i < mStreamSize; i++) {
    106106        sourceStreamBasePtrs.push_back(iBuilder->CreatePointerCast(iBuilder->getInputStreamBlockPtr("sourceStreamSet" + std::to_string(i), SIZE_0), BITBLOCK_PTR_TYPE));
    107107        outputStreamBasePtrs.push_back(iBuilder->CreatePointerCast(iBuilder->getOutputStreamBlockPtr("outputStreamSet" + std::to_string(i), SIZE_0), BITBLOCK_PTR_TYPE));
     
    137137    Value* currentInitM0 = iBuilder->CreateLoad(iBuilder->CreateGEP(m0MarkerBasePtr, dataBlockIndex));
    138138    vector<Value*> initSourceData;
    139     for (int i = 0; i < mStreamSize; i++) {
     139    for (unsigned i = 0; i < mStreamSize; i++) {
    140140        // Because of swizzled form, the sourceStream can be accessed linearly
    141141        initSourceData.push_back(iBuilder->CreateLoad(iBuilder->CreateGEP(sourceStreamBasePtrs[i], dataBlockIndex)));
     
    171171    Value* carryCopyFromBlockIndex = iBuilder->CreateUDiv(carryCopyFromPos, SIZE_64);
    172172    Value* carryCopyFromOffset = iBuilder->CreateURem(carryCopyFromPos, SIZE_64);
    173     for (int i = 0; i < mStreamSize; i++) {
     173    for (unsigned i = 0; i < mStreamSize; i++) {
    174174        Value* v = iBuilder->CreateLoad(iBuilder->CreateGEP(outputStreamBasePtrs[i], carryCopyFromBlockIndex));
    175175        v = iBuilder->CreateLShr(v, iBuilder->simd_fill(mPDEPWidth, carryCopyFromOffset));
     
    192192
    193193    vector<PHINode*> outputData;
    194     for (int i = 0; i < mStreamSize; i++) {
     194    for (unsigned i = 0; i < mStreamSize; i++) {
    195195        PHINode* outputValue = iBuilder->CreatePHI(iBuilder->getBitBlockType(), 3);
    196196        outputValue->addIncoming(initSourceData[i], processLoopBody);
     
    265265    vector<Value*> pdepSourceData;
    266266
    267     for (int i = 0; i < mStreamSize; i++) {
     267    for (unsigned i = 0; i < mStreamSize; i++) {
    268268        Value* fromPtr = iBuilder->CreateGEP(outputStreamBasePtrs[i], matchCopyFromBlockIndex);
    269269        Value* fromBlockValue = iBuilder->CreateLoad(fromPtr);
     
    306306    phiSourceDataAccessable->addIncoming(phiTargetMatchOffset, doMatchCopyBlock);
    307307    vector<PHINode*> phiPdepSourceData;
    308     for (int i = 0; i < mStreamSize; i++) {
     308    for (unsigned i = 0; i < mStreamSize; i++) {
    309309        PHINode* v = iBuilder->CreatePHI(iBuilder->getBitBlockType(), 2);
    310310        v->addIncoming(pdepSourceData[i], doMatchCopyBlock);
     
    315315    // ---- doubleSourceDataBody
    316316    iBuilder->SetInsertPoint(doubleSourceDataBody);
    317     for (int i = 0; i < mStreamSize; i++) {
     317    for (unsigned i = 0; i < mStreamSize; i++) {
    318318        PHINode* v = phiPdepSourceData[i];
    319319        Value* newValue = iBuilder->CreateOr(v, iBuilder->CreateShl(v, iBuilder->simd_fill(mPDEPWidth, phiSourceDataAccessable)));
     
    327327    iBuilder->SetInsertPoint(doubleSourceDataExit);
    328328    // At this point, we can guarantee we have enough data for pdep
    329     for (int i = 0; i < mStreamSize; i++) {
     329    for (unsigned i = 0; i < mStreamSize; i++) {
    330330        // Do Match Copy by PDEP
    331331        Value* allFromValue = phiPdepSourceData[i];
     
    347347    // ---- MatchCopyLoopExit
    348348    iBuilder->SetInsertPoint(matchCopyLoopExit);
    349     for (int i = 0; i < mStreamSize; i++) {
     349    for (unsigned i = 0; i < mStreamSize; i++) {
    350350        iBuilder->CreateStore(outputData[i], iBuilder->CreateGEP(outputStreamBasePtrs[i], dataBlockIndex));
    351351    }
Note: See TracChangeset for help on using the changeset viewer.