Ignore:
Timestamp:
Jun 6, 2017, 6:20:55 PM (2 years ago)
Author:
cameron
Message:

Restore check-ins from the last several days

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/lz4d.cpp

    r5486 r5493  
    4444static cl::opt<bool> overwriteOutput("f", cl::desc("Overwrite existing output file."), cl::init(false), cl::cat(lz4dFlags));
    4545
    46 
    4746typedef void (*MainFunctionType)(char * byte_data, size_t filesize, bool hasBlockChecksum);
    4847
     
    5150    Module * M = iBuilder->getModule();
    5251
    53     Type * const size_ty = iBuilder->getSizeTy();
    54     Type * const bool_ty = iBuilder->getIntNTy(sizeof(bool) * 8);
     52    Type * const sizeTy = iBuilder->getSizeTy();
     53    Type * const boolTy = iBuilder->getIntNTy(sizeof(bool) * 8);
    5554    Type * const voidTy = iBuilder->getVoidTy();
    5655    Type * const inputType = iBuilder->getInt8PtrTy();
    5756   
    58     Function * const main = cast<Function>(M->getOrInsertFunction("Main", voidTy, inputType, size_ty, bool_ty, nullptr));
     57    Function * const main = cast<Function>(M->getOrInsertFunction("Main", voidTy, inputType, sizeTy, boolTy, nullptr));
    5958    main->setCallingConv(CallingConv::C);
    6059    Function::arg_iterator args = main->arg_begin();
     
    7069    // Output buffer should be at least one whole LZ4 block (4MB) large in case of uncompressed blocks.
    7170    // And the size (in bytes) also needs to be a power of two.
    72     const unsigned decompressBufBlocks = 4U * 1024 * 1024 / codegen::BlockSize;
     71    const unsigned decompressBufBlocks = (4194304U) / codegen::BlockSize;
    7372
    7473    iBuilder->SetInsertPoint(BasicBlock::Create(M->getContext(), "entry", main, 0));
     
    111110}
    112111
    113 
    114 MainFunctionType codeGen() {
    115     ParabixDriver pxDriver("lz4d");
    116     generatePipeline(pxDriver);
    117     return reinterpret_cast<MainFunctionType>(pxDriver.getMain());
    118 }
    119 
    120 
    121112int main(int argc, char *argv[]) {
    122113    // This boilerplate provides convenient stack traces and clean LLVM exit
     
    148139    char *fileBuffer = const_cast<char *>(mappedFile.data()) + lz4Frame.getBlocksStart();
    149140
     141    if (codegen::SegmentSize < 2) {
     142        codegen::SegmentSize = 2;
     143    }
     144
    150145    ParabixDriver pxDriver("lz4d");
    151146    generatePipeline(pxDriver);
Note: See TracChangeset for help on using the changeset viewer.