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

Various small fixes

File:
1 edited

Legend:

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

    r6043 r6055  
    44#include <llvm/Support/raw_ostream.h>
    55#include <toolchain/toolchain.h>
     6#include <llvm/IR/Intrinsics.h>
    67
    78using namespace llvm;
     
    5152        std::vector<PHINode*> bufferVecPhiArray(mNumberOfStream / 4, NULL);
    5253        std::vector<Value*> bufferVecArray(mNumberOfStream / 4, NULL);
    53         for (int iStreamSetIndex = 0; iStreamSetIndex < mNumberOfStream; iStreamSetIndex += 4) {
     54        for (unsigned iStreamSetIndex = 0; iStreamSetIndex < mNumberOfStream; iStreamSetIndex += 4) {
    5455            PHINode * const bufferPhi = b->CreatePHI(b->getBitBlockType(), 2, "bufferPhi");
    5556            bufferPhi->addIncoming(Constant::getNullValue(b->getBitBlockType()), entry);
     
    9798
    9899            std::vector<PHINode * > updatedBufferVecArray(mNumberOfStream / 4, NULL);
    99             for (int iStreamSetIndex = 0; iStreamSetIndex < mNumberOfStream; iStreamSetIndex += 4) {
     100            for (unsigned iStreamSetIndex = 0; iStreamSetIndex < mNumberOfStream; iStreamSetIndex += 4) {
    100101                Value* buffer = bufferVecArray[iStreamSetIndex / 4];
    101102                PHINode * const updatedBuffer = b->CreatePHI(buffer->getType(), 2);
     
    111112
    112113
    113             for (int iStreamSetIndex = 0; iStreamSetIndex < mNumberOfStream; iStreamSetIndex += 4) {
     114            for (unsigned iStreamSetIndex = 0; iStreamSetIndex < mNumberOfStream; iStreamSetIndex += 4) {
    114115                // gather instruction can process 4 streams each time
    115116                Value *streamSetBlockBasePtr = b->getInputStreamBlockPtr("source", b->getSize(iStreamSetIndex),
     
    165166            Value * const mask = b->CreateExtractElement(selectors, i);
    166167
    167             for (int iStreamSetIndex = 0; iStreamSetIndex < mNumberOfStream; iStreamSetIndex += 4) {
     168            for (unsigned iStreamSetIndex = 0; iStreamSetIndex < mNumberOfStream; iStreamSetIndex += 4) {
    168169                Value * source_field = bufferVecArray[iStreamSetIndex / 4];
    169                 for (int iStreamIndex = iStreamSetIndex; iStreamIndex < iStreamSetIndex + 4; iStreamIndex++) {
     170                for (unsigned iStreamIndex = iStreamSetIndex; iStreamIndex < iStreamSetIndex + 4; iStreamIndex++) {
    170171                    Value * PDEP_field = b->CreateCall(pdep, {b->CreateExtractElement(source_field, iStreamIndex - iStreamSetIndex), mask});
    171172                    resultArray[iStreamIndex] = b->CreateInsertElement(resultArray[iStreamIndex], PDEP_field, i);
     
    177178        }
    178179
    179         for (int iStreamIndex = 0; iStreamIndex < mNumberOfStream; iStreamIndex++) {
     180        for (unsigned iStreamIndex = 0; iStreamIndex < mNumberOfStream; iStreamIndex++) {
    180181            // Store the result
    181182            Value * const outputStreamPtr = b->getOutputStreamBlockPtr("output", b->getSize(iStreamIndex), strideIndex);
     
    187188        bufferSizePhi->addIncoming(bufferSize, finishedBlock);
    188189
    189         for (int iStreamSetIndex = 0; iStreamSetIndex < mNumberOfStream; iStreamSetIndex += 4) {
     190        for (unsigned iStreamSetIndex = 0; iStreamSetIndex < mNumberOfStream; iStreamSetIndex += 4) {
    190191            bufferVecPhiArray[iStreamSetIndex / 4]->addIncoming(bufferVecArray[iStreamSetIndex / 4], finishedBlock);
    191192        }
Note: See TracChangeset for help on using the changeset viewer.