Changeset 5957 for icGREP/icgrep-devel


Ignore:
Timestamp:
Apr 9, 2018, 5:01:04 PM (15 months ago)
Author:
nmedfort
Message:

fixes for minor compilation issues

Location:
icGREP/icgrep-devel/icgrep
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/grep/grep_engine.cpp

    r5954 r5957  
    103103    memcpy((void * ) &mBuffer_base[mSpace_used], C_string_ptr, length+1);
    104104    mSpace_used += length+1;
    105     assert("Search candidate not null terminated" && (buffer_base[mSpace_used] == '\0'));
     105    assert("Search candidate not null terminated" && (mBuffer_base[mSpace_used] == '\0'));
    106106    mEntries++;
    107107}
     
    745745    Module * M = idb->getModule();
    746746   
    747     const unsigned encodingBits = 8;
    748747    const unsigned segmentSize = codegen::BufferSegments * codegen::SegmentSize * codegen::ThreadNum;
    749748   
  • icGREP/icgrep-devel/icgrep/kernels/kernel_builder.cpp

    r5865 r5957  
    176176    assert (target && targetOffset);
    177177    assert (source && sourceOffset);
    178     assert (target->getType() == source->getType());
     178    // assert (target->getType() == source->getType());
    179179    assert (target->getType()->isPointerTy());
    180180    assert (isConstantZero(targetOffset) || isConstantZero(sourceOffset));
  • icGREP/icgrep-devel/icgrep/kernels/lz4/lz4_block_decoder.cpp

    r5948 r5957  
    5858void LZ4BlockDecoderNewKernel::generateMultiBlockLogic(const std::unique_ptr<KernelBuilder> &iBuilder, Value * const numOfStrides) {
    5959    // Constant
    60     Constant* INT8_0 = iBuilder->getInt8(0);
    61     Constant* INT8_1 = iBuilder->getInt8(1);
    6260    Constant* INT64_0 = iBuilder->getInt64(0);
    63 
    6461
    6562    BasicBlock * entryBlock = iBuilder->GetInsertBlock();
     
    9491    iBuilder->SetInsertPoint(processCon);
    9592
    96     PHINode* phiIsCompressed = iBuilder->CreatePHI(iBuilder->getInt8Ty(), 3);
    97     PHINode* phiBlockStart = iBuilder->CreatePHI(iBuilder->getInt64Ty(), 3);
    98     PHINode* phiBlockEnd = iBuilder->CreatePHI(iBuilder->getInt64Ty(), 3);
    99     PHINode* sOffset = iBuilder->CreatePHI(iBuilder->getSizeTy(), 3);
     93    PHINode* phiIsCompressed = iBuilder->CreatePHI(initIsCompressed->getType(), 3);
     94    PHINode* phiBlockStart = iBuilder->CreatePHI(initBlockStart->getType(), 3);
     95    PHINode* phiBlockEnd = iBuilder->CreatePHI(initBlockEnd->getType(), 3);
     96    PHINode* sOffset = iBuilder->CreatePHI(previousOffset->getType(), 3);
    10097
    10198    phiIsCompressed->addIncoming(initIsCompressed, entryBlock);
     
    119116    iBuilder->SetInsertPoint(storeOutputBlock);
    120117    this->appendOutput(iBuilder, phiIsCompressed, phiBlockStart, phiBlockEnd);
    121     phiIsCompressed->addIncoming(INT8_0, storeOutputBlock);
     118    phiIsCompressed->addIncoming(iBuilder->getFalse(), storeOutputBlock);
    122119    phiBlockStart->addIncoming(INT64_0, storeOutputBlock);
    123120    phiBlockEnd->addIncoming(INT64_0, storeOutputBlock);
     
    177174
    178175    sOffset->addIncoming(newOffset, iBuilder->GetInsertBlock());
    179     phiIsCompressed->addIncoming(iBuilder->CreateSelect(isCompressed, INT8_1, INT8_0), iBuilder->GetInsertBlock());
     176    phiIsCompressed->addIncoming(isCompressed, iBuilder->GetInsertBlock());
    180177    phiBlockStart->addIncoming(blockStart, iBuilder->GetInsertBlock());
    181178    phiBlockEnd->addIncoming(blockEnd, iBuilder->GetInsertBlock());
     
    204201    void LZ4BlockDecoderNewKernel::appendOutput(const std::unique_ptr<KernelBuilder> & iBuilder, Value* isCompressed, Value* blockStart, Value* blockEnd) {
    205202        // Constant
    206         this->generateStoreNumberOutput(iBuilder, "isCompressed", iBuilder->getInt8Ty()->getPointerTo(), isCompressed);
     203        this->generateStoreNumberOutput(iBuilder, "isCompressed", iBuilder->getInt1Ty()->getPointerTo(), isCompressed);
    207204        this->generateStoreNumberOutput(iBuilder, "blockStart", iBuilder->getInt64Ty()->getPointerTo(), blockStart);
    208205        this->generateStoreNumberOutput(iBuilder, "blockEnd", iBuilder->getInt64Ty()->getPointerTo(), blockEnd);
  • icGREP/icgrep-devel/icgrep/kernels/lz4/lz4_multiple_pdep_kernel.cpp

    r5948 r5957  
    3030        mStreamSetOutputs.push_back(Binding{kb->getStreamSetTy(streamCount), "outputStreamSet0", RateEqualTo("PDEPmarkerStream")});
    3131
    32         for (int i = 1; i < streamSize; i++) {
     32        for (unsigned i = 1; i < streamSize; i++) {
    3333            mStreamSetInputs.push_back(Binding{kb->getStreamSetTy(streamCount), "sourceStreamSet" + std::to_string(i), BoundedRate(0, 1), Swizzled()});
    3434            mStreamSetOutputs.push_back(Binding{kb->getStreamSetTy(streamCount), "outputStreamSet" + std::to_string(i), RateEqualTo("outputStreamSet0")});
     
    106106            Value * shift_amount = kb->CreateURem(updatedProcessedSourceBits, pdepWidth);
    107107
    108             for (int iStreamIndex = 0; iStreamIndex < mStreamSize; iStreamIndex++) {
     108            for (unsigned iStreamIndex = 0; iStreamIndex < mStreamSize; iStreamIndex++) {
    109109                Value * next_blk_idx = kb->CreateSub(kb->CreateUDiv(ahead_pdep_width_less_1, blockWidth), base_src_blk_idx);
    110110                Value * next_swizzle_idx = kb->CreateUDiv(kb->CreateURem(ahead_pdep_width_less_1, blockWidth), pdepWidth);
     
    166166
    167167        kb->SetInsertPoint(terminate);
    168         for (int i = 0; i < mStreamSize; i++) {
     168        for (unsigned i = 0; i < mStreamSize; i++) {
    169169            kb->setProcessedItemCount("sourceStreamSet" + std::to_string(i), updatedProcessedSourceBitsPhi);
    170170        }
  • icGREP/icgrep-devel/icgrep/lz4/LZ4Generator.cpp

    r5955 r5957  
    9090
    9191    StreamSetBuffer * const DecompressedByteStream = pxDriver.addBuffer<CircularBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8), this->getDecompressedBufferBlocks());
    92     StreamSetBuffer * const FinalDecompressedByteStream = pxDriver.addBuffer<CircularBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8), this->getDecompressedBufferBlocks());
    9392
    9493    // GeneratePipeline
     
    223222    //// Generate Helper Markers Extenders, FX, XF
    224223    StreamSetBuffer * const Extenders = pxDriver.addBuffer<CircularBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 1), this->getInputBufferBlocks());
    225     StreamSetBuffer * const CC_0xFX = pxDriver.addBuffer<CircularBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 1), this->getInputBufferBlocks());
    226     StreamSetBuffer * const CC_0xXF = pxDriver.addBuffer<CircularBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 1), this->getInputBufferBlocks());
    227 
    228224
    229225    Kernel * extenderK = pxDriver.addKernelInstance<ParabixCharacterClassKernelBuilder>(iBuilder, "extenders", std::vector<re::CC *>{re::makeCC(0xFF)}, 8);
     
    235231    blockDecoderK->setInitialArguments({iBuilder->CreateTrunc(hasBlockChecksum, iBuilder->getInt1Ty()), headerSize, fileSize});
    236232    pxDriver.makeKernelCall(blockDecoderK, {ByteStream}, {BlockData_IsCompressed, BlockData_BlockStart, BlockData_BlockEnd});
    237 
    238 //    re::CC* xfCC = re::makeCC(0x0f);
    239 //    re::CC* fxCC = re::makeCC(0xf0);
    240 //    for (re::codepoint_t i = 1; i <= 0xf; i++) {
    241 //        xfCC = re::makeCC(xfCC, re::makeCC(i * 0x10 + 0x0f));
    242 //        fxCC = re::makeCC(fxCC, re::makeCC(0xf0 + i));
    243 //    }
    244 
    245 //    Kernel * CC_0xFXKernel = pxDriver.addKernelInstance<ParabixCharacterClassKernelBuilder>(iBuilder, "CC_0xFX", std::vector<re::CC *>{fxCC}, 8);
    246 //    pxDriver.makeKernelCall(CC_0xFXKernel, {BasisBits}, {CC_0xFX});
    247 
    248 //    Kernel * CC_0xXFKernel = pxDriver.addKernelInstance<ParabixCharacterClassKernelBuilder>(iBuilder, "CC_0xXF", std::vector<re::CC *>{xfCC}, 8);
    249 //    pxDriver.makeKernelCall(CC_0xXFKernel, {BasisBits}, {CC_0xXF});
    250233
    251234    //// Generate Extract/Deposit Markers, M0_Start, M0_End, MatchOffset
     
    263246    DepositMarker = pxDriver.addBuffer<CircularBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 1), this->getDecompressedBufferBlocks());
    264247    Match_Offset = pxDriver.addBuffer<CircularBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 64), this->getInputBufferBlocks());
    265 
    266 
    267 
    268248
    269249    Kernel* Lz4IndexBuilderK = pxDriver.addKernelInstance<LZ4IndexBuilderKernel>(iBuilder);
     
    274254                    ByteStream,
    275255                    Extenders,
    276 //                    CC_0xFX,
    277 //                    CC_0xXF,
    278256
    279257                    // Block Data
  • icGREP/icgrep-devel/icgrep/lz4/LZ4Generator.h

    r5948 r5957  
    3232protected:
    3333    //// Protected Method
    34     inline void generateMainFunc(const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
     34    void generateMainFunc(const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
    3535    // Pipeline
    3636    virtual void generateLoadByteStreamAndBitStream(const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
  • icGREP/icgrep-devel/icgrep/lz4/LZ4GrepGenerator.cpp

    r5955 r5957  
    141141    // TODO: until we automate stream buffer sizing, use this calculation to determine how large our matches buffer needs to be.
    142142    const unsigned baseBufferSize = this->getInputBufferBlocks();
    143     const unsigned encodingBits = 8;
    144143    bool MultithreadedSimpleRE = false;
    145     bool PabloTransposition = false;
    146144    bool PropertyKernels = false;
    147145    bool CC_Multiplexing = false;
     
    338336    return std::pair<StreamSetBuffer *, StreamSetBuffer *>(LineBreakStream, Matches);
    339337
    340 };
     338}
    341339
    342340
     
    350348    main(fileBuffer, blockStart, blockEnd, hasBlockChecksum, reinterpret_cast<intptr_t>(&accum));
    351349    llvm::outs() << s.str();
    352 };
     350}
    353351
    354352void LZ4GrepGenerator::generateScanMatchGrepPipeline(re::RE* regex) {
     
    425423    auto & iBuilder = pxDriver.getBuilder();
    426424    this->generateMainFunc(iBuilder);
    427 
    428     StreamSetBuffer * const DecompressedByteStream = pxDriver.addBuffer<CircularBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8), this->getDecompressedBufferBlocks());
    429425
    430426    // GeneratePipeline
  • icGREP/icgrep-devel/icgrep/lz4/LZ4GrepGenerator.h

    r5955 r5957  
    1414#include <sstream>
    1515#include <atomic>
    16 #import <grep/grep_engine.h>
     16#include <grep/grep_engine.h>
    1717
    1818typedef void (*ScanMatchGrepMainFunctionType)(char * byte_data, size_t headerSize, size_t filesize, bool hasBlockChecksum, intptr_t match_accumulator);
  • icGREP/icgrep-devel/icgrep/lz4_grep.cpp

    r5955 r5957  
    8787    // Since mmap offset has to be multiples of pages, we can't use it to skip headers.
    8888    mappedFile.open(fileName , lz4Frame.getBlocksLength() + lz4Frame.getBlocksStart());
    89     size_t headerLength = lz4Frame.getBlocksStart();
    9089    //char *fileBuffer = const_cast<char *>(mappedFile.data()) + lz4Frame.getBlocksStart();
    9190    char *fileBuffer = const_cast<char *>(mappedFile.data());
Note: See TracChangeset for help on using the changeset viewer.