Ignore:
Timestamp:
Apr 8, 2018, 1:16:46 AM (17 months ago)
Author:
xwa163
Message:
  1. Remove legacy kernels and codes for lz4
  2. Remove old approach for lz4 decoder
  3. Fixed some bugs of lz4 decoder new approach in large file by adding workaround attribute
  4. Add related test cases
Location:
icGREP/icgrep-devel/icgrep/kernels
Files:
12 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/kernels/attributes.h

    r5941 r5948  
    233233        // and will be called even when there is no new input data when the prior kernels
    234234        // in the pipeline have also terminated.
     235
     236        MustConsumeAll,
     237
     238        //Workaround, the kernel will finish only when all of the inputs are consumed
    235239
    236240    };
     
    292296    friend Attribute CanTerminateEarly();
    293297    friend Attribute MustExplicitlyTerminate();
     298    friend Attribute MustConsumeAll();
    294299
    295300    Attribute(const KindId kind, const unsigned k) : mKind(kind), mAmount(k) { }
     
    404409}
    405410
     411inline Attribute MustConsumeAll() {
     412    return Attribute(Attribute::KindId::MustConsumeAll, 0);
     413}
     414
    406415inline Attribute Swizzled() {
    407416    return Attribute(Attribute::KindId::Swizzled, 0);
  • icGREP/icgrep-devel/icgrep/kernels/lz4/lz4_block_decoder.cpp

    r5865 r5948  
    11//
    2 // Created by wxy325 on 2017/6/25.
     2// Created by wxy325 on 2018/3/16.
    33//
    44
     
    1717namespace kernel{
    1818
    19 LZ4BlockDecoderKernel::LZ4BlockDecoderKernel(const std::unique_ptr<kernel::KernelBuilder> &iBuilder)
    20 : MultiBlockKernel("lz4BlockDecoder",
     19    LZ4BlockDecoderNewKernel::LZ4BlockDecoderNewKernel(const std::unique_ptr<kernel::KernelBuilder> &iBuilder)
     20: MultiBlockKernel("LZ4BlockDecoderNewKernel",
    2121    // Inputs
    22     {Binding{iBuilder->getStreamSetTy(1, 8), "byteStream"}},
     22    {
     23                           Binding{iBuilder->getStreamSetTy(1, 8), "byteStream", FixedRate(1)},
     24                   },
    2325    //Outputs
    2426    {
    25         Binding{iBuilder->getStreamSetTy(1, 1), "isCompressed", BoundedRate(0, 1)},
     27        Binding{iBuilder->getStreamSetTy(1, 8), "isCompressed", BoundedRate(0, 1)},
    2628        Binding{iBuilder->getStreamSetTy(1, 64), "blockStart", BoundedRate(0, 1)},
    2729        Binding{iBuilder->getStreamSetTy(1, 64), "blockEnd", BoundedRate(0, 1)}},
     
    2931    {
    3032        Binding{iBuilder->getInt1Ty(), "hasBlockChecksum"},
    31         Binding{iBuilder->getSizeTy(), "headerSize"}
     33        Binding{iBuilder->getSizeTy(), "headerSize"},
     34        Binding{iBuilder->getSizeTy(), "fileSize"}
    3235    },
    3336    {},
     
    3740    Binding{iBuilder->getSizeTy(), "previousOffset"},
    3841    Binding{iBuilder->getInt1Ty(), "reachFinalBlock"},
    39     })
    40 , wordWidth{iBuilder->getSizeTy()->getBitWidth()} {
    41 //    setNoTerminateAttribute(true);
    42 }
    43 
    44 void LZ4BlockDecoderKernel::generateMultiBlockLogic(const std::unique_ptr<KernelBuilder> &iBuilder, Value * const numOfStrides) {
    45 //    BasicBlock * entry_block = iBuilder->GetInsertBlock();
    46 //    iBuilder->CallPrintInt("block_available", iBuilder->getAvailableItemCount("byteStream"));
    47     BasicBlock * exit_block = iBuilder->CreateBasicBlock("exit");
    48 
    49 //    BasicBlock * assert_fail_block = iBuilder->CreateBasicBlock("assert_fail_block");
    50 //    BasicBlock * real_entry_block = iBuilder->CreateBasicBlock("real_entry_block");
    51 
     42
     43    Binding{iBuilder->getInt1Ty(), "pendingIsCompressed"},
     44    Binding{iBuilder->getInt64Ty(), "pendingBlockStart"},
     45    Binding{iBuilder->getInt64Ty(), "pendingBlockEnd"},
     46    }) {
     47        addAttribute(MustExplicitlyTerminate());
     48}
     49
     50void LZ4BlockDecoderNewKernel::resetPreviousProducedMap(const std::unique_ptr<KernelBuilder> &iBuilder,
     51                                                        std::vector<std::string> outputList) {
     52    previousProducedMap.clear();
     53    for (auto iter = outputList.begin(); iter != outputList.end(); ++iter) {
     54        previousProducedMap.insert(std::make_pair(*iter, iBuilder->getProducedItemCount(*iter)));
     55    }
     56}
     57
     58void LZ4BlockDecoderNewKernel::generateMultiBlockLogic(const std::unique_ptr<KernelBuilder> &iBuilder, Value * const numOfStrides) {
     59    // Constant
     60    Constant* INT8_0 = iBuilder->getInt8(0);
     61    Constant* INT8_1 = iBuilder->getInt8(1);
     62    Constant* INT64_0 = iBuilder->getInt64(0);
     63
     64
     65    BasicBlock * entryBlock = iBuilder->GetInsertBlock();
     66    BasicBlock * exitBlock = iBuilder->CreateBasicBlock("exit");
     67
     68    this->resetPreviousProducedMap(iBuilder, {"isCompressed", "blockStart", "blockEnd"});
     69
     70    // Skip Header
    5271    Value* hasSkipHeader = iBuilder->getScalarField("hasSkipHeader");
     72    iBuilder->setScalarField("hasSkipHeader", iBuilder->getInt1(true));
    5373    Value* skipLength = iBuilder->CreateSelect(hasSkipHeader, iBuilder->getSize(0), iBuilder->getScalarField("headerSize"));
    54     iBuilder->setScalarField("hasSkipHeader", iBuilder->getInt1(true));
    55     skipLength = iBuilder->CreateAdd(skipLength, iBuilder->getScalarField("previousOffset"));
     74    Value* previousOffset = iBuilder->getScalarField("previousOffset");
     75    previousOffset = iBuilder->CreateAdd(skipLength, previousOffset);
     76    Value* initBlockStart = iBuilder->getScalarField("pendingBlockStart");
     77    Value* initBlockEnd = iBuilder->getScalarField("pendingBlockEnd");
     78    Value* initIsCompressed = iBuilder->getScalarField("pendingIsCompressed");
     79
    5680
    5781    Value* availableItemCount = iBuilder->getAvailableItemCount("byteStream");
    5882    Value* processedItemCount = iBuilder->getProcessedItemCount("byteStream");
     83
    5984    Value* totalItemCount = iBuilder->CreateAdd(availableItemCount, processedItemCount);
    6085
    61 
    62     BasicBlock * block_decoder_entry = iBuilder->CreateBasicBlock("block_decoder_entry_block");
    63     iBuilder->CreateBr(block_decoder_entry);
     86    Value* mIsFinalBlock = iBuilder->CreateICmpEQ(totalItemCount, iBuilder->getScalarField("fileSize"));
     87
     88    iBuilder->setTerminationSignal(mIsFinalBlock);
     89
     90
     91    BasicBlock* processCon = iBuilder->CreateBasicBlock("process_con");
     92    iBuilder->CreateBr(processCon);
     93
     94    iBuilder->SetInsertPoint(processCon);
     95
     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);
     100
     101    phiIsCompressed->addIncoming(initIsCompressed, entryBlock);
     102    phiBlockStart->addIncoming(initBlockStart, entryBlock);
     103    phiBlockEnd->addIncoming(initBlockEnd, entryBlock);
     104    sOffset->addIncoming(previousOffset, entryBlock);
     105
     106    // Store Output
     107    BasicBlock* storeOutputBlock = iBuilder->CreateBasicBlock("storeOutputBlock");
     108    BasicBlock * block_decoder_con = iBuilder->CreateBasicBlock("block_decoder_con_block");
     109
     110    iBuilder->CreateUnlikelyCondBr(
     111            iBuilder->CreateAnd(
     112                    iBuilder->CreateICmpULE(phiBlockEnd, totalItemCount),
     113                    iBuilder->CreateNot(iBuilder->CreateICmpEQ(phiBlockEnd, INT64_0))
     114            ),
     115            storeOutputBlock,
     116            block_decoder_con
     117    );
     118
     119    iBuilder->SetInsertPoint(storeOutputBlock);
     120    this->appendOutput(iBuilder, phiIsCompressed, phiBlockStart, phiBlockEnd);
     121    phiIsCompressed->addIncoming(INT8_0, storeOutputBlock);
     122    phiBlockStart->addIncoming(INT64_0, storeOutputBlock);
     123    phiBlockEnd->addIncoming(INT64_0, storeOutputBlock);
     124    sOffset->addIncoming(sOffset, storeOutputBlock);
     125
     126
     127    iBuilder->CreateBr(processCon);
     128
    64129
    65130    // block decoder entry
    66     iBuilder->SetInsertPoint(block_decoder_entry);
    67 
    68 
    69     BasicBlock * block_decoder_con = iBuilder->CreateBasicBlock("block_decoder_con_block");
    70     iBuilder->CreateBr(block_decoder_con);
    71131    iBuilder->SetInsertPoint(block_decoder_con);
    72 
    73     PHINode* sOffset = iBuilder->CreatePHI(iBuilder->getSizeTy(), 2);
    74     iBuilder->setScalarField("previousOffset", sOffset);
    75     sOffset->addIncoming(skipLength, block_decoder_entry);
    76132
    77133    BasicBlock * block_decoder_body = iBuilder->CreateBasicBlock("block_decoder_body_block");
    78134    BasicBlock * block_decoder_exit = iBuilder->CreateBasicBlock("block_decoder_exit_block");
    79     BasicBlock * block_decoder_final = iBuilder->CreateBasicBlock("block_decoder_final_block");
    80 
    81135
    82136    Value* reachFinalBlock = iBuilder->getScalarField("reachFinalBlock");
     
    103157    Value* highestBit = iBuilder->CreateTrunc(iBuilder->CreateLShr(currentBlockSize, 31), iBuilder->getInt1Ty());
    104158    Value* isCompressed = iBuilder->CreateNot(highestBit);
     159//    iBuilder->CallPrintInt("----realBlockSize", realBlockSize);
    105160
    106161    Value* isFinalBlock = iBuilder->CreateICmpEQ(realBlockSize, iBuilder->getSize(0));
    107162    iBuilder->setScalarField("reachFinalBlock", isFinalBlock);
    108163
    109     BasicBlock * block_decoder_output_block = iBuilder->CreateBasicBlock("block_decoder_output_block");
    110 
    111     iBuilder->CreateCondBr(isFinalBlock, block_decoder_final, block_decoder_output_block);
    112 
    113     // block_decoder_output_block
    114     iBuilder->SetInsertPoint(block_decoder_output_block);
    115164    Value* blockStart = iBuilder->CreateAdd(sOffset, iBuilder->getSize(4));
    116165    Value* blockEnd = iBuilder->CreateAdd(blockStart, realBlockSize);
    117     this->appendOutput(iBuilder, isCompressed, blockStart, blockEnd);
    118     iBuilder->CreateBr(block_decoder_final);
    119 
    120     // block_decoder_final_block
    121     iBuilder->SetInsertPoint(block_decoder_final);
    122166
    123167    Value* newOffset = sOffset;
     
    132176    ); // Block Checksum
    133177
    134     sOffset->addIncoming(newOffset, block_decoder_final);
    135     iBuilder->CreateBr(block_decoder_con);
     178    sOffset->addIncoming(newOffset, iBuilder->GetInsertBlock());
     179    phiIsCompressed->addIncoming(iBuilder->CreateSelect(isCompressed, INT8_1, INT8_0), iBuilder->GetInsertBlock());
     180    phiBlockStart->addIncoming(blockStart, iBuilder->GetInsertBlock());
     181    phiBlockEnd->addIncoming(blockEnd, iBuilder->GetInsertBlock());
     182    iBuilder->CreateBr(processCon);
    136183
    137184    // block_decoder_exit_block
    138185    iBuilder->SetInsertPoint(block_decoder_exit);
    139186
    140 
    141     iBuilder->CreateBr(exit_block);
    142     iBuilder->SetInsertPoint(exit_block);
    143 }
    144 
    145 
    146     Value* LZ4BlockDecoderKernel::generateLoadInput(const std::unique_ptr<KernelBuilder> & iBuilder, llvm::Value* offset) {
    147         // TODO adjust input loading
     187    iBuilder->setScalarField("pendingIsCompressed", phiIsCompressed);
     188    iBuilder->setScalarField("pendingBlockStart", phiBlockStart);
     189    iBuilder->setScalarField("pendingBlockEnd", phiBlockEnd);
     190    iBuilder->setScalarField("previousOffset", sOffset);
     191
     192    iBuilder->CreateBr(exitBlock);
     193    iBuilder->SetInsertPoint(exitBlock);
     194}
     195
     196
     197    Value* LZ4BlockDecoderNewKernel::generateLoadInput(const std::unique_ptr<KernelBuilder> & iBuilder, llvm::Value* offset) {
     198        // The external buffer is always linear accessible, so the GEP here is safe
    148199        Value * inputBufferBasePtr = iBuilder->getRawInputPointer("byteStream", iBuilder->getSize(0));
    149 //        offset = iBuilder->CreateSub(iBuilder->getProcessedItemCount("byteStream"), offset);
    150200        Value* targetPtr = iBuilder->CreateGEP(inputBufferBasePtr, offset);
    151201        return iBuilder->CreateLoad(targetPtr);
    152202    }
    153203
    154     void LZ4BlockDecoderKernel::appendOutput(const std::unique_ptr<KernelBuilder> & iBuilder, Value* isCompressed, Value* blockStart, Value* blockEnd) {
    155         // TODO adjust output storing
    156         this->generateStoreCircularOutput(iBuilder, "isCompressed", iBuilder->getInt1Ty()->getPointerTo(), isCompressed);
    157         this->generateStoreCircularOutput(iBuilder, "blockStart", iBuilder->getInt64Ty()->getPointerTo(), iBuilder->CreateTruncOrBitCast(blockStart, iBuilder->getInt64Ty()));
    158         this->generateStoreCircularOutput(iBuilder, "blockEnd", iBuilder->getInt64Ty()->getPointerTo(), blockEnd);
    159     }
    160 
    161     void LZ4BlockDecoderKernel::generateStoreCircularOutput(const unique_ptr<KernelBuilder> &iBuilder, const string& outputBufferName, Type* pointerType, Value* value) {
    162         Value* offset = iBuilder->getProducedItemCount(outputBufferName);
    163 
    164         size_t inputSize = this->getOutputBufferSize(iBuilder, outputBufferName);
    165         Value* offsetMask = iBuilder->getSize(inputSize - 1);
    166         Value* maskedOffset = iBuilder->CreateAnd(offsetMask, offset);
    167 
    168         Value* outputBufferPtr = iBuilder->getRawOutputPointer(outputBufferName, iBuilder->getSize(0));
    169 
    170         outputBufferPtr = iBuilder->CreatePointerCast(outputBufferPtr, pointerType);
    171         iBuilder->CreateStore(value, iBuilder->CreateGEP(outputBufferPtr, maskedOffset));
    172 
    173         offset = iBuilder->CreateAdd(offset, iBuilder->getSize(1));
    174         iBuilder->setProducedItemCount(outputBufferName, offset);
    175     }
    176 
    177     size_t LZ4BlockDecoderKernel::getOutputBufferSize(const unique_ptr<KernelBuilder> &iBuilder, const string& bufferName) {
     204    void LZ4BlockDecoderNewKernel::appendOutput(const std::unique_ptr<KernelBuilder> & iBuilder, Value* isCompressed, Value* blockStart, Value* blockEnd) {
     205        // Constant
     206        this->generateStoreNumberOutput(iBuilder, "isCompressed", iBuilder->getInt8Ty()->getPointerTo(), isCompressed);
     207        this->generateStoreNumberOutput(iBuilder, "blockStart", iBuilder->getInt64Ty()->getPointerTo(), blockStart);
     208        this->generateStoreNumberOutput(iBuilder, "blockEnd", iBuilder->getInt64Ty()->getPointerTo(), blockEnd);
     209    }
     210
     211    void LZ4BlockDecoderNewKernel::generateStoreNumberOutput(const unique_ptr<KernelBuilder> &iBuilder,
     212                                                             const string &outputBufferName, Type *pointerType,
     213                                                             Value *value) {
     214        Value* SIZE_BIT_BLOCK_WIDTH = iBuilder->getSize(iBuilder->getBitBlockWidth());
     215        Value* SIZE_ZERO = iBuilder->getSize(0);
     216        Value* SIZE_ONE = iBuilder->getSize(1);
     217
     218        Value* previousProduced = previousProducedMap.find(outputBufferName)->second;
     219
     220        Value* blockIndexBase = iBuilder->CreateUDiv(previousProduced, SIZE_BIT_BLOCK_WIDTH);
     221        Value* outputOffset = iBuilder->getProducedItemCount(outputBufferName);
     222        Value* blockIndex = iBuilder->CreateUDiv(outputOffset, SIZE_BIT_BLOCK_WIDTH);
     223
     224        Value* blockOffset = iBuilder->CreateURem(outputOffset, SIZE_BIT_BLOCK_WIDTH);
     225
     226        // i8, [8 x <4 x i64>]*
     227        // i64, [64 x <4 x i64>]*
     228        Value* ptr = iBuilder->getOutputStreamBlockPtr(outputBufferName, SIZE_ZERO, iBuilder->CreateSub(blockIndex, blockIndexBase));
     229        ptr = iBuilder->CreatePointerCast(ptr, pointerType);
     230        // GEP here is safe
     231        iBuilder->CreateStore(value, iBuilder->CreateGEP(ptr, blockOffset));
     232
     233        iBuilder->setProducedItemCount(outputBufferName, iBuilder->CreateAdd(outputOffset, SIZE_ONE));
     234    }
     235
     236    size_t LZ4BlockDecoderNewKernel::getOutputBufferSize(const unique_ptr<KernelBuilder> &iBuilder, const string& bufferName) {
    178237//        size_t s = this->getOutputStreamSetBuffer(bufferName)->getBufferBlocks();
    179238        return this->getOutputStreamSetBuffer(bufferName)->getBufferBlocks() * iBuilder->getStride();
  • icGREP/icgrep-devel/icgrep/kernels/lz4/lz4_block_decoder.h

    r5865 r5948  
    1 //
    2 // Created by wxy325 on 2017/6/25.
    3 //
    41
    5 #ifndef ICGREP_LZ4D_E_D_H
    6 #define ICGREP_LZ4D_E_D_H
     2#ifndef ICGREP_LZ4_BLOCK_DECODER_NEW_H
     3#define ICGREP_LZ4_BLOCK_DECODER_NEW_H
     4
    75
    86#include "kernels/kernel.h"
     7#include <map>
     8#include <vector>
     9#include <string>
    910
    1011namespace llvm {
     
    1920namespace kernel {
    2021
    21 class LZ4BlockDecoderKernel final : public MultiBlockKernel {
     22class LZ4BlockDecoderNewKernel final : public MultiBlockKernel {
    2223
    2324public:
    24     LZ4BlockDecoderKernel(const std::unique_ptr<kernel::KernelBuilder> &iBuilder);
     25    LZ4BlockDecoderNewKernel(const std::unique_ptr<kernel::KernelBuilder> &iBuilder);
    2526
    2627protected:
    2728    void generateMultiBlockLogic(const std::unique_ptr<KernelBuilder> &iBuilder, llvm::Value * const numOfStrides) override;
    28 //    virtual void generateDoBlockMethod(const std::unique_ptr<KernelBuilder> & iBuilder) override;
    29 //    void generateDoSegmentMethod(const std::unique_ptr<KernelBuilder> &iBuilder) override;
    3029
    3130private:
    32     const size_t wordWidth;
    33 
    3431    llvm::Value *generateLoadInput(const std::unique_ptr<KernelBuilder> &iBuilder, llvm::Value *offset);
    3532
    3633    void appendOutput(const std::unique_ptr<KernelBuilder> & iBuilder, llvm::Value *isCompressed, llvm::Value *blockStart, llvm::Value *blockEnd);
    3734
    38     void generateStoreCircularOutput(const std::unique_ptr<KernelBuilder> &iBuilder, const std::string& outputBufferName,
    39                                      llvm::Type *pointerType, llvm::Value *value);
     35    void generateStoreNumberOutput(const std::unique_ptr<KernelBuilder> &iBuilder, const std::string &outputBufferName,
     36                                   llvm::Type *pointerType, llvm::Value *value);
    4037    size_t getOutputBufferSize(const std::unique_ptr<KernelBuilder> &iBuilder, const std::string& bufferName);
     38
     39    std::map<std::string, llvm::Value*> previousProducedMap;
     40
     41    void resetPreviousProducedMap(const std::unique_ptr<KernelBuilder> &iBuilder, std::vector<std::string> outputList);
    4142};
    4243
     
    4445
    4546
    46 
    47 #endif //ICGREP_LZ4D_E_D_H
     47#endif //ICGREP_LZ4_BLOCK_DECODER_NEW_H
  • icGREP/icgrep-devel/icgrep/kernels/lz4/lz4_index_builder.cpp

    r5941 r5948  
    4545                                               BoundedRate(0, 1)},
    4646
    47                                        Binding{iBuilder->getStreamSetTy(1, 1), "e1Marker", BoundedRate(0, 1), {DisableTemporaryBuffer(), DisableSufficientChecking()}},
     47                                       Binding{iBuilder->getStreamSetTy(1, 1), "deletionMarker", BoundedRate(0, 1), {DisableTemporaryBuffer(), DisableSufficientChecking()}},
    4848                                       Binding{iBuilder->getStreamSetTy(1, 64), "m0Start", BoundedRate(0, 1), DisableSufficientChecking()}, //TODO disable temporary buffer for all output streams
    4949                                       Binding{iBuilder->getStreamSetTy(1, 64), "m0End", BoundedRate(0, 1), DisableSufficientChecking()},
     
    6666
    6767    void LZ4IndexBuilderKernel::generateMultiBlockLogic(const std::unique_ptr<KernelBuilder> &iBuilder, llvm::Value *const numOfStrides) {
    68 
    69 
    7068        BasicBlock* exitBlock = iBuilder->CreateBasicBlock("exitBlock");
    7169        BasicBlock* blockEndConBlock = iBuilder->CreateBasicBlock("blockEndConBlock");
    7270
    73         this->resetPreviousProducedMap(iBuilder, {"e1Marker", "m0Start", "m0End", "matchOffset"});
     71        this->resetPreviousProducedMap(iBuilder, {"deletionMarker", "m0Start", "m0End", "matchOffset", "M0Marker"});
    7472
    7573        Value* blockDataIndex = iBuilder->getScalarField("blockDataIndex");
     
    7775        Value* totalNumber = iBuilder->CreateAdd(iBuilder->getAvailableItemCount("blockEnd"), iBuilder->getProcessedItemCount("blockEnd"));
    7876        Value* totalExtender = iBuilder->CreateAdd(iBuilder->getAvailableItemCount("extender"), iBuilder->getProcessedItemCount("extender"));
    79 //        iBuilder->CallPrintInt("blockDataIndex", blockDataIndex);
    80 
     77
     78        Value* blockEnd = this->generateLoadInt64NumberInput(iBuilder, "blockEnd", blockDataIndex);
    8179
    8280        iBuilder->CreateCondBr(iBuilder->CreateICmpULT(blockDataIndex, totalNumber), blockEndConBlock, exitBlock);
    8381
    8482        iBuilder->SetInsertPoint(blockEndConBlock);
    85         Value* blockEnd = this->generateLoadInt64NumberInput(iBuilder, "blockEnd", blockDataIndex);
     83
    8684
    8785        Value* blockStart = this->generateLoadInt64NumberInput(iBuilder, "blockStart", blockDataIndex);
     
    9290//        iBuilder->CallPrintInt("----blockEnd", blockEnd);
    9391
    94 //        iBuilder->CreateCondBr(iBuilder->CreateICmpULE(blockEnd, totalExtender), processBlock, exitBlock);
    95         iBuilder->CreateBr(processBlock);
     92        iBuilder->CreateCondBr(iBuilder->CreateICmpULE(blockEnd, totalExtender), processBlock, exitBlock);
     93//        iBuilder->CreateBr(processBlock);
    9694
    9795        iBuilder->SetInsertPoint(processBlock);
     
    169167
    170168        // TODO Clear Output Buffer at the beginning instead of marking 0
    171         this->markCircularOutputBitstream(iBuilder, "e1Marker", iBuilder->getProducedItemCount("e1Marker"), iBuilder->CreateAdd(phiCursorPosAfterLiteral, iBuilder->getSize(1)), false);
     169        this->markCircularOutputBitstream(iBuilder, "deletionMarker", iBuilder->getProducedItemCount("deletionMarker"), iBuilder->CreateAdd(phiCursorPosAfterLiteral, iBuilder->getSize(1)), true);
    172170//        iBuilder->CallPrintInt("markStart", iBuilder->CreateAdd(phiCursorPosAfterLiteral, iBuilder->getSize(1)));
    173171//        iBuilder->CallPrintInt("phiCursorPosAfterLiteral", phiCursorPosAfterLiteral);
    174         this->markCircularOutputBitstream(iBuilder, "e1Marker", iBuilder->CreateAdd(phiCursorPosAfterLiteral, iBuilder->getSize(1)), offsetPos, true);
     172        this->markCircularOutputBitstream(iBuilder, "deletionMarker", iBuilder->CreateAdd(phiCursorPosAfterLiteral, iBuilder->getSize(1)), offsetPos, false);
    175173        this->increaseScalarField(iBuilder, "m0OutputPos", literalLength); //TODO m0OutputPos may be removed from scalar fields
    176174        return offsetPos;
     
    272270
    273271        Value* isTerminal = iBuilder->CreateICmpEQ(blockEnd, iBuilder->getScalarField("fileSize"));
    274 
    275272        iBuilder->setTerminationSignal(isTerminal);
    276273
  • icGREP/icgrep-devel/icgrep/kernels/lz4/lz4_multiple_pdep_kernel.cpp

    r5941 r5948  
    179179                                  )
    180180        );
    181 
    182181    }
    183182
Note: See TracChangeset for help on using the changeset viewer.