Ignore:
Timestamp:
Jul 23, 2016, 1:04:44 PM (3 years ago)
Author:
cameron
Message:

Use dynamic size_t determination

Location:
icGREP/icgrep-devel/icgrep/kernels
Files:
10 edited

Legend:

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

    r5103 r5106  
    5353   
    5454    std::vector<Type *> doBlockParameters = {selfType};
    55     std::vector<Type *> finalBlockParameters = {selfType, iBuilder->getInt64Ty()};
     55    std::vector<Type *> finalBlockParameters = {selfType, iBuilder->getSizeTy()};
    5656    /*
    5757    for (auto inputSet : mStreamSetInputs) {
     
    109109    */
    110110    // Create the doSegment function prototype.
    111     std::vector<Type *> doSegmentParameters = {selfType, iBuilder->getInt64Ty()};
     111    std::vector<Type *> doSegmentParameters = {selfType, iBuilder->getSizeTy()};
    112112    FunctionType * doSegmentFunctionType = FunctionType::get(mDoBlockReturnType, doSegmentParameters, false);
    113113    std::string doSegmentName = mKernelName + doSegment_suffix;
  • icGREP/icgrep-devel/icgrep/kernels/kernel.cpp

    r5104 r5106  
    3737void KernelBuilder::prepareKernel() {
    3838    if (!mDoBlockReturnType) mDoBlockReturnType = iBuilder->getVoidTy();
    39     addScalar(iBuilder->getInt64Ty(), blockNoScalar);
     39    addScalar(iBuilder->getSizeTy(), blockNoScalar);
    4040    int streamSetNo = 0;
    4141    for (auto sSet : mStreamSetInputs) {
     
    154154    iBuilder->SetInsertPoint(blockLoop);
    155155    if (mDoBlockReturnType->isVoidTy()) {
    156         PHINode * blocksRemaining = iBuilder->CreatePHI(iBuilder->getInt64Ty(), 2, "blocksRemaining");
     156        PHINode * blocksRemaining = iBuilder->CreatePHI(iBuilder->getSizeTy(), 2, "blocksRemaining");
    157157        blocksRemaining->addIncoming(blocksToDo, entryBlock);
    158158       
     
    160160       
    161161        iBuilder->CreateCall(doBlockFunction, {self});
    162         setScalarField(self, blockNoScalar, iBuilder->CreateAdd(blockNo, iBuilder->getInt64(1)));
    163         blocksToDo = iBuilder->CreateSub(blocksRemaining, iBuilder->getInt64(1));
     162        setScalarField(self, blockNoScalar, iBuilder->CreateAdd(blockNo, ConstantInt::get(iBuilder->getSizeTy(), 1)));
     163        blocksToDo = iBuilder->CreateSub(blocksRemaining, ConstantInt::get(iBuilder->getSizeTy(), 1));
    164164        blocksRemaining->addIncoming(blocksToDo, blockLoop);
    165         Value * notDone = iBuilder->CreateICmpUGT(blocksToDo, iBuilder->getInt64(0));
     165        Value * notDone = iBuilder->CreateICmpUGT(blocksToDo, ConstantInt::get(iBuilder->getSizeTy(), 0));
    166166        iBuilder->CreateCondBr(notDone, blockLoop, blocksDone);
    167167       
     
    170170    }
    171171    else {
    172         PHINode * blocksRemaining = iBuilder->CreatePHI(iBuilder->getInt64Ty(), 2, "blocksRemaining");
     172        PHINode * blocksRemaining = iBuilder->CreatePHI(iBuilder->getSizeTy(), 2, "blocksRemaining");
    173173        blocksRemaining->addIncoming(blocksToDo, entryBlock);
    174174        PHINode * total = iBuilder->CreatePHI(mDoBlockReturnType, 2, "resultTotal");
     
    179179       
    180180        Value * rslt = iBuilder->CreateCall(doBlockFunction, {self});
    181         setScalarField(self, blockNoScalar, iBuilder->CreateAdd(blockNo, iBuilder->getInt64(1)));
    182         blocksToDo = iBuilder->CreateSub(blocksRemaining, iBuilder->getInt64(1));
     181        setScalarField(self, blockNoScalar, iBuilder->CreateAdd(blockNo, ConstantInt::get(iBuilder->getSizeTy(), 1)));
     182        blocksToDo = iBuilder->CreateSub(blocksRemaining, ConstantInt::get(iBuilder->getSizeTy(), 1));
    183183        blocksRemaining->addIncoming(blocksToDo, blockLoop);
    184         Value * notDone = iBuilder->CreateICmpUGT(blocksToDo, iBuilder->getInt64(0));
     184        Value * notDone = iBuilder->CreateICmpUGT(blocksToDo, ConstantInt::get(iBuilder->getSizeTy(), 0));
    185185        Value * totalSoFar = iBuilder->CreateAdd(total, rslt);
    186186        total->addIncoming(totalSoFar, blockLoop);
  • icGREP/icgrep-devel/icgrep/kernels/pipeline.cpp

    r5099 r5106  
    2525       
    2626    const unsigned segmentSize = codegen::SegmentSize;
    27     Type * const int64ty = iBuilder->getInt64Ty();
     27    Type * const size_ty = iBuilder->getSizeTy();
    2828
    2929    // Create the basic blocks for the loop.
     
    4747        iBuilder->CreateBr(segmentCondBlock);
    4848        iBuilder->SetInsertPoint(segmentCondBlock);
    49         PHINode * remainingBytes = iBuilder->CreatePHI(int64ty, 2, "remainingBytes");
     49        PHINode * remainingBytes = iBuilder->CreatePHI(size_ty, 2, "remainingBytes");
    5050        remainingBytes->addIncoming(fileSize, entryBlock);
    51         PHINode * blockNo = iBuilder->CreatePHI(int64ty, 2, "blockNo");
    52         blockNo->addIncoming(iBuilder->getInt64(0), entryBlock);
     51        PHINode * blockNo = iBuilder->CreatePHI(size_ty, 2, "blockNo");
     52        blockNo->addIncoming(ConstantInt::get(size_ty, 0), entryBlock);
    5353       
    54         Constant * const step = ConstantInt::get(int64ty, iBuilder->getBitBlockWidth() * segmentSize);
     54        Constant * const step = ConstantInt::get(size_ty, iBuilder->getBitBlockWidth() * segmentSize);
    5555        Value * segmentCondTest = iBuilder->CreateICmpULT(remainingBytes, step);
    5656        iBuilder->CreateCondBr(segmentCondTest, fullCondBlock, segmentBodyBlock);
    5757       
    5858        iBuilder->SetInsertPoint(segmentBodyBlock);
    59         Value * segBlocks = ConstantInt::get(int64ty, segmentSize);
     59        Value * segBlocks = ConstantInt::get(size_ty, segmentSize);
    6060        Value * rslt = kernels[0]->createDoSegmentCall(instances[0], segBlocks);
    6161        for (unsigned i = 1; i < kernels.size(); i++) {
     
    7171    } else {
    7272        initialBufferSize = fileSize;
    73         initialBlockNo = ConstantInt::get(int64ty, 0);
     73        initialBlockNo = ConstantInt::get(size_ty, 0);
    7474        initialBlock = entryBlock;
    7575        iBuilder->CreateBr(fullCondBlock);
     
    7777   
    7878    iBuilder->SetInsertPoint(fullCondBlock);
    79     PHINode * remainingBytes = iBuilder->CreatePHI(int64ty, 2, "remainingBytes");
     79    PHINode * remainingBytes = iBuilder->CreatePHI(size_ty, 2, "remainingBytes");
    8080    remainingBytes->addIncoming(initialBufferSize, initialBlock);
    81     PHINode * blockNo = iBuilder->CreatePHI(int64ty, 2, "blockNo");
     81    PHINode * blockNo = iBuilder->CreatePHI(size_ty, 2, "blockNo");
    8282    blockNo->addIncoming(initialBlockNo, initialBlock);
    8383   
    84     Constant * const step = ConstantInt::get(int64ty, iBuilder->getBitBlockWidth());
     84    Constant * const step = ConstantInt::get(size_ty, iBuilder->getBitBlockWidth());
    8585    Value * fullCondTest = iBuilder->CreateICmpULT(remainingBytes, step);
    8686    iBuilder->CreateCondBr(fullCondTest, finalBlock, fullBodyBlock);
     
    8888    // Full Block Pipeline loop
    8989    iBuilder->SetInsertPoint(fullBodyBlock);
    90     rslt = kernels[0]->createDoSegmentCall(instances[0], ConstantInt::get(int64ty, 1));
     90    rslt = kernels[0]->createDoSegmentCall(instances[0], ConstantInt::get(size_ty, 1));
    9191    for (unsigned i = 1; i < kernels.size(); i++) {
    92         rslt = kernels[i]->createDoSegmentCall(instances[i], rslt->getType()->isVoidTy() ? ConstantInt::get(int64ty, 1) : rslt);
     92        rslt = kernels[i]->createDoSegmentCall(instances[i], rslt->getType()->isVoidTy() ? ConstantInt::get(size_ty, 1) : rslt);
    9393    }
    9494   
    9595    remainingBytes->addIncoming(iBuilder->CreateSub(remainingBytes, step), fullBodyBlock);
    96     blockNo->addIncoming(iBuilder->CreateAdd(blockNo, iBuilder->getInt64(1)), fullBodyBlock);
     96    blockNo->addIncoming(iBuilder->CreateAdd(blockNo, ConstantInt::get(size_ty, 1)), fullBodyBlock);
    9797    iBuilder->CreateBr(fullCondBlock);
    9898   
  • icGREP/icgrep-devel/icgrep/kernels/s2p_kernel.cpp

    r5104 r5106  
    138138    BasicBlock * exitBlock = BasicBlock::Create(iBuilder->getContext(), "exit", finalBlockFunction, 0);
    139139   
    140     Value * emptyBlockCond = iBuilder->CreateICmpEQ(remainingBytes, ConstantInt::get(iBuilder->getInt64Ty(), 0));
     140    Value * emptyBlockCond = iBuilder->CreateICmpEQ(remainingBytes, ConstantInt::get(iBuilder->getSizeTy(), 0));
    141141    iBuilder->CreateCondBr(emptyBlockCond, finalEmptyBlock, finalPartialBlock);
    142142    iBuilder->SetInsertPoint(finalPartialBlock);
  • icGREP/icgrep-devel/icgrep/kernels/scanmatchgen.h

    r5102 r5106  
    88#include "streamset.h"
    99#include "kernel.h"
     10#include <llvm/Support/Host.h>
     11#include <llvm/ADT/Triple.h>
    1012
    1113namespace llvm { class Module; class Function;}
     
    1719class scanMatchKernel : public KernelBuilder {
    1820public:
    19     scanMatchKernel(IDISA::IDISA_Builder * iBuilder, parabix::StreamSetBuffer& matchResults, unsigned scanwordBitWidth, bool isNameExpression) :
     21    scanMatchKernel(IDISA::IDISA_Builder * iBuilder, parabix::StreamSetBuffer& matchResults, bool isNameExpression) :
    2022    KernelBuilder(iBuilder, "scanMatch",
    2123                  {StreamSetBinding{matchResults, "matchResults"}},
    2224                    {},
    23                     {ScalarBinding{iBuilder->getInt8PtrTy(), "FileBuf"}, ScalarBinding{iBuilder->getInt64Ty(), "FileSize"}, ScalarBinding{iBuilder->getInt64Ty(), "FileIdx"}},
     25                    {ScalarBinding{iBuilder->getInt8PtrTy(), "FileBuf"}, ScalarBinding{iBuilder->getSizeTy(), "FileSize"}, ScalarBinding{iBuilder->getSizeTy(), "FileIdx"}},
    2426                    {},
    25                     {ScalarBinding{iBuilder->getInt64Ty(), "BlockNo"}, ScalarBinding{iBuilder->getInt64Ty(), "LineStart"}, ScalarBinding{iBuilder->getInt64Ty(), "LineNum"}}),
     27                    {ScalarBinding{iBuilder->getSizeTy(), "BlockNo"}, ScalarBinding{iBuilder->getSizeTy(), "LineStart"}, ScalarBinding{iBuilder->getSizeTy(), "LineNum"}}),
    2628
    27     mScanwordBitWidth(scanwordBitWidth),
     29    mScanwordBitWidth(Triple(llvm::sys::getProcessTriple()).isArch32Bit() ? 32 : 64),
    2830    mIsNameExpression(isNameExpression) {}
    2931       
  • icGREP/icgrep-devel/icgrep/kernels/stdout_kernel.cpp

    r5100 r5106  
    3939    Value * self = getParameter(doBlockFunction, "self");
    4040    Value * blockNo = getScalarField(self, blockNoScalar);
    41     Value * inputStreamBlock = getCircularBufferBlockPointer(self, "inputStreamSet", blockNo);
     41    Value * inputStreamBlock = getStreamSetBlockPtr(self, "inputStreamSet", blockNo);
    4242
    4343    Value * bufferPtr = getScalarField(self, "bufferPtr");
  • icGREP/icgrep-devel/icgrep/kernels/stdout_kernel.h

    r5100 r5106  
    1616class stdOutKernel : public KernelBuilder {
    1717public:
    18     stdOutKernel(IDISA::IDISA_Builder * iBuilder, unsigned codeUnitWidth) :
     18    stdOutKernel(IDISA::IDISA_Builder * iBuilder, unsigned codeUnitWidth, parabix::StreamSetBuffer & codeUnitBuffer) :
    1919    KernelBuilder(iBuilder, "stdout",
    20                   {StreamSetBinding{StreamSetType(1, codeUnitWidth), "codeUnitBuffer"}}, {}, {}, {}, {}) {
    21         mStreamType = PointerType::get(StreamSetType(1, codeUnitWidth).getStreamSetBlockType(iBuilder), 0);
     20                  {StreamSetBinding{codeUnitBuffer, "codeUnitBuffer"}}, {}, {}, {}, {}) {
     21        mStreamType = PointerType::get(parabix::StreamSetType(1, codeUnitWidth).getStreamSetBlockType(iBuilder), 0);
    2222        mScalarInputs = {ScalarBinding{mStreamType , "bufferPtr"}};
    2323    }
  • icGREP/icgrep-devel/icgrep/kernels/streamset.cpp

    r5100 r5106  
    2323// Single Block Buffer
    2424
    25 uint64_t SingleBlockBuffer::getBufferSize() {
     25size_t SingleBlockBuffer::getBufferSize() {
    2626    return 1; //iBuilder->getBitBlockWidth();
    2727}
     
    4040// External Unbounded Buffer
    4141
    42 uint64_t ExternalUnboundedBuffer::getBufferSize() {
     42size_t ExternalUnboundedBuffer::getBufferSize() {
    4343    return 0;
    4444}
     
    5555// Circular Stack Allocated Buffer
    5656
    57 uint64_t CircularBuffer::getBufferSize() {
     57size_t CircularBuffer::getBufferSize() {
    5858    return mBufferBlocks; // * iBuilder->getBitBlockWidth();
    5959}
    6060
    6161llvm::Value * CircularBuffer::allocateBuffer() {
    62     mStreamSetBufferPtr = iBuilder->CreateAlloca(getStreamSetBlockType(), iBuilder->getInt64(mBufferBlocks));
     62    mStreamSetBufferPtr = iBuilder->CreateAlloca(getStreamSetBlockType(), ConstantInt::get(iBuilder->getSizeTy(), mBufferBlocks));
    6363    return mStreamSetBufferPtr;
    6464}
    6565
    6666llvm::Value * CircularBuffer::getStreamSetBlockPointer(llvm::Value * bufferBasePtr, llvm::Value * blockNo) {
    67     return iBuilder->CreateGEP(getStreamSetBlockType(), bufferBasePtr, {iBuilder->CreateAnd(blockNo, iBuilder->getInt64(mBufferBlocks-1))});
     67    return iBuilder->CreateGEP(getStreamSetBlockType(), bufferBasePtr, {iBuilder->CreateAnd(blockNo, ConstantInt::get(iBuilder->getSizeTy(), mBufferBlocks-1))});
    6868}
    6969
  • icGREP/icgrep-devel/icgrep/kernels/streamset.h

    r5100 r5106  
    3636    llvm::Type * getStreamSetBlockType();
    3737
    38     virtual uint64_t getBufferSize() = 0;
     38    virtual size_t getBufferSize() = 0;
    3939   
    4040    virtual llvm::Value * allocateBuffer() = 0;
     
    5454    IDISA::IDISA_Builder * iBuilder;
    5555    StreamSetType mStreamSetType;
    56     uint64_t mBufferBlocks;
     56    size_t mBufferBlocks;
    5757    int mAddrSpace;
    5858    llvm::Value * mStreamSetBufferPtr;
     
    6868    StreamSetBuffer(BufferKind::BlockBuffer, b, ss_type) {}
    6969   
    70     uint64_t getBufferSize() override;
     70    size_t getBufferSize() override;
    7171    llvm::Value * allocateBuffer() override;
    7272    llvm::Value * getStreamSetBlockPointer(llvm::Value * bufferBasePtr, llvm::Value * blockNo) override;
     
    8484    void setStreamSetBuffer(llvm::Value * ptr) {mStreamSetBufferPtr = ptr;}
    8585   
    86     uint64_t getBufferSize() override;
     86    size_t getBufferSize() override;
    8787    // Can't allocate - raise an error. */
    8888    llvm::Value * allocateBuffer() override;
     
    9494    static inline bool classof(const StreamSetBuffer * b) {return b->getBufferKind() == BufferKind::CircularBuffer;}
    9595 
    96     CircularBuffer(IDISA::IDISA_Builder * b, StreamSetType ss_type, uint64_t bufferBlocks) :
     96    CircularBuffer(IDISA::IDISA_Builder * b, StreamSetType ss_type, size_t bufferBlocks) :
    9797        StreamSetBuffer(BufferKind::CircularBuffer, b, ss_type) {
    9898            mBufferBlocks = bufferBlocks;
     
    102102        }
    103103
    104     uint64_t getBufferSize() override;
     104    size_t getBufferSize() override;
    105105    llvm::Value * allocateBuffer() override;
    106106    llvm::Value * getStreamSetBlockPointer(llvm::Value * bufferBasePtr, llvm::Value * blockNo) override;
  • icGREP/icgrep-devel/icgrep/kernels/symboltablepipeline.cpp

    r5037 r5106  
    239239
    240240    Value * blockPos = iBuilder->CreateLoad(kBuilder->getBlockNo());
    241     blockPos = iBuilder->CreateMul(blockPos, iBuilder->getInt64(iBuilder->getBitBlockWidth()));
     241    blockPos = iBuilder->CreateMul(blockPos, ConstantInt::get(iBuilder->getSizeTy(), iBuilder->getBitBlockWidth()));
    242242
    243243    iBuilder->CreateBr(groupCond);
     
    275275    // START OUTER COND
    276276    iBuilder->SetInsertPoint(startOuterCond);
    277     PHINode * startBlockOffset = iBuilder->CreatePHI(iBuilder->getInt64Ty(), 2);
     277    PHINode * startBlockOffset = iBuilder->CreatePHI(iBuilder->getSizeTy(), 2);
    278278    startBlockOffset->addIncoming(blockPos, groupBody);
    279279    PHINode * startIndexPhi1 = iBuilder->CreatePHI(startIndex->getType(), 2, "startIndexPhi1");
    280280    startIndexPhi1->addIncoming(startIndex, groupBody);
    281     PHINode * startIV = iBuilder->CreatePHI(iBuilder->getInt64Ty(), 2);
    282     startIV->addIncoming(iBuilder->getInt64(0), groupBody);
    283     Value * startOuterTest = iBuilder->CreateICmpNE(startIV, iBuilder->getInt64(fieldCount));
     281    PHINode * startIV = iBuilder->CreatePHI(iBuilder->getSizeTy(), 2);
     282    startIV->addIncoming(ConstantInt::get(iBuilder->getSizeTy(), 0), groupBody);
     283    Value * startOuterTest = iBuilder->CreateICmpNE(startIV, ConstantInt::get(iBuilder->getSizeTy(), fieldCount));
    284284    iBuilder->CreateCondBr(startOuterTest, startOuterBody, endOuterCond);
    285285
     
    287287    iBuilder->SetInsertPoint(startOuterBody);
    288288    Value * startField = iBuilder->CreateExtractElement(startStream, startIV);
    289     startIV->addIncoming(iBuilder->CreateAdd(startIV, iBuilder->getInt64(1)), startInnerCond);
    290     startBlockOffset->addIncoming(iBuilder->CreateAdd(startBlockOffset, iBuilder->getInt64(scanWordBitWidth)), startInnerCond);
     289    startIV->addIncoming(iBuilder->CreateAdd(startIV, ConstantInt::get(iBuilder->getSizeTy(), 1)), startInnerCond);
     290    startBlockOffset->addIncoming(iBuilder->CreateAdd(startBlockOffset, ConstantInt::get(iBuilder->getSizeTy(), scanWordBitWidth)), startInnerCond);
    291291    iBuilder->CreateBr(startInnerCond);
    292292
     
    312312    // END POINT OUTER COND
    313313    iBuilder->SetInsertPoint(endOuterCond);
    314     PHINode * endBlockOffset = iBuilder->CreatePHI(iBuilder->getInt64Ty(), 2);
     314    PHINode * endBlockOffset = iBuilder->CreatePHI(iBuilder->getSizeTy(), 2);
    315315    endBlockOffset->addIncoming(blockPos, startOuterCond);
    316316    PHINode * endIndexPhi1 = iBuilder->CreatePHI(endIndex->getType(), 2);
     
    318318    PHINode * startIndexPhi3 = iBuilder->CreatePHI(startIndex->getType(), 2, "startIndexPhi3");
    319319    startIndexPhi3->addIncoming(startIndexPhi1, startOuterCond);
    320     PHINode * endIV = iBuilder->CreatePHI(iBuilder->getInt64Ty(), 2);
    321     endIV->addIncoming(iBuilder->getInt64(0), startOuterCond);
    322     Value * endOuterTest = iBuilder->CreateICmpNE(endIV, iBuilder->getInt64(fieldCount));
     320    PHINode * endIV = iBuilder->CreatePHI(iBuilder->getSizeTy(), 2);
     321    endIV->addIncoming(ConstantInt::get(iBuilder->getSizeTy(), 0), startOuterCond);
     322    Value * endOuterTest = iBuilder->CreateICmpNE(endIV, ConstantInt::get(iBuilder->getSizeTy(), fieldCount));
    323323    iBuilder->CreateCondBr(endOuterTest, endOuterBody, nextGroup);
    324324
     
    326326    iBuilder->SetInsertPoint(endOuterBody);
    327327    Value * endField = iBuilder->CreateExtractElement(endStream, endIV);
    328     endIV->addIncoming(iBuilder->CreateAdd(endIV, iBuilder->getInt64(1)), endInnerCond);
    329     endBlockOffset->addIncoming(iBuilder->CreateAdd(endBlockOffset, iBuilder->getInt64(scanWordBitWidth)), endInnerCond);
     328    endIV->addIncoming(iBuilder->CreateAdd(endIV, ConstantInt::get(iBuilder->getSizeTy(), 1)), endInnerCond);
     329    endBlockOffset->addIncoming(iBuilder->CreateAdd(endBlockOffset, ConstantInt::get(iBuilder->getSizeTy(), scanWordBitWidth)), endInnerCond);
    330330    iBuilder->CreateBr(endInnerCond);
    331331
     
    445445        AllocaInst * const buffer = iBuilder->CreateAlloca(gatherVectorType, iBuilder->getInt32(maxCount * 4), "buffer");
    446446        Value * end = iBuilder->CreateGEP(buffer, iBuilder->getInt32(maxCount * 4));
    447         Value * size = iBuilder->CreateSub(iBuilder->CreatePtrToInt(end, iBuilder->getInt64Ty()), iBuilder->CreatePtrToInt(buffer, iBuilder->getInt64Ty()));
     447        Value * size = iBuilder->CreateSub(iBuilder->CreatePtrToInt(end, iBuilder->getSizeTy()), iBuilder->CreatePtrToInt(buffer, iBuilder->getSizeTy()));
    448448        iBuilder->CreateMemSet(buffer, iBuilder->getInt8(0), size, 4);
    449449        Value * const transposed = iBuilder->CreateBitCast(buffer, transposedVectorType->getPointerTo(), "transposed");
     
    645645Function * SymbolTableBuilder::ExecuteKernels(){
    646646
    647     Type * intType = iBuilder->getInt64Ty();
     647    Type * intType = iBuilder->getSizeTy();
    648648
    649649    Type * inputType = PointerType::get(ArrayType::get(StructType::get(mMod->getContext(), std::vector<Type *>({ArrayType::get(mBitBlockType, 8)})), 1), 0);
     
    684684    const unsigned leadingBlocks = (mLongestLookahead + iBuilder->getBitBlockWidth() - 1) / iBuilder->getBitBlockWidth();
    685685
    686     Value * const requiredBytes = iBuilder->getInt64(mBlockSize * leadingBlocks);
    687     Value * const blockSize = iBuilder->getInt64(mBlockSize);
     686    Value * const requiredBytes = ConstantInt::get(iBuilder->getSizeTy(), mBlockSize * leadingBlocks);
     687    Value * const blockSize = ConstantInt::get(iBuilder->getSizeTy(), mBlockSize);
    688688
    689689    // First compute any necessary leading blocks to allow the sorting kernel access to the "future" data produced by
     
    732732    remainingBytes3->addIncoming(bufferSize, partialLeadingCond);
    733733    remainingBytes3->addIncoming(remainingBytes2, regularCondBlock);
    734     Value * partialBlockCond = iBuilder->CreateICmpSGT(remainingBytes3, iBuilder->getInt64(0));
     734    Value * partialBlockCond = iBuilder->CreateICmpSGT(remainingBytes3, ConstantInt::get(iBuilder->getSizeTy(), 0));
    735735    iBuilder->CreateCondBr(partialBlockCond, partialBodyBlock, flushLengthGroupsBlock);
    736736
Note: See TracChangeset for help on using the changeset viewer.