Changeset 6059


Ignore:
Timestamp:
May 30, 2018, 12:41:51 AM (5 months ago)
Author:
xwa163
Message:
  1. Enable swizzled match copy in multiplexing lz4_grep for some special case
  2. Implement some lz4 AIO (all-in-one) pipeline and related kernel
Location:
icGREP/icgrep-devel/icgrep
Files:
6 added
13 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/CMakeLists.txt

    r6054 r6059  
    103103add_library(UCDlib UCD/CaseFolding.cpp utf8_encoder.cpp utf16_encoder.cpp UCD/ucd_compiler.cpp UCD/PropertyObjects.cpp UCD/resolve_properties.cpp)
    104104add_library(GrepEngine  ${GREP_CORE_SRC} grep/grep_engine.cpp kernels/cc_kernel.cpp kernels/cc_scan_kernel.cpp kernels/charclasses.cpp kernels/streams_merge.cpp kernels/until_n.cpp kernels/UCD_property_kernel.cpp kernels/grapheme_kernel.cpp)
    105 add_library(LZ4_Lib lz4FrameDecoder.cpp kernels/cc_kernel.cpp kernels/lz4/lz4_deposit_uncompressed.cpp kernels/lz4/lz4_generate_deposit_stream.cpp kernels/pdep_kernel.cpp lz4/LZ4Generator.cpp kernels/lz4/lz4_block_decoder.cpp kernels/lz4/lz4_index_builder.cpp lz4/LZ4GrepEngine.cpp kernels/lz4/lz4_swizzled_match_copy_kernel.cpp kernels/bitstream_pdep_kernel.cpp kernels/bitstream_gather_pdep_kernel.cpp kernels/swizzled_multiple_pdep_kernel.cpp kernels/lz4/lz4_bitstream_not_kernel.cpp kernels/lz4/lz4_bitstream_match_copy_kernel.cpp kernels/lz4/lz4_fake_stream_generating_kernel.cpp)
     105add_library(LZ4_Lib lz4FrameDecoder.cpp kernels/cc_kernel.cpp kernels/lz4/lz4_deposit_uncompressed.cpp kernels/lz4/lz4_generate_deposit_stream.cpp kernels/pdep_kernel.cpp lz4/LZ4Generator.cpp kernels/lz4/lz4_block_decoder.cpp kernels/lz4/lz4_index_builder.cpp lz4/LZ4GrepEngine.cpp kernels/lz4/lz4_swizzled_match_copy_kernel.cpp kernels/bitstream_pdep_kernel.cpp kernels/bitstream_gather_pdep_kernel.cpp kernels/swizzled_multiple_pdep_kernel.cpp kernels/lz4/lz4_bitstream_not_kernel.cpp kernels/lz4/lz4_bitstream_match_copy_kernel.cpp kernels/lz4/lz4_fake_stream_generating_kernel.cpp kernels/lz4/lz4_index_builder_new.cpp kernels/lz4/lz4_bytestream_aio.cpp kernels/lz4/lz4_swizzled_aio.cpp)
    106106
    107107
  • icGREP/icgrep-devel/icgrep/IR_Gen/CBuilder.cpp

    r6012 r6059  
    295295    }
    296296    return dprintf;
     297}
     298
     299void CBuilder::CallPrintIntCond(const std::string & name, llvm::Value * const value, llvm::Value * const cond) {
     300    BasicBlock* callBlock = this->CreateBasicBlock("callBlock");
     301    BasicBlock* exitBlock = this->CreateBasicBlock("exitBlock");
     302    this->CreateCondBr(cond, callBlock, exitBlock);
     303
     304    this->SetInsertPoint(callBlock);
     305    this->CallPrintInt(name, value);
     306
     307    this->CreateBr(exitBlock);
     308    this->SetInsertPoint(exitBlock);
    297309}
    298310
  • icGREP/icgrep-devel/icgrep/IR_Gen/CBuilder.h

    r5988 r6059  
    210210    //  Create a call to:  int pthread_join(pthread_t thread, void **value_ptr);
    211211    llvm::Value * CreatePThreadJoinCall(llvm::Value * thread, llvm::Value * value_ptr);
    212    
     212
     213    void CallPrintIntCond(const std::string & name, llvm::Value * const value, llvm::Value * const cond);
     214
    213215    void CallPrintInt(const std::string & name, llvm::Value * const value);
    214216   
  • icGREP/icgrep-devel/icgrep/IR_Gen/idisa_builder.cpp

    r6053 r6059  
    2727    assert (a->getType()->getPrimitiveSizeInBits() == ty->getPrimitiveSizeInBits());
    2828    return CreateBitCast(a, ty);
     29}
     30
     31void IDISA_Builder::CallPrintRegisterCond(const std::string & regName, llvm::Value * const value, llvm::Value * const cond) {
     32    BasicBlock* callBlock = this->CreateBasicBlock("callBlock");
     33    BasicBlock* exitBlock = this->CreateBasicBlock("exitBlock");
     34    this->CreateCondBr(cond, callBlock, exitBlock);
     35
     36    this->SetInsertPoint(callBlock);
     37    this->CallPrintRegister(regName, value);
     38
     39    this->CreateBr(exitBlock);
     40    this->SetInsertPoint(exitBlock);
    2941}
    3042
  • icGREP/icgrep-devel/icgrep/IR_Gen/idisa_builder.h

    r6050 r6059  
    196196        return getStreamSetTy(getContext(), NumElements, FieldWidth);
    197197    }
    198    
     198
     199    void CallPrintRegisterCond(const std::string & regName, llvm::Value * const value, llvm::Value * const cond);
    199200    void CallPrintRegister(const std::string & regName, llvm::Value * const value);
    200201
  • icGREP/icgrep-devel/icgrep/kernels/lz4/lz4_index_builder.cpp

    r6047 r6059  
    566566        BasicBlock* entryBlock = b->GetInsertBlock();
    567567        Value* SIZE_1 = b->getSize(1);
    568         Value* SIZE_256 = b->getSize(fw);
    569         Value* INT256_0 = b->getIntN(fw, 0);
    570         Value* INT256_1 = b->getIntN(fw, 1);
    571 
    572         Value* endBlockIndex = b->CreateUDiv(position, SIZE_256);
    573         Value* endOffset = b->CreateZExt(b->CreateURem(position, SIZE_256), b->getIntNTy(fw));
     568        Value* SIZE_FW = b->getSize(fw);
     569        Value* INT_FW_0 = b->getIntN(fw, 0);
     570        Value* INT_FW_1 = b->getIntN(fw, 1);
     571
     572        Value* endBlockIndex = b->CreateUDiv(position, SIZE_FW);
     573        Value* endOffset = b->CreateZExt(b->CreateURem(position, SIZE_FW), b->getIntNTy(fw));
    574574
    575575        BasicBlock* appendMatchOffsetMarkerCon = b->CreateBasicBlock("appendMatchOffsetMarkerCon");
     
    594594        this->storeMatchOffsetMarker(b, phiCurrentIndex, phiEndBits);
    595595        phiCurrentIndex->addIncoming(b->CreateAdd(phiCurrentIndex, SIZE_1), b->GetInsertBlock());
    596         phiEndBits->addIncoming(INT256_0, b->GetInsertBlock());
     596        phiEndBits->addIncoming(INT_FW_0, b->GetInsertBlock());
    597597
    598598        b->CreateBr(appendMatchOffsetMarkerCon);
     
    600600        // ---- AppendM0Exit
    601601        b->SetInsertPoint(appendMatchOffsetMarkerExit);
    602         Value* finalEndBits = b->CreateOr(phiEndBits, b->CreateShl(INT256_1, endOffset));
     602        Value* finalEndBits = b->CreateOr(phiEndBits, b->CreateShl(INT_FW_1, endOffset));
    603603        b->setScalarField("pendingMarchOffsetMarkerIndex", phiCurrentIndex);
    604604        b->setScalarField("pendingMatchOffsetMarkerBits", finalEndBits);
  • icGREP/icgrep-devel/icgrep/kernels/multiblock_kernel.cpp

    r6047 r6059  
    127127    }
    128128    mIsFinal = b->CreateICmpEQ(mNumOfStrides, b->getSize(0));
     129        mIsFinal = b->CreateAnd(mIsFinal, mInitiallyFinal);
    129130    mNumOfStrides = b->CreateSelect(mIsFinal, mNumOfStridesInFinalSegment, mNumOfStrides);
    130131    for (unsigned i = 0; i < mStreamSetOutputs.size(); i++) {
  • icGREP/icgrep-devel/icgrep/lz4/LZ4Generator.cpp

    r6047 r6059  
    2323#include <kernels/lz4/lz4_block_decoder.h>
    2424#include <kernels/lz4/lz4_index_builder.h>
     25#include <kernels/lz4/lz4_index_builder_new.h>
     26#include <kernels/lz4/lz4_bytestream_aio.h>
     27#include <kernels/lz4/lz4_swizzled_aio.h>
    2528#include <kernels/bitstream_pdep_kernel.h>
    2629#include <kernels/lz4/lz4_bitstream_not_kernel.h>
     
    4043}
    4144
    42 void LZ4Generator::generateExtractOnlyPipeline(const std::string &outputFile) {
     45void LZ4Generator::generateNewExtractOnlyPipeline(const std::string &outputFile) {
    4346    auto & iBuilder = mPxDriver.getBuilder();
    4447    this->generateMainFunc(iBuilder);
     
    4851    // GeneratePipeline
    4952    this->generateLoadByteStreamAndBitStream(iBuilder);
    50     this->generateExtractAndDepositMarkers(iBuilder);
    51     StreamSetBuffer * const extractedBits = this->generateBitStreamExtractData(iBuilder);
    52 
    53     Kernel * p2sK = mPxDriver.addKernelInstance<P2SKernel>(iBuilder);
    54     mPxDriver.makeKernelCall(p2sK, {extractedBits}, {DecompressedByteStream});
    55 
    56     // --------------------------------------------------------
    57     // End
    58     Kernel * outK = mPxDriver.addKernelInstance<FileSink>(iBuilder, 8);
    59 
    60     outK->setInitialArguments({iBuilder->GetString(outputFile)});
    61     mPxDriver.makeKernelCall(outK, {DecompressedByteStream}, {});
    62 
    63     mPxDriver.generatePipelineIR();
    64     mPxDriver.deallocateBuffers();
    65 
    66     iBuilder->CreateRetVoid();
    67 
    68     mPxDriver.finalizeObject();
    69 }
    70 
    71 void LZ4Generator::generateSwizzledExtractOnlyPipeline(const std::string &outputFile) {
    72     auto & iBuilder = mPxDriver.getBuilder();
    73     this->generateMainFunc(iBuilder);
    74 
    75     StreamSetBuffer * const DecompressedByteStream = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8), this->getDecompressedBufferBlocks());
    76 
    77     // GeneratePipeline
    78     this->generateLoadByteStreamAndBitStream(iBuilder);
    79     this->generateExtractAndDepositMarkers(iBuilder);
    80     auto swizzle = this->generateSwizzleExtractData(iBuilder);
    81 
    82 
    83     // Produce unswizzled bit streams
    84     StreamSetBuffer * extractedbits = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(8), this->getInputBufferBlocks());
    85     Kernel * unSwizzleK = mPxDriver.addKernelInstance<SwizzleGenerator>(iBuilder, 8, 1, 2);
    86 
    87     mPxDriver.makeKernelCall(unSwizzleK, {swizzle.first, swizzle.second}, {extractedbits});
    88 
    89 
    90     Kernel * p2sK = mPxDriver.addKernelInstance<P2SKernel>(iBuilder);
    91     mPxDriver.makeKernelCall(p2sK, {extractedbits}, {DecompressedByteStream});
    92 
    93     // --------------------------------------------------------
    94     // End
    95     Kernel * outK = mPxDriver.addKernelInstance<FileSink>(iBuilder, 8);
    96 
    97     outK->setInitialArguments({iBuilder->GetString(outputFile)});
    98     mPxDriver.makeKernelCall(outK, {DecompressedByteStream}, {});
    99 
    100     mPxDriver.generatePipelineIR();
    101     mPxDriver.deallocateBuffers();
    102 
    103     iBuilder->CreateRetVoid();
    104 
    105     mPxDriver.finalizeObject();
    106 }
    107 
    108 void LZ4Generator::generateExtractAndDepositOnlyPipeline(const std::string &outputFile) {
    109     auto & iBuilder = mPxDriver.getBuilder();
    110     this->generateMainFunc(iBuilder);
    111 
    112     StreamSetBuffer * const DecompressedByteStream = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8), this->getDecompressedBufferBlocks());
    113 
    114     // GeneratePipeline
    115     this->generateLoadByteStreamAndBitStream(iBuilder);
    116     this->generateExtractAndDepositMarkers(iBuilder);
    117     StreamSetBuffer * const extractedBits = this->generateBitStreamExtractData(iBuilder);
    118 
    119     StreamSetBuffer * depositedBits = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(8), this->getDecompressedBufferBlocks());
    120     Kernel * bitStreamPDEPk = mPxDriver.addKernelInstance<BitStreamPDEPKernel>(iBuilder, 8);
    121     mPxDriver.makeKernelCall(bitStreamPDEPk, {mDepositMarker, extractedBits}, {depositedBits});
    122 
    123     Kernel * p2sK = mPxDriver.addKernelInstance<P2SKernel>(iBuilder);
    124     mPxDriver.makeKernelCall(p2sK, {depositedBits}, {DecompressedByteStream});
    125 
    126     // --------------------------------------------------------
    127     // End
    128     Kernel * outK = mPxDriver.addKernelInstance<FileSink>(iBuilder, 8);
    129 
    130     outK->setInitialArguments({iBuilder->GetString(outputFile)});
    131     mPxDriver.makeKernelCall(outK, {DecompressedByteStream}, {});
    132 
    133     mPxDriver.generatePipelineIR();
    134     mPxDriver.deallocateBuffers();
    135 
    136     iBuilder->CreateRetVoid();
    137 
    138     mPxDriver.finalizeObject();
    139 }
    140 
    141 void LZ4Generator::generateSwizzledExtractAndDepositOnlyPipeline(const std::string &outputFile) {
    142     auto & iBuilder = mPxDriver.getBuilder();
    143     this->generateMainFunc(iBuilder);
    144 
    145     StreamSetBuffer * const DecompressedByteStream = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8), this->getDecompressedBufferBlocks());
    146 
    147     // GeneratePipeline
    148     this->generateLoadByteStreamAndBitStream(iBuilder);
    149     this->generateExtractAndDepositMarkers(iBuilder);
    150 
    151     auto swizzle = this->generateSwizzleExtractData(iBuilder);
    152 
    153     StreamSetBuffer * depositedSwizzle0 = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(4), this->getInputBufferBlocks(), 1);
    154     StreamSetBuffer * depositedSwizzle1 = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(4), this->getInputBufferBlocks(), 1);
    155 
    156     Kernel * multiplePdepK = mPxDriver.addKernelInstance<SwizzledMultiplePDEPkernel>(iBuilder, 4, 2);
    157     mPxDriver.makeKernelCall(multiplePdepK, {mDepositMarker, swizzle.first, swizzle.second}, {depositedSwizzle0, depositedSwizzle1});
    158 
    159     // Produce unswizzled bit streams
    160     StreamSetBuffer * depositedBits = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(8), this->getInputBufferBlocks());
    161     Kernel * unSwizzleK = mPxDriver.addKernelInstance<SwizzleGenerator>(iBuilder, 8, 1, 2);
    162     mPxDriver.makeKernelCall(unSwizzleK, {depositedSwizzle0, depositedSwizzle1}, {depositedBits});
    163 
    164     Kernel * p2sK = mPxDriver.addKernelInstance<P2SKernel>(iBuilder);
    165     mPxDriver.makeKernelCall(p2sK, {depositedBits}, {DecompressedByteStream});
    166 
    167     // --------------------------------------------------------
    168     // End
    169     Kernel * outK = mPxDriver.addKernelInstance<FileSink>(iBuilder, 8);
    170     outK->setInitialArguments({iBuilder->GetString(outputFile)});
    171     mPxDriver.makeKernelCall(outK, {DecompressedByteStream}, {});
    172 
    173     mPxDriver.generatePipelineIR();
    174     mPxDriver.deallocateBuffers();
    175 
    176     iBuilder->CreateRetVoid();
    177 
    178     mPxDriver.finalizeObject();
    179 }
    180 
    181 void LZ4Generator::generatePipeline(const std::string &outputFile) {
    182     auto & iBuilder = mPxDriver.getBuilder();
    183     this->generateMainFunc(iBuilder);
    184 
    185     StreamSetBuffer * const DecompressedByteStream = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8), this->getDecompressedBufferBlocks());
    186 
    187     // GeneratePipeline
    188     this->generateLoadByteStreamAndBitStream(iBuilder);
    189     this->generateExtractAndDepositMarkers(iBuilder);
    190     StreamSetBuffer * const extractedBits = this->generateBitStreamExtractData(iBuilder);
    191 
    192     StreamSetBuffer * depositedBits = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(8), this->getDecompressedBufferBlocks());
    193     Kernel * bitStreamPDEPk = mPxDriver.addKernelInstance<BitStreamPDEPKernel>(iBuilder, 8);
    194     mPxDriver.makeKernelCall(bitStreamPDEPk, {mDepositMarker, extractedBits}, {depositedBits});
    195 
    196     StreamSetBuffer * matchCopiedBits = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(8), this->getInputBufferBlocks());
    197     Kernel * bitStreamMatchCopyK = mPxDriver.addKernelInstance<LZ4BitStreamMatchCopyKernel>(iBuilder, 8);
    198     mPxDriver.makeKernelCall(bitStreamMatchCopyK, {mMatchOffsetMarker, mM0Marker, mCompressedByteStream, depositedBits}, {matchCopiedBits});
    199 
    200     Kernel * p2sK = mPxDriver.addKernelInstance<P2SKernel>(iBuilder);
    201     mPxDriver.makeKernelCall(p2sK, {matchCopiedBits}, {DecompressedByteStream});
    202 
    203     // --------------------------------------------------------
    204     // End
    205     Kernel * outK = mPxDriver.addKernelInstance<FileSink>(iBuilder, 8);
    206 
    207     outK->setInitialArguments({iBuilder->GetString(outputFile)});
    208     mPxDriver.makeKernelCall(outK, {DecompressedByteStream}, {});
    209 
    210     mPxDriver.generatePipelineIR();
    211     mPxDriver.deallocateBuffers();
    212 
    213     iBuilder->CreateRetVoid();
    214 
    215     mPxDriver.finalizeObject();
    216 }
    217 
    218 void LZ4Generator::generateSwizzledPipeline(const std::string &outputFile) {
    219     auto & iBuilder = mPxDriver.getBuilder();
    220     this->generateMainFunc(iBuilder);
    221 
    222     StreamSetBuffer * const DecompressedByteStream = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8), this->getDecompressedBufferBlocks());
    223 
    224     // GeneratePipeline
    225     this->generateLoadByteStreamAndBitStream(iBuilder);
    226     this->generateExtractAndDepositMarkers(iBuilder);
    227 
    228     auto swizzle = this->generateSwizzleExtractData(iBuilder);
    229 
    230     StreamSetBuffer * depositedSwizzle0 = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(4), this->getDecompressedBufferBlocks(), 1);
    231     StreamSetBuffer * depositedSwizzle1 = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(4), this->getDecompressedBufferBlocks(), 1);
    232 
    233     Kernel * multiplePdepK = mPxDriver.addKernelInstance<SwizzledMultiplePDEPkernel>(iBuilder, 4, 2);
    234     mPxDriver.makeKernelCall(multiplePdepK, {mDepositMarker, swizzle.first, swizzle.second}, {depositedSwizzle0, depositedSwizzle1});
    235 
    236     StreamSetBuffer * matchCopiedSwizzle0 = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(4), this->getDecompressedBufferBlocks(), 1);
    237     StreamSetBuffer * matchCopiedSwizzle1 = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(4), this->getDecompressedBufferBlocks(), 1);
    238 
    239     Kernel * swizzledMatchCopyK = mPxDriver.addKernelInstance<LZ4SwizzledMatchCopyKernel>(iBuilder, 4, 2, 4);
    240     mPxDriver.makeKernelCall(swizzledMatchCopyK, {mMatchOffsetMarker, mM0Marker, mCompressedByteStream, depositedSwizzle0, depositedSwizzle1}, {matchCopiedSwizzle0, matchCopiedSwizzle1});
    241 
    242 
    243     // Produce unswizzled bit streams
    244     StreamSetBuffer * matchCopiedBits = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(8), this->getInputBufferBlocks());
    245     Kernel * unSwizzleK = mPxDriver.addKernelInstance<SwizzleGenerator>(iBuilder, 8, 1, 2);
    246     mPxDriver.makeKernelCall(unSwizzleK, {matchCopiedSwizzle0, matchCopiedSwizzle1}, {matchCopiedBits});
    247 
    248 
    249     Kernel * p2sK = mPxDriver.addKernelInstance<P2SKernel>(iBuilder);
    250     mPxDriver.makeKernelCall(p2sK, {matchCopiedBits}, {DecompressedByteStream});
    251 
    252     // --------------------------------------------------------
    253     // End
    254     Kernel * outK = mPxDriver.addKernelInstance<FileSink>(iBuilder, 8);
    255     outK->setInitialArguments({iBuilder->GetString(outputFile)});
    256     mPxDriver.makeKernelCall(outK, {DecompressedByteStream}, {});
    257 
    258     mPxDriver.generatePipelineIR();
    259     mPxDriver.deallocateBuffers();
    260 
    261     iBuilder->CreateRetVoid();
    262 
    263     mPxDriver.finalizeObject();
    264 }
    265 
    266 void LZ4Generator::generateMainFunc(const std::unique_ptr<kernel::KernelBuilder> & iBuilder) {
    267     Module * M = iBuilder->getModule();
    268     Type * const sizeTy = iBuilder->getSizeTy();
    269     Type * const boolTy = iBuilder->getIntNTy(sizeof(bool) * 8);
    270     Type * const voidTy = iBuilder->getVoidTy();
    271     Type * const inputType = iBuilder->getInt8PtrTy();
    272 
    273     Function * const main = cast<Function>(M->getOrInsertFunction("Main", voidTy, inputType, sizeTy, sizeTy, boolTy, nullptr));
    274     main->setCallingConv(CallingConv::C);
    275     Function::arg_iterator args = main->arg_begin();
    276     mInputStream = &*(args++);
    277     mInputStream->setName("input");
    278 
    279     mHeaderSize = &*(args++);
    280     mHeaderSize->setName("mHeaderSize");
    281 
    282     mFileSize = &*(args++);
    283     mFileSize->setName("mFileSize");
    284 
    285     mHasBlockChecksum = &*(args++);
    286     mHasBlockChecksum->setName("mHasBlockChecksum");
    287     // TODO for now, we do not handle blockCheckSum
    288     mHasBlockChecksum = iBuilder->getInt1(false);
    289 
    290     iBuilder->SetInsertPoint(BasicBlock::Create(M->getContext(), "entry", main, 0));
    291 }
    292 
    293 void LZ4Generator::generateLoadByteStreamAndBitStream(const std::unique_ptr<kernel::KernelBuilder> & iBuilder) {
    294     mCompressedByteStream = mPxDriver.addBuffer<ExternalBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8));
    295     mCompressedBasisBits = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(8, 1), this->getInputBufferBlocks());
    296 
    297     kernel::Kernel * sourceK = mPxDriver.addKernelInstance<MemorySourceKernel>(iBuilder);
    298     sourceK->setInitialArguments({mInputStream, mFileSize});
    299     mPxDriver.makeKernelCall(sourceK, {}, {mCompressedByteStream});
    300     Kernel * s2pk = mPxDriver.addKernelInstance<S2PKernel>(iBuilder, /*aligned = */ true);
    301 //    s2pk->addAttribute(MustConsumeAll());
    302     mPxDriver.makeKernelCall(s2pk, {mCompressedByteStream}, {mCompressedBasisBits});
    303 }
    304 
    305 void LZ4Generator::generateExtractAndDepositMarkers(const std::unique_ptr<kernel::KernelBuilder> & iBuilder) {
     53
    30654    //// Decode Block Information
    30755    StreamSetBuffer * const BlockData_IsCompressed = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8), this->getInputBufferBlocks(), 1);
     
    31260    StreamSetBuffer * const Extenders = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 1), this->getInputBufferBlocks(), 1);
    31361    mMatchOffsetMarker = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 1), this->getInputBufferBlocks());
    314         // FX and XF streams will be added to IndexBuilderKernel in the future
    315 //    StreamSetBuffer * const CC_0xFX = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 1), this->getInputBufferBlocks());
    316 //    StreamSetBuffer * const CC_0xXF = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 1), this->getInputBufferBlocks());
    317 
    31862    Kernel * extenderK = mPxDriver.addKernelInstance<ParabixCharacterClassKernelBuilder>(iBuilder, "extenders", std::vector<re::CC *>{re::makeCC(0xFF)}, 8);
    319 //    extenderK->addAttribute(MustConsumeAll());
    32063    mPxDriver.makeKernelCall(extenderK, {mCompressedBasisBits}, {Extenders});
    32164
     
    32568    mPxDriver.makeKernelCall(blockDecoderK, {mCompressedByteStream}, {BlockData_IsCompressed, BlockData_BlockStart, BlockData_BlockEnd});
    32669
    327 //    re::CC* xfCC = re::makeCC(0x0f);
    328 //    re::CC* fxCC = re::makeCC(0xf0);
    329 //    for (re::codepoint_t i = 1; i <= 0xf; i++) {
    330 //        xfCC = re::makeCC(xfCC, re::makeCC(i * 0x10 + 0x0f));
    331 //        fxCC = re::makeCC(fxCC, re::makeCC(0xf0 + i));
    332 //    }
    333 
    334 //    Kernel * CC_0xFXKernel = mPxDriver.addKernelInstance<ParabixCharacterClassKernelBuilder>(iBuilder, "CC_0xFX", std::vector<re::CC *>{fxCC}, 8);
    335 //    mPxDriver.makeKernelCall(CC_0xFXKernel, {mCompressedBasisBits}, {CC_0xFX});
    336 
    337 //    Kernel * CC_0xXFKernel = mPxDriver.addKernelInstance<ParabixCharacterClassKernelBuilder>(iBuilder, "CC_0xXF", std::vector<re::CC *>{xfCC}, 8);
    338 //    mPxDriver.makeKernelCall(CC_0xXFKernel, {mCompressedBasisBits}, {CC_0xXF});
    339 
    34070    //// Generate Extract/Deposit Markers, M0_Start, M0_End, MatchOffset
    341 
    34271    //TODO handle uncompressed part
    34372    StreamSetBuffer * const UncompressedStartPos = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 64), this->getInputBufferBlocks(), 1);
     
    34574    StreamSetBuffer * const UncompressedOutputPos = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 64), this->getInputBufferBlocks(), 1);
    34675
    347     mDeletionMarker = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 1), this->getInputBufferBlocks());
     76    mCompressionMarker = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 1), this->getInputBufferBlocks());
    34877    mM0Marker = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 1), this->getDecompressedBufferBlocks());
    34978    mDepositMarker = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 1), this->getDecompressedBufferBlocks());
    35079
    351     Kernel* Lz4IndexBuilderK = mPxDriver.addKernelInstance<LZ4IndexBuilderKernel>(iBuilder);
     80    Kernel* Lz4IndexBuilderK = mPxDriver.addKernelInstance<LZ4IndexBuilderNewKernel>(iBuilder);
    35281    Lz4IndexBuilderK->setInitialArguments({mFileSize});
    35382    mPxDriver.makeKernelCall(
     
    35685                    mCompressedByteStream,
    35786                    Extenders,
    358 //                    CC_0xFX,
    359 //                    CC_0xXF,
    36087
    36188                    // Block Data
     
    36996                    UncompressedOutputPos,
    37097
     98                    mCompressionMarker,
     99                    mM0Marker,
     100                    mMatchOffsetMarker
     101            });
     102
     103    Kernel * generateDepositK = mPxDriver.addKernelInstance<LZ4GenerateDepositStreamKernel>(iBuilder);
     104    mPxDriver.makeKernelCall(generateDepositK, {mM0Marker}, {mDepositMarker});
     105
     106
     107    // Deletion
     108    StreamSetBuffer * deletedBits = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(8), this->getInputBufferBlocks());
     109    StreamSetBuffer * deletionCounts = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(), this->getInputBufferBlocks());
     110
     111    Kernel * delK = mPxDriver.addKernelInstance<PEXTFieldCompressKernel>(iBuilder, 64, 8);
     112    mPxDriver.makeKernelCall(delK, {mCompressedBasisBits, mCompressionMarker}, {deletedBits, deletionCounts});
     113
     114    StreamSetBuffer * compressedBits = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(8), this->getInputBufferBlocks());
     115    Kernel * streamCompressionK = mPxDriver.addKernelInstance<StreamCompressKernel>(iBuilder, 64, 8);
     116    mPxDriver.makeKernelCall(streamCompressionK, {deletedBits, deletionCounts}, {compressedBits});
     117
     118
     119    StreamSetBuffer * const extractedBits = compressedBits;
     120
     121    Kernel * p2sK = mPxDriver.addKernelInstance<P2SKernel>(iBuilder);
     122    mPxDriver.makeKernelCall(p2sK, {extractedBits}, {DecompressedByteStream});
     123
     124    // --------------------------------------------------------
     125    // End
     126    Kernel * outK = mPxDriver.addKernelInstance<FileSink>(iBuilder, 8);
     127
     128    outK->setInitialArguments({iBuilder->GetString(outputFile)});
     129    mPxDriver.makeKernelCall(outK, {DecompressedByteStream}, {});
     130
     131    mPxDriver.generatePipelineIR();
     132    mPxDriver.deallocateBuffers();
     133
     134    iBuilder->CreateRetVoid();
     135
     136    mPxDriver.finalizeObject();
     137}
     138
     139void LZ4Generator::generateExtractOnlyPipeline(const std::string &outputFile) {
     140    auto & iBuilder = mPxDriver.getBuilder();
     141    this->generateMainFunc(iBuilder);
     142
     143    StreamSetBuffer * const DecompressedByteStream = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8), this->getDecompressedBufferBlocks());
     144
     145    // GeneratePipeline
     146    this->generateLoadByteStreamAndBitStream(iBuilder);
     147    this->generateExtractAndDepositMarkers(iBuilder);
     148    StreamSetBuffer * const extractedBits = this->generateBitStreamExtractData(iBuilder);
     149
     150    Kernel * p2sK = mPxDriver.addKernelInstance<P2SKernel>(iBuilder);
     151    mPxDriver.makeKernelCall(p2sK, {extractedBits}, {DecompressedByteStream});
     152
     153    // --------------------------------------------------------
     154    // End
     155    Kernel * outK = mPxDriver.addKernelInstance<FileSink>(iBuilder, 8);
     156
     157    outK->setInitialArguments({iBuilder->GetString(outputFile)});
     158    mPxDriver.makeKernelCall(outK, {DecompressedByteStream}, {});
     159
     160    mPxDriver.generatePipelineIR();
     161    mPxDriver.deallocateBuffers();
     162
     163    iBuilder->CreateRetVoid();
     164
     165    mPxDriver.finalizeObject();
     166}
     167
     168void LZ4Generator::generateSwizzledExtractOnlyPipeline(const std::string &outputFile) {
     169    auto & iBuilder = mPxDriver.getBuilder();
     170    this->generateMainFunc(iBuilder);
     171
     172    StreamSetBuffer * const DecompressedByteStream = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8), this->getDecompressedBufferBlocks());
     173
     174    // GeneratePipeline
     175    this->generateLoadByteStreamAndBitStream(iBuilder);
     176    this->generateExtractAndDepositMarkers(iBuilder);
     177    auto swizzle = this->generateSwizzleExtractData(iBuilder);
     178
     179
     180    // Produce unswizzled bit streams
     181    StreamSetBuffer * extractedbits = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(8), this->getInputBufferBlocks());
     182    Kernel * unSwizzleK = mPxDriver.addKernelInstance<SwizzleGenerator>(iBuilder, 8, 1, 2);
     183
     184    mPxDriver.makeKernelCall(unSwizzleK, {swizzle.first, swizzle.second}, {extractedbits});
     185
     186
     187    Kernel * p2sK = mPxDriver.addKernelInstance<P2SKernel>(iBuilder);
     188    mPxDriver.makeKernelCall(p2sK, {extractedbits}, {DecompressedByteStream});
     189
     190    // --------------------------------------------------------
     191    // End
     192    Kernel * outK = mPxDriver.addKernelInstance<FileSink>(iBuilder, 8);
     193
     194    outK->setInitialArguments({iBuilder->GetString(outputFile)});
     195    mPxDriver.makeKernelCall(outK, {DecompressedByteStream}, {});
     196
     197    mPxDriver.generatePipelineIR();
     198    mPxDriver.deallocateBuffers();
     199
     200    iBuilder->CreateRetVoid();
     201
     202    mPxDriver.finalizeObject();
     203}
     204
     205void LZ4Generator::generateExtractAndDepositOnlyPipeline(const std::string &outputFile) {
     206    auto & iBuilder = mPxDriver.getBuilder();
     207    this->generateMainFunc(iBuilder);
     208
     209    StreamSetBuffer * const DecompressedByteStream = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8), this->getDecompressedBufferBlocks());
     210
     211    // GeneratePipeline
     212    this->generateLoadByteStreamAndBitStream(iBuilder);
     213    this->generateExtractAndDepositMarkers(iBuilder);
     214    StreamSetBuffer * const extractedBits = this->generateBitStreamExtractData(iBuilder);
     215
     216    StreamSetBuffer * depositedBits = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(8), this->getDecompressedBufferBlocks());
     217    Kernel * bitStreamPDEPk = mPxDriver.addKernelInstance<BitStreamPDEPKernel>(iBuilder, 8);
     218    mPxDriver.makeKernelCall(bitStreamPDEPk, {mDepositMarker, extractedBits}, {depositedBits});
     219
     220    Kernel * p2sK = mPxDriver.addKernelInstance<P2SKernel>(iBuilder);
     221    mPxDriver.makeKernelCall(p2sK, {depositedBits}, {DecompressedByteStream});
     222
     223    // --------------------------------------------------------
     224    // End
     225    Kernel * outK = mPxDriver.addKernelInstance<FileSink>(iBuilder, 8);
     226
     227    outK->setInitialArguments({iBuilder->GetString(outputFile)});
     228    mPxDriver.makeKernelCall(outK, {DecompressedByteStream}, {});
     229
     230    mPxDriver.generatePipelineIR();
     231    mPxDriver.deallocateBuffers();
     232
     233    iBuilder->CreateRetVoid();
     234
     235    mPxDriver.finalizeObject();
     236}
     237
     238void LZ4Generator::generateSwizzledExtractAndDepositOnlyPipeline(const std::string &outputFile) {
     239    auto & iBuilder = mPxDriver.getBuilder();
     240    this->generateMainFunc(iBuilder);
     241
     242    StreamSetBuffer * const DecompressedByteStream = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8), this->getDecompressedBufferBlocks());
     243
     244    // GeneratePipeline
     245    this->generateLoadByteStreamAndBitStream(iBuilder);
     246    this->generateExtractAndDepositMarkers(iBuilder);
     247
     248    auto swizzle = this->generateSwizzleExtractData(iBuilder);
     249
     250    StreamSetBuffer * depositedSwizzle0 = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(4), this->getInputBufferBlocks(), 1);
     251    StreamSetBuffer * depositedSwizzle1 = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(4), this->getInputBufferBlocks(), 1);
     252
     253    Kernel * multiplePdepK = mPxDriver.addKernelInstance<SwizzledMultiplePDEPkernel>(iBuilder, 4, 2);
     254    mPxDriver.makeKernelCall(multiplePdepK, {mDepositMarker, swizzle.first, swizzle.second}, {depositedSwizzle0, depositedSwizzle1});
     255
     256    // Produce unswizzled bit streams
     257    StreamSetBuffer * depositedBits = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(8), this->getInputBufferBlocks());
     258    Kernel * unSwizzleK = mPxDriver.addKernelInstance<SwizzleGenerator>(iBuilder, 8, 1, 2);
     259    mPxDriver.makeKernelCall(unSwizzleK, {depositedSwizzle0, depositedSwizzle1}, {depositedBits});
     260
     261    Kernel * p2sK = mPxDriver.addKernelInstance<P2SKernel>(iBuilder);
     262    mPxDriver.makeKernelCall(p2sK, {depositedBits}, {DecompressedByteStream});
     263
     264    // --------------------------------------------------------
     265    // End
     266    Kernel * outK = mPxDriver.addKernelInstance<FileSink>(iBuilder, 8);
     267    outK->setInitialArguments({iBuilder->GetString(outputFile)});
     268    mPxDriver.makeKernelCall(outK, {DecompressedByteStream}, {});
     269
     270    mPxDriver.generatePipelineIR();
     271    mPxDriver.deallocateBuffers();
     272
     273    iBuilder->CreateRetVoid();
     274
     275    mPxDriver.finalizeObject();
     276}
     277
     278void LZ4Generator::generatePipeline(const std::string &outputFile) {
     279    auto & iBuilder = mPxDriver.getBuilder();
     280    this->generateMainFunc(iBuilder);
     281
     282    StreamSetBuffer * const DecompressedByteStream = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8), this->getDecompressedBufferBlocks());
     283
     284    // GeneratePipeline
     285    this->generateLoadByteStreamAndBitStream(iBuilder);
     286    this->generateExtractAndDepositMarkers(iBuilder);
     287    StreamSetBuffer * const extractedBits = this->generateBitStreamExtractData(iBuilder);
     288
     289    StreamSetBuffer * depositedBits = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(8), this->getDecompressedBufferBlocks());
     290    Kernel * bitStreamPDEPk = mPxDriver.addKernelInstance<BitStreamPDEPKernel>(iBuilder, 8);
     291    mPxDriver.makeKernelCall(bitStreamPDEPk, {mDepositMarker, extractedBits}, {depositedBits});
     292
     293    StreamSetBuffer * matchCopiedBits = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(8), this->getInputBufferBlocks());
     294    Kernel * bitStreamMatchCopyK = mPxDriver.addKernelInstance<LZ4BitStreamMatchCopyKernel>(iBuilder, 8);
     295    mPxDriver.makeKernelCall(bitStreamMatchCopyK, {mMatchOffsetMarker, mM0Marker, mCompressedByteStream, depositedBits}, {matchCopiedBits});
     296
     297    Kernel * p2sK = mPxDriver.addKernelInstance<P2SKernel>(iBuilder);
     298    mPxDriver.makeKernelCall(p2sK, {matchCopiedBits}, {DecompressedByteStream});
     299
     300    // --------------------------------------------------------
     301    // End
     302    Kernel * outK = mPxDriver.addKernelInstance<FileSink>(iBuilder, 8);
     303
     304    outK->setInitialArguments({iBuilder->GetString(outputFile)});
     305    mPxDriver.makeKernelCall(outK, {DecompressedByteStream}, {});
     306
     307    mPxDriver.generatePipelineIR();
     308    mPxDriver.deallocateBuffers();
     309
     310    iBuilder->CreateRetVoid();
     311
     312    mPxDriver.finalizeObject();
     313}
     314
     315void LZ4Generator::generateSwizzledPipeline(const std::string &outputFile) {
     316    auto & iBuilder = mPxDriver.getBuilder();
     317    this->generateMainFunc(iBuilder);
     318
     319    StreamSetBuffer * const DecompressedByteStream = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8), this->getDecompressedBufferBlocks());
     320
     321    // GeneratePipeline
     322    this->generateLoadByteStreamAndBitStream(iBuilder);
     323    this->generateExtractAndDepositMarkers(iBuilder);
     324
     325    auto swizzle = this->generateSwizzleExtractData(iBuilder);
     326
     327    StreamSetBuffer * depositedSwizzle0 = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(4), this->getDecompressedBufferBlocks(), 1);
     328    StreamSetBuffer * depositedSwizzle1 = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(4), this->getDecompressedBufferBlocks(), 1);
     329
     330    Kernel * multiplePdepK = mPxDriver.addKernelInstance<SwizzledMultiplePDEPkernel>(iBuilder, 4, 2);
     331    mPxDriver.makeKernelCall(multiplePdepK, {mDepositMarker, swizzle.first, swizzle.second}, {depositedSwizzle0, depositedSwizzle1});
     332
     333    StreamSetBuffer * matchCopiedSwizzle0 = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(4), this->getDecompressedBufferBlocks(), 1);
     334    StreamSetBuffer * matchCopiedSwizzle1 = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(4), this->getDecompressedBufferBlocks(), 1);
     335
     336    Kernel * swizzledMatchCopyK = mPxDriver.addKernelInstance<LZ4SwizzledMatchCopyKernel>(iBuilder, 4, 2, 4);
     337    mPxDriver.makeKernelCall(swizzledMatchCopyK, {mMatchOffsetMarker, mM0Marker, mCompressedByteStream, depositedSwizzle0, depositedSwizzle1}, {matchCopiedSwizzle0, matchCopiedSwizzle1});
     338
     339
     340    // Produce unswizzled bit streams
     341    StreamSetBuffer * matchCopiedBits = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(8), this->getInputBufferBlocks());
     342    Kernel * unSwizzleK = mPxDriver.addKernelInstance<SwizzleGenerator>(iBuilder, 8, 1, 2);
     343    mPxDriver.makeKernelCall(unSwizzleK, {matchCopiedSwizzle0, matchCopiedSwizzle1}, {matchCopiedBits});
     344
     345
     346    Kernel * p2sK = mPxDriver.addKernelInstance<P2SKernel>(iBuilder);
     347    mPxDriver.makeKernelCall(p2sK, {matchCopiedBits}, {DecompressedByteStream});
     348
     349    // --------------------------------------------------------
     350    // End
     351    Kernel * outK = mPxDriver.addKernelInstance<FileSink>(iBuilder, 8);
     352    outK->setInitialArguments({iBuilder->GetString(outputFile)});
     353    mPxDriver.makeKernelCall(outK, {DecompressedByteStream}, {});
     354
     355    mPxDriver.generatePipelineIR();
     356    mPxDriver.deallocateBuffers();
     357
     358    iBuilder->CreateRetVoid();
     359
     360    mPxDriver.finalizeObject();
     361}
     362
     363void LZ4Generator::generateMainFunc(const std::unique_ptr<kernel::KernelBuilder> & iBuilder) {
     364    Module * M = iBuilder->getModule();
     365    Type * const sizeTy = iBuilder->getSizeTy();
     366    Type * const boolTy = iBuilder->getIntNTy(sizeof(bool) * 8);
     367    Type * const voidTy = iBuilder->getVoidTy();
     368    Type * const inputType = iBuilder->getInt8PtrTy();
     369
     370    Function * const main = cast<Function>(M->getOrInsertFunction("Main", voidTy, inputType, sizeTy, sizeTy, boolTy, nullptr));
     371    main->setCallingConv(CallingConv::C);
     372    Function::arg_iterator args = main->arg_begin();
     373    mInputStream = &*(args++);
     374    mInputStream->setName("input");
     375
     376    mHeaderSize = &*(args++);
     377    mHeaderSize->setName("mHeaderSize");
     378
     379    mFileSize = &*(args++);
     380    mFileSize->setName("mFileSize");
     381
     382    mHasBlockChecksum = &*(args++);
     383    mHasBlockChecksum->setName("mHasBlockChecksum");
     384    // TODO for now, we do not handle blockCheckSum
     385    mHasBlockChecksum = iBuilder->getInt1(false);
     386
     387    iBuilder->SetInsertPoint(BasicBlock::Create(M->getContext(), "entry", main, 0));
     388}
     389
     390void LZ4Generator::generateLoadByteStreamAndBitStream(const std::unique_ptr<kernel::KernelBuilder> & iBuilder) {
     391    mCompressedByteStream = mPxDriver.addBuffer<ExternalBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8));
     392    mCompressedBasisBits = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(8, 1), this->getInputBufferBlocks());
     393
     394    kernel::Kernel * sourceK = mPxDriver.addKernelInstance<MemorySourceKernel>(iBuilder);
     395    sourceK->setInitialArguments({mInputStream, mFileSize});
     396    mPxDriver.makeKernelCall(sourceK, {}, {mCompressedByteStream});
     397    Kernel * s2pk = mPxDriver.addKernelInstance<S2PKernel>(iBuilder, /*aligned = */ true);
     398    mPxDriver.makeKernelCall(s2pk, {mCompressedByteStream}, {mCompressedBasisBits});
     399}
     400
     401StreamSetBuffer * LZ4Generator::generateSwizzledAIODecompression(const std::unique_ptr<kernel::KernelBuilder> & iBuilder) {
     402    //// Decode Block Information
     403    StreamSetBuffer * const BlockData_IsCompressed = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8), this->getInputBufferBlocks(), 1);
     404    StreamSetBuffer * const BlockData_BlockStart = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 64), this->getInputBufferBlocks(), 1);
     405    StreamSetBuffer * const BlockData_BlockEnd = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 64), this->getInputBufferBlocks(), 1);
     406
     407    //// Generate Helper Markers Extenders, FX, XF
     408    StreamSetBuffer * const Extenders = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 1), this->getInputBufferBlocks(), 1);
     409    mMatchOffsetMarker = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 1), this->getInputBufferBlocks());
     410    Kernel * extenderK = mPxDriver.addKernelInstance<ParabixCharacterClassKernelBuilder>(iBuilder, "extenders", std::vector<re::CC *>{re::makeCC(0xFF)}, 8);
     411    mPxDriver.makeKernelCall(extenderK, {mCompressedBasisBits}, {Extenders});
     412
     413
     414    Kernel * blockDecoderK = mPxDriver.addKernelInstance<LZ4BlockDecoderNewKernel>(iBuilder);
     415    blockDecoderK->setInitialArguments({iBuilder->CreateTrunc(mHasBlockChecksum, iBuilder->getInt1Ty()), mHeaderSize, mFileSize});
     416    mPxDriver.makeKernelCall(blockDecoderK, {mCompressedByteStream}, {BlockData_IsCompressed, BlockData_BlockStart, BlockData_BlockEnd});
     417
     418
     419    // Produce unswizzled bit streams
     420    StreamSetBuffer * u16Swizzle0 = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(4), this->getInputBufferBlocks(), 1);
     421    StreamSetBuffer * u16Swizzle1 = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(4), this->getInputBufferBlocks(), 1);
     422    Kernel * unSwizzleK = mPxDriver.addKernelInstance<SwizzleGenerator>(iBuilder, 8, 2, 1, 64, "source");
     423    mPxDriver.makeKernelCall(unSwizzleK, {mCompressedBasisBits}, {u16Swizzle0, u16Swizzle1});
     424
     425
     426
     427    StreamSetBuffer * decompressedSwizzled0 = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(4), this->getInputBufferBlocks(), 1);
     428    StreamSetBuffer * decompressedSwizzled1 = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(4), this->getInputBufferBlocks(), 1);
     429
     430
     431    Kernel* lz4AioK = mPxDriver.addKernelInstance<LZ4SwizzledAioKernel>(iBuilder, 4, 2, 4);
     432    lz4AioK->setInitialArguments({mFileSize});
     433    mPxDriver.makeKernelCall(
     434            lz4AioK,
     435            {
     436                    mCompressedByteStream,
     437                    Extenders,
     438
     439                    // Block Data
     440                    BlockData_IsCompressed,
     441                    BlockData_BlockStart,
     442                    BlockData_BlockEnd,
     443
     444                    u16Swizzle0,
     445                    u16Swizzle1
     446            }, {
     447                    decompressedSwizzled0,
     448                    decompressedSwizzled1
     449            });
     450
     451
     452    StreamSetBuffer * const decompressionBitStream = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(8, 1), this->getDecompressedBufferBlocks());
     453
     454    Kernel * unSwizzleK2 = mPxDriver.addKernelInstance<SwizzleGenerator>(iBuilder, 8, 1, 2);
     455    mPxDriver.makeKernelCall(unSwizzleK2, {decompressedSwizzled0, decompressedSwizzled1}, {decompressionBitStream});
     456
     457    return decompressionBitStream;
     458}
     459
     460
     461
     462StreamSetBuffer * LZ4Generator::generateAIODecompression(const std::unique_ptr<kernel::KernelBuilder> & iBuilder) {
     463    //// Decode Block Information
     464    StreamSetBuffer * const BlockData_IsCompressed = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8), this->getInputBufferBlocks(), 1);
     465    StreamSetBuffer * const BlockData_BlockStart = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 64), this->getInputBufferBlocks(), 1);
     466    StreamSetBuffer * const BlockData_BlockEnd = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 64), this->getInputBufferBlocks(), 1);
     467
     468    //// Generate Helper Markers Extenders, FX, XF
     469    StreamSetBuffer * const Extenders = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 1), this->getInputBufferBlocks(), 1);
     470    mMatchOffsetMarker = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 1), this->getInputBufferBlocks());
     471    Kernel * extenderK = mPxDriver.addKernelInstance<ParabixCharacterClassKernelBuilder>(iBuilder, "extenders", std::vector<re::CC *>{re::makeCC(0xFF)}, 8);
     472    mPxDriver.makeKernelCall(extenderK, {mCompressedBasisBits}, {Extenders});
     473
     474
     475    Kernel * blockDecoderK = mPxDriver.addKernelInstance<LZ4BlockDecoderNewKernel>(iBuilder);
     476    blockDecoderK->setInitialArguments({iBuilder->CreateTrunc(mHasBlockChecksum, iBuilder->getInt1Ty()), mHeaderSize, mFileSize});
     477    mPxDriver.makeKernelCall(blockDecoderK, {mCompressedByteStream}, {BlockData_IsCompressed, BlockData_BlockStart, BlockData_BlockEnd});
     478
     479
     480    StreamSetBuffer * const decompressionByteStream = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8), this->getDecompressedBufferBlocks());
     481
     482    Kernel* lz4AioK = mPxDriver.addKernelInstance<LZ4ByteStreamAioKernel>(iBuilder);
     483    lz4AioK->setInitialArguments({mFileSize});
     484    mPxDriver.makeKernelCall(
     485            lz4AioK,
     486            {
     487                    mCompressedByteStream,
     488                    Extenders,
     489
     490                    // Block Data
     491                    BlockData_IsCompressed,
     492                    BlockData_BlockStart,
     493                    BlockData_BlockEnd
     494            }, {
     495                    decompressionByteStream
     496            });
     497
     498    return decompressionByteStream;
     499}
     500
     501void LZ4Generator::generateExtractAndDepositMarkers(const std::unique_ptr<kernel::KernelBuilder> & iBuilder) {
     502    //// Decode Block Information
     503    StreamSetBuffer * const BlockData_IsCompressed = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8), this->getInputBufferBlocks(), 1);
     504    StreamSetBuffer * const BlockData_BlockStart = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 64), this->getInputBufferBlocks(), 1);
     505    StreamSetBuffer * const BlockData_BlockEnd = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 64), this->getInputBufferBlocks(), 1);
     506
     507    //// Generate Helper Markers Extenders, FX, XF
     508    StreamSetBuffer * const Extenders = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 1), this->getInputBufferBlocks(), 1);
     509    mMatchOffsetMarker = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 1), this->getInputBufferBlocks());
     510    Kernel * extenderK = mPxDriver.addKernelInstance<ParabixCharacterClassKernelBuilder>(iBuilder, "extenders", std::vector<re::CC *>{re::makeCC(0xFF)}, 8);
     511    mPxDriver.makeKernelCall(extenderK, {mCompressedBasisBits}, {Extenders});
     512
     513
     514    Kernel * blockDecoderK = mPxDriver.addKernelInstance<LZ4BlockDecoderNewKernel>(iBuilder);
     515    blockDecoderK->setInitialArguments({iBuilder->CreateTrunc(mHasBlockChecksum, iBuilder->getInt1Ty()), mHeaderSize, mFileSize});
     516    mPxDriver.makeKernelCall(blockDecoderK, {mCompressedByteStream}, {BlockData_IsCompressed, BlockData_BlockStart, BlockData_BlockEnd});
     517
     518    //// Generate Extract/Deposit Markers, M0_Start, M0_End, MatchOffset
     519
     520    //TODO handle uncompressed part
     521    StreamSetBuffer * const UncompressedStartPos = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 64), this->getInputBufferBlocks(), 1);
     522    StreamSetBuffer * const UncompressedLength = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 64), this->getInputBufferBlocks(), 1);
     523    StreamSetBuffer * const UncompressedOutputPos = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 64), this->getInputBufferBlocks(), 1);
     524
     525    mDeletionMarker = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 1), this->getInputBufferBlocks());
     526    mM0Marker = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 1), this->getDecompressedBufferBlocks());
     527    mDepositMarker = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 1), this->getDecompressedBufferBlocks());
     528
     529    Kernel* Lz4IndexBuilderK = mPxDriver.addKernelInstance<LZ4IndexBuilderKernel>(iBuilder);
     530    Lz4IndexBuilderK->setInitialArguments({mFileSize});
     531    mPxDriver.makeKernelCall(
     532            Lz4IndexBuilderK,
     533            {
     534                    mCompressedByteStream,
     535                    Extenders,
     536
     537                    // Block Data
     538                    BlockData_IsCompressed,
     539                    BlockData_BlockStart,
     540                    BlockData_BlockEnd
     541            }, {
     542                    //Uncompressed Data
     543                    UncompressedStartPos,
     544                    UncompressedLength,
     545                    UncompressedOutputPos,
     546
    371547                    mDeletionMarker,
    372548                    mM0Marker,
  • icGREP/icgrep-devel/icgrep/lz4/LZ4Generator.h

    r6043 r6059  
    2828    void generatePipeline(const std::string &outputFile);
    2929    void generateSwizzledPipeline(const std::string &outputFile);
     30    void generateNewExtractOnlyPipeline(const std::string &outputFile);
    3031    void generateExtractOnlyPipeline(const std::string &outputFile);
    3132    void generateSwizzledExtractOnlyPipeline(const std::string &outputFile);
     
    3940    virtual void generateLoadByteStreamAndBitStream(const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
    4041    virtual void generateExtractAndDepositMarkers(const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
     42    virtual parabix::StreamSetBuffer * generateAIODecompression(const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
     43    virtual parabix::StreamSetBuffer * generateSwizzledAIODecompression(const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
    4144    virtual std::pair<parabix::StreamSetBuffer*, parabix::StreamSetBuffer*> generateSwizzleExtractData(const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
    4245    virtual parabix::StreamSetBuffer* generateBitStreamExtractData(const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
  • icGREP/icgrep-devel/icgrep/lz4/LZ4GrepGenerator.cpp

    r6047 r6059  
    5151#include <llvm/Support/raw_ostream.h>
    5252#include <llvm/Support/Debug.h>
    53 
     53#include <kernels/lz4/lz4_block_decoder.h>
     54#include <kernels/lz4/lz4_swizzled_aio.h>
    5455
    5556
     
    106107}
    107108
     109StreamSetBuffer * LZ4GrepGenerator::convertCompressedBitsStreamWithAioApproach(parabix::StreamSetBuffer* compressedBitStream, int numberOfStream, std::string prefix) {
     110    auto mGrepDriver = &mPxDriver;
     111    auto & iBuilder = mGrepDriver->getBuilder();
     112
     113    //// Decode Block Information
     114    StreamSetBuffer * const BlockData_IsCompressed = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8), this->getInputBufferBlocks(), 1);
     115    StreamSetBuffer * const BlockData_BlockStart = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 64), this->getInputBufferBlocks(), 1);
     116    StreamSetBuffer * const BlockData_BlockEnd = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 64), this->getInputBufferBlocks(), 1);
     117
     118    //// Generate Helper Markers Extenders, FX, XF
     119    StreamSetBuffer * const Extenders = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 1), this->getInputBufferBlocks(), 1);
     120    mMatchOffsetMarker = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 1), this->getInputBufferBlocks());
     121    Kernel * extenderK = mPxDriver.addKernelInstance<ParabixCharacterClassKernelBuilder>(iBuilder, "extenders", std::vector<re::CC *>{re::makeCC(0xFF)}, 8);
     122    mPxDriver.makeKernelCall(extenderK, {mCompressedBasisBits}, {Extenders});
     123
     124
     125    Kernel * blockDecoderK = mPxDriver.addKernelInstance<LZ4BlockDecoderNewKernel>(iBuilder);
     126    blockDecoderK->setInitialArguments({iBuilder->CreateTrunc(mHasBlockChecksum, iBuilder->getInt1Ty()), mHeaderSize, mFileSize});
     127    mPxDriver.makeKernelCall(blockDecoderK, {mCompressedByteStream}, {BlockData_IsCompressed, BlockData_BlockStart, BlockData_BlockEnd});
     128
     129
     130    // Produce unswizzled bit streams
     131    StreamSetBuffer * u16Swizzle0 = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(4), this->getInputBufferBlocks(), 1);
     132    Kernel * unSwizzleK = mPxDriver.addKernelInstance<SwizzleGenerator>(iBuilder, 4, 1, 1, 64, "source");
     133    mPxDriver.makeKernelCall(unSwizzleK, {compressedBitStream}, {u16Swizzle0});
     134
     135    StreamSetBuffer * decompressedSwizzled0 = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(4), this->getInputBufferBlocks(), 1);
     136
     137
     138    Kernel* lz4AioK = mPxDriver.addKernelInstance<LZ4SwizzledAioKernel>(iBuilder, 4, 1, 4);
     139    lz4AioK->setInitialArguments({mFileSize});
     140    mPxDriver.makeKernelCall(
     141            lz4AioK,
     142            {
     143                    mCompressedByteStream,
     144                    Extenders,
     145
     146                    // Block Data
     147                    BlockData_IsCompressed,
     148                    BlockData_BlockStart,
     149                    BlockData_BlockEnd,
     150
     151                    u16Swizzle0,
     152            }, {
     153                    decompressedSwizzled0,
     154            });
     155
     156
     157
     158    StreamSetBuffer * const decompressionBitStream = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(8, 1), this->getDecompressedBufferBlocks());
     159    // TODO deadloop when add unswizzled kernel
     160    Kernel * unSwizzleK2 = mPxDriver.addKernelInstance<SwizzleGenerator>(iBuilder, 4, 1, 1, 64, "dst");
     161    mPxDriver.makeKernelCall(unSwizzleK2, {decompressedSwizzled0}, {decompressionBitStream});
     162
     163    return decompressionBitStream;
     164
     165}
     166
     167StreamSetBuffer * LZ4GrepGenerator::convertCompressedBitsStreamWithSwizzledApproach(parabix::StreamSetBuffer* compressedBitStream, int numberOfStream, std::string prefix) {
     168    auto mGrepDriver = &mPxDriver;
     169    auto & idb = mGrepDriver->getBuilder();
     170
     171    StreamSetBuffer * u16Swizzle0 = mPxDriver.addBuffer<StaticBuffer>(idb, idb->getStreamSetTy(4), this->getInputBufferBlocks(), 1);
     172    Kernel * delK = mPxDriver.addKernelInstance<SwizzledDeleteByPEXTkernel>(idb, 4, 64);
     173    mPxDriver.makeKernelCall(delK, {mDeletionMarker, compressedBitStream}, {u16Swizzle0});
     174
     175    StreamSetBuffer * depositedSwizzle0 = mPxDriver.addBuffer<StaticBuffer>(idb, idb->getStreamSetTy(4), this->getInputBufferBlocks(), 1);
     176    Kernel * multiplePdepK = mPxDriver.addKernelInstance<SwizzledMultiplePDEPkernel>(idb, 4, 1);
     177    mPxDriver.makeKernelCall(multiplePdepK, {mDepositMarker, u16Swizzle0}, {depositedSwizzle0});
     178
     179    StreamSetBuffer * matchCopiedSwizzle0 = mPxDriver.addBuffer<StaticBuffer>(idb, idb->getStreamSetTy(4), this->getDecompressedBufferBlocks(), 1);
     180    Kernel * swizzledMatchCopyK = mPxDriver.addKernelInstance<LZ4SwizzledMatchCopyKernel>(idb, 4, 1, 4);
     181    mPxDriver.makeKernelCall(swizzledMatchCopyK, {mMatchOffsetMarker, mM0Marker, mCompressedByteStream, depositedSwizzle0}, {matchCopiedSwizzle0});
     182
     183    // Produce unswizzled bit streams
     184    StreamSetBuffer * matchCopiedBits = mPxDriver.addBuffer<StaticBuffer>(idb, idb->getStreamSetTy(8), this->getInputBufferBlocks());
     185    Kernel * unSwizzleK = mPxDriver.addKernelInstance<SwizzleGenerator>(idb, 4, 1, 1);
     186    mPxDriver.makeKernelCall(unSwizzleK, {matchCopiedSwizzle0}, {matchCopiedBits});
     187
     188    return matchCopiedBits;
     189}
    108190parabix::StreamSetBuffer * LZ4GrepGenerator::convertCompressedBitsStream(parabix::StreamSetBuffer* compressedBitStream, int numberOfStream, std::string prefix) {
     191    if (numberOfStream == 4) {
     192        return this->convertCompressedBitsStreamWithSwizzledApproach(compressedBitStream, numberOfStream, prefix);
     193    }
     194
    109195    auto mGrepDriver = &mPxDriver;
    110196    auto & idb = mGrepDriver->getBuilder();
     
    147233}
    148234
    149 
    150 std::pair<parabix::StreamSetBuffer *, parabix::StreamSetBuffer *> LZ4GrepGenerator::multiplexingGrepPipeline(std::vector<re::RE *> &REs) {
    151 
     235void LZ4GrepGenerator::generateMultiplexingCompressedBitStream(std::vector<re::RE *> &REs) {
    152236    this->initREs(REs);
    153237    auto mGrepDriver = &mPxDriver;
     
    159243    int MaxCountFlag = 0;
    160244
     245
    161246    //  Regular Expression Processing and Analysis Phase
    162247    const auto nREs = mREs.size();
    163248
    164249    std::vector<StreamSetBuffer *> MatchResultsBufs(nREs);
    165 
    166 
    167 
    168     if (mGrepRecordBreak == GrepRecordBreakKind::LF) {
    169     } else if (mGrepRecordBreak == GrepRecordBreakKind::Null) {
    170         // TODO fix here
    171 //        kernel::Kernel * breakK = mGrepDriver->addKernelInstance<kernel::ParabixCharacterClassKernelBuilder>(idb, "Null", std::vector<re::CC *>{mBreakCC}, 8);
    172 //        mGrepDriver->makeKernelCall(breakK, {matchCopiedBasisBits}, {LineBreakStream});
    173     }
    174250
    175251    std::map<std::string, StreamSetBuffer *> propertyStream;
     
    188264
    189265    kernel::Kernel * ccK = mGrepDriver->addKernelInstance<kernel::CharClassesKernel>(idb, std::move(mpx_basis));
    190     mGrepDriver->makeKernelCall(ccK, {mCompressedBasisBits}, {CharClasses}); //TODO get it from compression space
     266    mGrepDriver->makeKernelCall(ccK, {mCompressedBasisBits}, {CharClasses});
    191267
    192268    StreamSetBuffer * CompressedLineFeedStream = mPxDriver.addBuffer<StaticBuffer>(idb, idb->getStreamSetTy(1, 1), baseBufferSize);
     
    197273    kernel::Kernel* streamCombineKernel = mPxDriver.addKernelInstance<StreamsCombineKernel>(idb, std::vector<unsigned>({1, (unsigned)numOfCharacterClasses}));
    198274    mPxDriver.makeKernelCall(streamCombineKernel, {CompressedLineFeedStream, CharClasses}, {combinedStream});
    199 
    200     StreamSetBuffer * decompressedCombinedStream = this->convertCompressedBitsStream(combinedStream, 1 + numOfCharacterClasses, "combined");
     275    StreamSetBuffer * decompressedCombinedStream = nullptr;
     276
     277    decompressedCombinedStream = this->convertCompressedBitsStreamWithAioApproach(combinedStream, 1 + numOfCharacterClasses, "combined");
     278
     279/*
    201280    StreamSetBuffer * LineBreakStream = mGrepDriver->addBuffer<StaticBuffer>(idb, idb->getStreamSetTy(1), baseBufferSize);
    202281    StreamSetBuffer * decompressedCharClasses = mGrepDriver->addBuffer<StaticBuffer>(idb, idb->getStreamSetTy(numOfCharacterClasses), baseBufferSize);
     
    204283    mPxDriver.makeKernelCall(streamSplitKernel, {decompressedCombinedStream}, {LineBreakStream, decompressedCharClasses});
    205284
    206     /*
    207     StreamSetBuffer * LineBreakStream = this->convertCompressedBitsStream(CompressedLineFeedStream, 1, "LineFeed");
    208     StreamSetBuffer * decompressedCharClasses = this->convertCompressedBitsStream(CharClasses, numOfCharacterClasses, "mpx");
    209      */
     285
    210286
    211287    StreamSetBuffer * fakeMatchCopiedBits = mPxDriver.addBuffer<StaticBuffer>(idb, idb->getStreamSetTy(8), this->getInputBufferBlocks());
     
    240316
    241317    return std::pair<StreamSetBuffer *, StreamSetBuffer *>(LineBreakStream, Matches);
     318    */
     319
    242320};
    243 
    244 std::pair<parabix::StreamSetBuffer *, parabix::StreamSetBuffer *> LZ4GrepGenerator::grepPipeline(
    245         std::vector<re::RE *> &REs, parabix::StreamSetBuffer *decompressedBasisBits) {
     321std::pair<parabix::StreamSetBuffer *, parabix::StreamSetBuffer *> LZ4GrepGenerator::multiplexingGrepPipeline(std::vector<re::RE *> &REs, bool useAio) {
    246322
    247323    this->initREs(REs);
     
    251327    // TODO: until we automate stream buffer sizing, use this calculation to determine how large our matches buffer needs to be.
    252328    const unsigned baseBufferSize = this->getInputBufferBlocks();
     329    bool CC_Multiplexing = true;
    253330    int MaxCountFlag = 0;
    254331
     
    256333    const auto nREs = mREs.size();
    257334
    258     StreamSetBuffer * LineBreakStream = mGrepDriver->addBuffer<StaticBuffer>(idb, idb->getStreamSetTy(1, 1), baseBufferSize);
    259335    std::vector<StreamSetBuffer *> MatchResultsBufs(nREs);
    260336
    261     StreamSetBuffer * RequiredStreams = mGrepDriver->addBuffer<StaticBuffer>(idb, idb->getStreamSetTy(1, 1), baseBufferSize);
    262     StreamSetBuffer * UnicodeLB = mGrepDriver->addBuffer<StaticBuffer>(idb, idb->getStreamSetTy(1, 1), baseBufferSize);
    263 
    264     StreamSetBuffer * LineFeedStream = this->linefeedStreamFromDecompressedBits(decompressedBasisBits);
    265 
    266     kernel::Kernel * requiredStreamsK = mGrepDriver->addKernelInstance<kernel::RequiredStreams_UTF8>(idb);
    267     mGrepDriver->makeKernelCall(requiredStreamsK, {decompressedBasisBits, LineFeedStream}, {RequiredStreams, UnicodeLB});
     337
    268338
    269339    if (mGrepRecordBreak == GrepRecordBreakKind::LF) {
    270         LineBreakStream = LineFeedStream;
    271340    } else if (mGrepRecordBreak == GrepRecordBreakKind::Null) {
    272         kernel::Kernel * breakK = mGrepDriver->addKernelInstance<kernel::ParabixCharacterClassKernelBuilder>(idb, "Null", std::vector<re::CC *>{mBreakCC}, 8);
    273         mGrepDriver->makeKernelCall(breakK, {decompressedBasisBits}, {LineBreakStream});
     341        // TODO fix here
     342//        kernel::Kernel * breakK = mGrepDriver->addKernelInstance<kernel::ParabixCharacterClassKernelBuilder>(idb, "Null", std::vector<re::CC *>{mBreakCC}, 8);
     343//        mGrepDriver->makeKernelCall(breakK, {matchCopiedBasisBits}, {LineBreakStream});
     344    }
     345
     346    std::map<std::string, StreamSetBuffer *> propertyStream;
     347
     348    std::vector<std::string> externalStreamNames;
     349    std::set<re::Name *> UnicodeProperties;
     350
     351    const auto UnicodeSets = re::collectCCs(mREs[0], &cc::Unicode, std::set<re::Name *>({re::makeZeroWidth("\\b{g}")}));
     352    StreamSetBuffer * const MatchResults = mGrepDriver->addBuffer<StaticBuffer>(idb, idb->getStreamSetTy(1, 1), baseBufferSize);
     353
     354    mpx = make_unique<cc::MultiplexedAlphabet>("mpx", UnicodeSets);
     355    mREs[0] = transformCCs(mpx.get(), mREs[0]);
     356    std::vector<re::CC *> mpx_basis = mpx->getMultiplexedCCs();
     357    auto numOfCharacterClasses = mpx_basis.size();
     358    StreamSetBuffer * CharClasses = mGrepDriver->addBuffer<StaticBuffer>(idb, idb->getStreamSetTy(numOfCharacterClasses), baseBufferSize);
     359
     360    kernel::Kernel * ccK = mGrepDriver->addKernelInstance<kernel::CharClassesKernel>(idb, std::move(mpx_basis));
     361    mGrepDriver->makeKernelCall(ccK, {mCompressedBasisBits}, {CharClasses});
     362
     363    StreamSetBuffer * CompressedLineFeedStream = mPxDriver.addBuffer<StaticBuffer>(idb, idb->getStreamSetTy(1, 1), baseBufferSize);
     364    kernel::Kernel * linefeedK = mPxDriver.addKernelInstance<kernel::LineFeedKernelBuilder>(idb, Binding{idb->getStreamSetTy(8), "basis", FixedRate(), Principal()});
     365    mPxDriver.makeKernelCall(linefeedK, {mCompressedBasisBits}, {CompressedLineFeedStream});
     366
     367    StreamSetBuffer * combinedStream = mGrepDriver->addBuffer<StaticBuffer>(idb, idb->getStreamSetTy(numOfCharacterClasses + 1), baseBufferSize);
     368    kernel::Kernel* streamCombineKernel = mPxDriver.addKernelInstance<StreamsCombineKernel>(idb, std::vector<unsigned>({1, (unsigned)numOfCharacterClasses}));
     369    mPxDriver.makeKernelCall(streamCombineKernel, {CompressedLineFeedStream, CharClasses}, {combinedStream});
     370    StreamSetBuffer * decompressedCombinedStream = nullptr;
     371
     372    if (useAio) {
     373        decompressedCombinedStream = this->convertCompressedBitsStreamWithAioApproach(combinedStream, 1 + numOfCharacterClasses, "combined");
    274374    } else {
    275         LineBreakStream = UnicodeLB;
    276     }
    277 
    278     std::map<std::string, StreamSetBuffer *> propertyStream;
    279 
    280     for(unsigned i = 0; i < nREs; ++i) {
    281         std::vector<std::string> externalStreamNames;
    282         std::vector<StreamSetBuffer *> icgrepInputSets = {decompressedBasisBits};
    283         if (mGrepRecordBreak == GrepRecordBreakKind::Unicode) {
    284             externalStreamNames.push_back("UTF8_LB");
    285             icgrepInputSets.push_back(LineBreakStream);
    286             externalStreamNames.push_back("UTF8_nonfinal");
    287             icgrepInputSets.push_back(RequiredStreams);
    288         }
    289         std::set<re::Name *> UnicodeProperties;
    290 
    291         StreamSetBuffer * MatchResults = mGrepDriver->addBuffer<StaticBuffer>(idb, idb->getStreamSetTy(1, 1), baseBufferSize);
    292         kernel::Kernel * icgrepK = mGrepDriver->addKernelInstance<kernel::ICGrepKernel>(idb, mREs[i], externalStreamNames);
    293         mGrepDriver->makeKernelCall(icgrepK, icgrepInputSets, {MatchResults});
    294         MatchResultsBufs[i] = MatchResults;
    295     }
     375        decompressedCombinedStream = this->convertCompressedBitsStream(combinedStream, 1 + numOfCharacterClasses, "combined");
     376    }
     377
     378    StreamSetBuffer * LineBreakStream = mGrepDriver->addBuffer<StaticBuffer>(idb, idb->getStreamSetTy(1), baseBufferSize);
     379    StreamSetBuffer * decompressedCharClasses = mGrepDriver->addBuffer<StaticBuffer>(idb, idb->getStreamSetTy(numOfCharacterClasses), baseBufferSize);
     380    kernel::Kernel* streamSplitKernel = mPxDriver.addKernelInstance<StreamsSplitKernel>(idb, std::vector<unsigned>({1, (unsigned)numOfCharacterClasses}));
     381    mPxDriver.makeKernelCall(streamSplitKernel, {decompressedCombinedStream}, {LineBreakStream, decompressedCharClasses});
     382
     383    /*
     384    StreamSetBuffer * LineBreakStream = this->convertCompressedBitsStream(CompressedLineFeedStream, 1, "LineFeed");
     385    StreamSetBuffer * decompressedCharClasses = this->convertCompressedBitsStream(CharClasses, numOfCharacterClasses, "mpx");
     386     */
     387
     388    StreamSetBuffer * fakeMatchCopiedBits = mPxDriver.addBuffer<StaticBuffer>(idb, idb->getStreamSetTy(8), this->getInputBufferBlocks());
     389    Kernel* fakeStreamGeneratorK = mPxDriver.addKernelInstance<LZ4FakeStreamGeneratingKernel>(idb, numOfCharacterClasses, 8);
     390    mPxDriver.makeKernelCall(fakeStreamGeneratorK, {decompressedCharClasses}, {fakeMatchCopiedBits});
     391
     392    kernel::Kernel * icgrepK = mGrepDriver->addKernelInstance<kernel::ICGrepKernel>(idb, mREs[0], externalStreamNames, std::vector<cc::Alphabet *>{mpx.get()});
     393    mGrepDriver->makeKernelCall(icgrepK, {fakeMatchCopiedBits, decompressedCharClasses}, {MatchResults});
     394    MatchResultsBufs[0] = MatchResults;
    296395
    297396    StreamSetBuffer * MergedResults = MatchResultsBufs[0];
     
    318417
    319418    return std::pair<StreamSetBuffer *, StreamSetBuffer *>(LineBreakStream, Matches);
     419};
     420
     421std::pair<parabix::StreamSetBuffer *, parabix::StreamSetBuffer *> LZ4GrepGenerator::grepPipeline(
     422        std::vector<re::RE *> &REs, parabix::StreamSetBuffer *decompressedBasisBits) {
     423
     424    this->initREs(REs);
     425    auto mGrepDriver = &mPxDriver;
     426
     427    auto & idb = mGrepDriver->getBuilder();
     428    // TODO: until we automate stream buffer sizing, use this calculation to determine how large our matches buffer needs to be.
     429    const unsigned baseBufferSize = this->getInputBufferBlocks();
     430    int MaxCountFlag = 0;
     431
     432    //  Regular Expression Processing and Analysis Phase
     433    const auto nREs = mREs.size();
     434
     435    std::vector<StreamSetBuffer *> MatchResultsBufs(nREs);
     436
     437    StreamSetBuffer * LineBreakStream = LineBreakStream = this->linefeedStreamFromDecompressedBits(decompressedBasisBits);
     438
     439
     440    std::map<std::string, StreamSetBuffer *> propertyStream;
     441
     442    for(unsigned i = 0; i < nREs; ++i) {
     443        std::vector<std::string> externalStreamNames;
     444        std::vector<StreamSetBuffer *> icgrepInputSets = {decompressedBasisBits};
     445
     446        std::set<re::Name *> UnicodeProperties;
     447
     448        StreamSetBuffer * MatchResults = mGrepDriver->addBuffer<StaticBuffer>(idb, idb->getStreamSetTy(1, 1), baseBufferSize);
     449        kernel::Kernel * icgrepK = mGrepDriver->addKernelInstance<kernel::ICGrepKernel>(idb, mREs[i], externalStreamNames);
     450        mGrepDriver->makeKernelCall(icgrepK, icgrepInputSets, {MatchResults});
     451        MatchResultsBufs[i] = MatchResults;
     452    }
     453
     454    StreamSetBuffer * MergedResults = MatchResultsBufs[0];
     455    if (mREs.size() > 1) {
     456        MergedResults = mGrepDriver->addBuffer<StaticBuffer>(idb, idb->getStreamSetTy(1, 1), baseBufferSize);
     457        kernel::Kernel * streamsMergeK = mGrepDriver->addKernelInstance<kernel::StreamsMerge>(idb, 1, mREs.size());
     458        mGrepDriver->makeKernelCall(streamsMergeK, MatchResultsBufs, {MergedResults});
     459    }
     460    StreamSetBuffer * Matches = MergedResults;
     461    if (mMoveMatchesToEOL) {
     462        StreamSetBuffer * OriginalMatches = Matches;
     463        kernel::Kernel * matchedLinesK = mGrepDriver->addKernelInstance<kernel::MatchedLinesKernel>(idb);
     464        Matches = mGrepDriver->addBuffer<StaticBuffer>(idb, idb->getStreamSetTy(1, 1), baseBufferSize);
     465        mGrepDriver->makeKernelCall(matchedLinesK, {OriginalMatches, LineBreakStream}, {Matches});
     466    }
     467
     468    if (MaxCountFlag > 0) {
     469        kernel::Kernel * untilK = mGrepDriver->addKernelInstance<kernel::UntilNkernel>(idb);
     470        untilK->setInitialArguments({idb->getSize(MaxCountFlag)});
     471        StreamSetBuffer * const AllMatches = Matches;
     472        Matches = mGrepDriver->addBuffer<StaticBuffer>(idb, idb->getStreamSetTy(1, 1), baseBufferSize);
     473        mGrepDriver->makeKernelCall(untilK, {AllMatches}, {Matches});
     474    }
     475
     476    return std::pair<StreamSetBuffer *, StreamSetBuffer *>(LineBreakStream, Matches);
    320477
    321478}
     
    380537    mPxDriver.finalizeObject();
    381538}
     539
     540void LZ4GrepGenerator::generateMultiplexingSwizzledAioPipeline(re::RE* regex) {
     541    auto & iBuilder = mPxDriver.getBuilder();
     542    this->generateMainFunc(iBuilder);
     543
     544    // GeneratePipeline
     545    this->generateLoadByteStreamAndBitStream(iBuilder);
     546
     547    std::vector<re::RE*> res = {regex};
     548    this->generateMultiplexingCompressedBitStream(res);
     549
     550    mPxDriver.generatePipelineIR();
     551    mPxDriver.deallocateBuffers();
     552
     553    iBuilder->CreateRetVoid();
     554
     555    mPxDriver.finalizeObject();
     556}
     557
     558void LZ4GrepGenerator::generateMultiplexingSwizzledAioPipeline2(re::RE* regex) {
     559    auto & iBuilder = mPxDriver.getBuilder();
     560    this->generateMainFunc(iBuilder);
     561
     562    // GeneratePipeline
     563    this->generateLoadByteStreamAndBitStream(iBuilder);
     564//    this->generateExtractAndDepositMarkers(iBuilder);
     565
     566    StreamSetBuffer * LineBreakStream;
     567    StreamSetBuffer * Matches;
     568    std::vector<re::RE*> res = {regex};
     569    std::tie(LineBreakStream, Matches) = multiplexingGrepPipeline(res, true);
     570
     571    kernel::Kernel * matchCountK = mPxDriver.addKernelInstance<kernel::PopcountKernel>(iBuilder);
     572    mPxDriver.makeKernelCall(matchCountK, {Matches}, {});
     573    mPxDriver.generatePipelineIR();
     574
     575    iBuilder->setKernel(matchCountK);
     576    Value * matchedLineCount = iBuilder->getAccumulator("countResult");
     577    matchedLineCount = iBuilder->CreateZExt(matchedLineCount, iBuilder->getInt64Ty());
     578    iBuilder->CallPrintInt("aaa", matchedLineCount);
     579
     580    mPxDriver.deallocateBuffers();
     581
     582    // TODO return matchedLineCount
     583//        idb->CreateRet(matchedLineCount);
     584
     585    iBuilder->CreateRetVoid();
     586
     587    mPxDriver.finalizeObject();
     588}
     589
     590void LZ4GrepGenerator::generateSwizzledAioPipeline(re::RE* regex) {
     591    auto & iBuilder = mPxDriver.getBuilder();
     592    this->generateMainFunc(iBuilder);
     593
     594    // GeneratePipeline
     595    this->generateLoadByteStreamAndBitStream(iBuilder);
     596
     597    StreamSetBuffer * const decompressionBitStream = this->generateSwizzledAIODecompression(iBuilder);
     598
     599    StreamSetBuffer * LineBreakStream;
     600    StreamSetBuffer * Matches;
     601    std::vector<re::RE*> res = {regex};
     602    std::tie(LineBreakStream, Matches) = grepPipeline(res, decompressionBitStream);
     603/*
     604    StreamSetBuffer * const decompressionByteStream = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8), this->getDecompressedBufferBlocks());
     605    Kernel * p2sK = mPxDriver.addKernelInstance<P2SKernel>(iBuilder);
     606    mPxDriver.makeKernelCall(p2sK, {decompressionBitStream}, {decompressionByteStream});
     607
     608    Kernel * outK = mPxDriver.addKernelInstance<FileSink>(iBuilder, 8);
     609    outK->setInitialArguments({iBuilder->GetString("/Users/wxy325/developer/LZ4-sample-files/workspace/lz4d-normal/8k_.txt")});
     610    mPxDriver.makeKernelCall(outK, {decompressionByteStream}, {});
     611*/
     612    kernel::Kernel * matchCountK = mPxDriver.addKernelInstance<kernel::PopcountKernel>(iBuilder);
     613
     614    mPxDriver.makeKernelCall(matchCountK, {Matches}, {});
     615    mPxDriver.generatePipelineIR();
     616
     617    iBuilder->setKernel(matchCountK);
     618    Value * matchedLineCount = iBuilder->getAccumulator("countResult");
     619    matchedLineCount = iBuilder->CreateZExt(matchedLineCount, iBuilder->getInt64Ty());
     620    iBuilder->CallPrintInt("aaa", matchedLineCount);
     621    mPxDriver.deallocateBuffers();
     622
     623    // TODO return matchedLineCount
     624//        idb->CreateRet(matchedLineCount);
     625
     626    iBuilder->CreateRetVoid();
     627
     628    mPxDriver.finalizeObject();
     629}
     630
     631void LZ4GrepGenerator::generateAioPipeline(re::RE *regex) {
     632    auto & iBuilder = mPxDriver.getBuilder();
     633    this->generateMainFunc(iBuilder);
     634
     635    // GeneratePipeline
     636    this->generateLoadByteStreamAndBitStream(iBuilder);
     637    parabix::StreamSetBuffer * decompressedByteStream = this->generateAIODecompression(iBuilder);
     638
     639
     640    StreamSetBuffer * const decompressionBitStream = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(8, 1), this->getDecompressedBufferBlocks());
     641    Kernel * s2pk = mPxDriver.addKernelInstance<S2PKernel>(iBuilder, /*aligned = */ true, "a");
     642    mPxDriver.makeKernelCall(s2pk, {decompressedByteStream}, {decompressionBitStream});
     643
     644
     645    StreamSetBuffer * LineBreakStream;
     646    StreamSetBuffer * Matches;
     647    std::vector<re::RE*> res = {regex};
     648    std::tie(LineBreakStream, Matches) = grepPipeline(res, decompressionBitStream);
     649
     650
     651//    Kernel * outK = mPxDriver.addKernelInstance<FileSink>(iBuilder, 8);
     652//    outK->setInitialArguments({iBuilder->GetString("/Users/wxy325/developer/LZ4-sample-files/workspace/lz4d-normal/8k_.txt")});
     653//    mPxDriver.makeKernelCall(outK, {decompressedStream}, {});
     654
     655    kernel::Kernel * matchCountK = mPxDriver.addKernelInstance<kernel::PopcountKernel>(iBuilder);
     656    mPxDriver.makeKernelCall(matchCountK, {Matches}, {});
     657    mPxDriver.generatePipelineIR();
     658
     659    iBuilder->setKernel(matchCountK);
     660    Value * matchedLineCount = iBuilder->getAccumulator("countResult");
     661    matchedLineCount = iBuilder->CreateZExt(matchedLineCount, iBuilder->getInt64Ty());
     662    iBuilder->CallPrintInt("aaa", matchedLineCount);
     663
     664    mPxDriver.deallocateBuffers();
     665
     666    // TODO return matchedLineCount
     667//        idb->CreateRet(matchedLineCount);
     668
     669    iBuilder->CreateRetVoid();
     670
     671    mPxDriver.finalizeObject();
     672
     673}
     674
    382675
    383676void LZ4GrepGenerator::generateCountOnlyGrepPipeline(re::RE *regex, bool enableGather) {
  • icGREP/icgrep-devel/icgrep/lz4/LZ4GrepGenerator.h

    r6043 r6059  
    2424    std::pair<parabix::StreamSetBuffer *, parabix::StreamSetBuffer *> grepPipeline(std::vector<re::RE *> &REs,
    2525                                                                                   parabix::StreamSetBuffer *decompressedBasisBits);
    26     std::pair<parabix::StreamSetBuffer *, parabix::StreamSetBuffer *> multiplexingGrepPipeline(std::vector<re::RE *> &REs);
     26
     27    void generateMultiplexingCompressedBitStream(std::vector<re::RE *> &REs);
     28    std::pair<parabix::StreamSetBuffer *, parabix::StreamSetBuffer *> multiplexingGrepPipeline(std::vector<re::RE *> &REs, bool useAio = false);
    2729
    2830
    2931    void invokeScanMatchGrep(char* fileBuffer, size_t blockStart, size_t blockEnd, bool hasBlockChecksum);
     32
     33    void generateMultiplexingSwizzledAioPipeline(re::RE* regex);
     34    void generateMultiplexingSwizzledAioPipeline2(re::RE* regex);
     35
     36    void generateSwizzledAioPipeline(re::RE* regex);
     37
     38    void generateAioPipeline(re::RE* regex);
    3039
    3140private:
     
    5766    parabix::StreamSetBuffer * linefeedStreamFromCompressedBits();
    5867
     68
     69    parabix::StreamSetBuffer * convertCompressedBitsStreamWithSwizzledApproach(parabix::StreamSetBuffer* compressedBitStream, int numberOfStream, std::string prefix);
     70    parabix::StreamSetBuffer * convertCompressedBitsStreamWithAioApproach(parabix::StreamSetBuffer* compressedBitStream, int numberOfStream, std::string prefix);
    5971    parabix::StreamSetBuffer * convertCompressedBitsStream(parabix::StreamSetBuffer* compressedBitStream, int numberOfStream, std::string prefix);
    6072};
  • icGREP/icgrep-devel/icgrep/lz4_grep.cpp

    r6040 r6059  
    4949
    5050static cl::OptionCategory lz4GrepDebugFlags("LZ4 Grep Debug Flags", "lz4d debug options");
     51static cl::opt<bool> aio("aio", cl::desc("Use All-in-One Approach for LZ4 Decompression"), cl::init(false), cl::cat(lz4GrepDebugFlags));
    5152static cl::opt<bool> swizzledDecompression("swizzled-decompression", cl::desc("Use swizzle approach for decompression"), cl::init(false), cl::cat(lz4GrepDebugFlags));
    5253static cl::opt<bool> enableGather("enable-gather", cl::desc("Enable gather intrinsics for bitstream PDEP"), cl::init(false), cl::cat(lz4GrepDebugFlags));
     
    7576    re::RE * re_ast = re::RE_Parser::parse(regexString, re::MULTILINE_MODE_FLAG);
    7677    LZ4GrepGenerator g(enableMultiplexing);
    77     if (countOnly) {
     78    if (aio) {
     79        if (enableMultiplexing) {
     80            g.generateMultiplexingSwizzledAioPipeline2(re_ast);
     81        } else if (swizzledDecompression) {
     82            g.generateSwizzledAioPipeline(re_ast);
     83        } else {
     84            g.generateAioPipeline(re_ast);
     85        }
     86
     87        auto main = g.getMainFunc();
     88        main(fileBuffer, lz4Frame.getBlocksStart(), lz4Frame.getBlocksStart() + lz4Frame.getBlocksLength(), lz4Frame.hasBlockChecksum());
     89    } else if (countOnly) {
    7890        if (swizzledDecompression) {
    7991            g.generateSwizzledCountOnlyGrepPipeline(re_ast);
  • icGREP/icgrep-devel/icgrep/lz4d_ext_dep.cpp

    r6039 r6059  
    4040
    4141static cl::OptionCategory lz4dDebugFlags("LZ4D Debug Flags", "lz4d debug options");
     42static cl::opt<bool> newApproach("new-approach", cl::desc("Use new approach for index builder"), cl::init(false), cl::cat(lz4dDebugFlags));
    4243static cl::opt<bool> extractOnly("extract-only", cl::desc("Only extract literal data to output file"), cl::init(false), cl::cat(lz4dDebugFlags));
    4344static cl::opt<bool> extractAndDepositOnly("extract-and-deposit-only", cl::desc("Only extract and deposit literal data to output file"), cl::init(false), cl::cat(lz4dDebugFlags));
     
    7677    LZ4Generator g;
    7778    if (extractOnly) {
    78         if (swizzledDecompression) {
     79        if (newApproach) {
     80            g.generateNewExtractOnlyPipeline(outputFile);
     81        } else if (swizzledDecompression) {
    7982            g.generateSwizzledExtractOnlyPipeline(outputFile);
    8083        } else {
Note: See TracChangeset for help on using the changeset viewer.