Ignore:
Timestamp:
May 21, 2018, 9:49:22 PM (13 months ago)
Author:
cameron
Message:

Various small fixes

File:
1 edited

Legend:

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

    r6047 r6055  
    77#include <vector>
    88#include <llvm/Support/raw_ostream.h>
     9#include <llvm/IR/Intrinsics.h>
    910
    1011
     
    2425        Value* extractIndex = b->CreateURem(i64PackIndex, b->getSize(4));
    2526
    26         for (int i = 0; i < mNumberOfStreams; i++) {
     27        for (unsigned i = 0; i < mNumberOfStreams; i++) {
    2728            Value* bitBlockPtr =  b->CreateGEP(basePtr, b->CreateAdd(b->CreateMul(bitBlockIndex, b->getSize(mNumberOfStreams)), b->getSize(i)));
    2829            bitBlockPtr = b->CreatePointerCast(bitBlockPtr, b->getInt64Ty()->getPointerTo());
     
    189190                                                                                 carryCopyFromBlockIndex);
    190191
    191         for (int i = 0; i < mNumberOfStreams; i++) {
     192        for (unsigned i = 0; i < mNumberOfStreams; i++) {
    192193            Value* v = initSourceDataWithCarry[i];
    193194            v = b->CreateLShr(v, carryCopyFromOffset);
     
    210211
    211212        std::vector<PHINode*> outputData;
    212         for (int i = 0; i < mNumberOfStreams; i++) {
     213        for (unsigned i = 0; i < mNumberOfStreams; i++) {
    213214            PHINode* outputValue = b->CreatePHI(b->getInt64Ty(), 3);
    214215            outputValue->addIncoming(initSourceData[i], processLoopBody);
     
    285286
    286287        vector<Value*> pdepSourceData;
    287         for (int i = 0; i < mNumberOfStreams; i++) {
     288        for (unsigned i = 0; i < mNumberOfStreams; i++) {
    288289            Value* fromBlockValue = fromBlockValues[i];
    289290            // when dataBlockIndex == matchCopyFromBlockIndex, we need to use current output value as input
     
    345346        b->SetInsertPoint(doubleSourceDataExit);
    346347        // At this point, we can guarantee we have enough data for pdep
    347         for (int i = 0; i < mNumberOfStreams; i++) {
     348        for (unsigned i = 0; i < mNumberOfStreams; i++) {
    348349            // Do Match Copy by PDEP
    349350            Value* source_field = phiPdepSourceData[i];
     
    391392        Value* extractIndex = b->CreateURem(i64PackIndex, b->getSize(4));
    392393
    393         for (int i = 0; i < mNumberOfStreams; i++) {
     394        for (unsigned i = 0; i < mNumberOfStreams; i++) {
    394395            Value* bitBlockPtr =  b->CreateGEP(basePtr, b->CreateAdd(b->CreateMul(bitBlockIndex, b->getSize(mNumberOfStreams)), b->getSize(i)));
    395396            bitBlockPtr = b->CreatePointerCast(bitBlockPtr, b->getInt64Ty()->getPointerTo());
Note: See TracChangeset for help on using the changeset viewer.