Changeset 5202


Ignore:
Timestamp:
Nov 6, 2016, 8:37:11 PM (2 years ago)
Author:
nmedfort
Message:

Initial work on adding types to PabloAST and mutable Var objects.

Location:
icGREP/icgrep-devel/icgrep
Files:
6 added
6 deleted
98 edited

Legend:

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

    r5198 r5202  
    1616message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
    1717message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
    18 
     18set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/cmake") # ensure custom FindXYZ.cmake files are found
    1919
    2020# Now set the header and library paths:
     
    5252SET(IDISA_SRC IDISA/idisa_builder.cpp IDISA/idisa_avx_builder.cpp IDISA/idisa_i64_builder.cpp IDISA/idisa_sse_builder.cpp IDISA/idisa_nvptx_builder.cpp IDISA/idisa_target.cpp)
    5353
    54 SET(PABLO_SRC pablo/pablo_type.cpp pablo/pabloAST.cpp pablo/ps_if.cpp pablo/ps_while.cpp pablo/function.cpp pablo/codegenstate.cpp pablo/builder.cpp pablo/symbol_generator.cpp pablo/printer_pablos.cpp pablo/pablo_toolchain.cpp pablo/passes/flattenif.cpp)
     54SET(PABLO_SRC pablo/type/streamtype.cpp pablo/pabloAST.cpp pablo/branch.cpp pablo/function.cpp pablo/codegenstate.cpp pablo/builder.cpp pablo/symbol_generator.cpp pablo/printer_pablos.cpp pablo/pablo_toolchain.cpp)
    5555SET(PABLO_SRC ${PABLO_SRC} pablo/pablo_compiler.cpp pablo/carry_manager.cpp pablo/carry_data.cpp pablo/pablo_kernel.cpp)
    56 SET(PABLO_SRC ${PABLO_SRC} kernels/s2p_kernel.cpp kernels/kernel.cpp kernels/streamset.cpp kernels/interface.cpp)
     56SET(PABLO_SRC ${PABLO_SRC} kernels/kernel.cpp kernels/s2p_kernel.cpp kernels/streamset.cpp kernels/interface.cpp)
    5757SET(PABLO_SRC ${PABLO_SRC} pablo/analysis/pabloverifier.cpp)
    58 SET(PABLO_SRC ${PABLO_SRC} pablo/optimizers/pablo_simplifier.cpp pablo/optimizers/codemotionpass.cpp)
     58SET(PABLO_SRC ${PABLO_SRC} pablo/optimizers/pablo_simplifier.cpp pablo/optimizers/codemotionpass.cpp pablo/passes/flattenif.cpp)
    5959IF(ENABLE_MULTIPLEXING)
    6060SET(PABLO_SRC ${PABLO_SRC} pablo/optimizers/booleanreassociationpass.cpp)
     
    109109add_executable(icgrep icgrep.cpp toolchain.cpp grep_engine.cpp kernels/pipeline.cpp kernels/scanmatchgen.cpp kernels/cc_kernel.cpp ${PRECOMPILED_FILES})
    110110add_executable(u8u16 u8u16.cpp toolchain.cpp kernels/p2s_kernel.cpp kernels/pipeline.cpp kernels/deletion.cpp kernels/stdout_kernel.cpp)
    111 #add_executable(symtbl symboltable.cpp toolchain.cpp kernels/symboltablepipeline.cpp kernels/stdout_kernel.cpp grep_engine.cpp kernels/pipeline.cpp kernels/scanmatchgen.cpp ${PRECOMPILED_FILES})
    112111add_executable(wc wc.cpp toolchain.cpp kernels/pipeline.cpp)
    113 
    114112add_executable(editd editd/editd.cpp editd/pattern_compiler.cpp toolchain.cpp kernels/pipeline.cpp editd/editdscan_kernel.cpp)
    115113
     
    125123
    126124target_link_libraries(icgrep ${Boost_LIBRARIES})
    127 #target_link_libraries(symtbl ${Boost_LIBRARIES})
    128125target_link_libraries(u8u16 ${Boost_LIBRARIES})
    129126target_link_libraries(wc ${Boost_LIBRARIES})
     
    131128
    132129target_link_libraries (icgrep UCDlib PabloADT RegExpCompiler CCADT CodeGen ${REQ_LLVM_LIBRARIES} ${CUDA_LIB})
    133 #target_link_libraries (symtbl UCDlib PabloADT RegExpCompiler CCADT CodeGen ${REQ_LLVM_LIBRARIES} ${CUDA_LIB})
    134130target_link_libraries (u8u16 UCDlib PabloADT RegExpCompiler CCADT CodeGen ${REQ_LLVM_LIBRARIES} ${CUDA_LIB})
    135131target_link_libraries (wc UCDlib PabloADT RegExpCompiler CCADT CodeGen ${REQ_LLVM_LIBRARIES} ${CUDA_LIB})
     
    197193
    198194SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -O3 -DNDEBUG")
    199 SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -g") # -fsanitize=address -fno-omit-frame-pointer
     195SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -g") #  -fsanitize=address -fno-omit-frame-pointer
    200196
    201197add_test(
  • icGREP/icgrep-devel/icgrep/IDISA/idisa_builder.cpp

    r5192 r5202  
    7777        printRegister = function;
    7878    }
    79     assert (value->getType()->canLosslesslyBitCastTo(mBitBlockType));
    80     CreateCall(printRegister, {CreateGlobalStringPtr(name.c_str()), CreateBitCast(value, mBitBlockType)});
     79    if (value->getType()->canLosslesslyBitCastTo(mBitBlockType)) {
     80        CreateCall(printRegister, {CreateGlobalStringPtr(name.c_str()), CreateBitCast(value, mBitBlockType)});
     81    }
    8182}
    8283
     
    340341
    341342Value * IDISA_Builder::mvmd_extract(unsigned fw, Value * a, unsigned fieldIndex) {
    342     Value * aVec = fwCast(fw, a);
    343     return CreateExtractElement(aVec, getInt32(fieldIndex));
     343    return CreateExtractElement(fwCast(fw, a), getInt32(fieldIndex));
    344344}
    345345
  • icGREP/icgrep-devel/icgrep/UCD/ucd_compiler.cpp

    r5160 r5202  
    184184            generateRange(inner, range.first, range.second, inner_block);
    185185
    186             std::vector<Assign *> targets;
    187186            for (auto ti = intersectingTargets.begin(); ti != intersectingTargets.end(); ) {
    188187                auto f = mTargetMap.find(ti->first);
     
    192191                    continue;
    193192                }
    194                 Assign * escapedValue = inner_block.createAssign("m", f->second);
    195                 targets.push_back(escapedValue);
    196                 f->second = escapedValue;
     193                Var * m = builder.createVar("m", builder.createZeroes());
     194                inner_block.createAssign(m, f->second);
     195                f->second = m;
    197196                ++ti;
    198197            }
    199 
    200198            // If this range is empty, just skip creating the if block
    201             if (!targets.empty()) {
    202                 builder.createIf(ifTestCompiler(range.first, range.second, builder), std::move(targets), inner_block);
     199            if (intersectingTargets.size() > 0) {
     200                builder.createIf(ifTestCompiler(range.first, range.second, builder), inner_block);
    203201                for (const auto ti : intersectingTargets) {
    204202                    auto f = mTargetMap.find(ti.first);
    205203                    assert (f != mTargetMap.end());
    206                     assert (isa<Assign>(f->second));
    207204                    f->second = builder.createOr(ti.second, f->second);
    208205                }
     
    271268                const auto lo_byte = encodingByte(lo, byte_no, isUTF_16);
    272269                const auto hi_byte = encodingByte(hi, byte_no, isUTF_16);
    273                 if (lo_byte != hi_byte) {
    274                     unsigned num = isUTF_16 ? 10 : 6;
     270                if (lo_byte != hi_byte) {
     271                    unsigned num = isUTF_16 ? 10 : 6;
    275272                    if (!isLowCodePointAfterByte(lo, byte_no, isUTF_16)) {
    276273                        const codepoint_t mid = lo | ((1 << (num * (min - byte_no))) - 1);
     
    291288                        target = builder.createOr(target, var);
    292289                    }
    293                 }
    294                 else { // lbyte == hbyte
     290                } else { // lbyte == hbyte
    295291                    PabloAST * var = mCharacterClassCompiler.compileCC(makeCC(lo_byte, hi_byte), builder);
    296292                    if (byte_no > 1) {
     
    541537            std::string name = t.first->getName();
    542538            if (Statement * result = dyn_cast<Statement>(f->second)) {
    543                 result->setName(entry.getName(name, false));
     539                result->setName(entry.getName(name));
    544540                t.second = result;
    545541            } else {
    546                 t.second = entry.createAssign(std::move(name), f->second);
     542                Var * var = entry.createVar(name);
     543                entry.createAssign(var, f->second);
     544                t.second = var;
    547545            }
    548546        }
  • icGREP/icgrep-devel/icgrep/cc/cc_compiler.cpp

    r5160 r5202  
    3030, mBasisBit(encodingBits)
    3131, mEncodingBits(encodingBits) {
    32     const PabloType * streamType = getPabloType(PabloType::Stream, 1);
     32
     33    // TODO: basisBits should be defined prior and only retrieved here.
     34    Var * const basisBits = function.addParameter(prefix, getStreamTy(1, 8));
    3335    for (unsigned i = 0; i != mEncodingBits; i++) {
    34         Var * var = mBuilder.createVar(prefix + std::to_string(i), streamType);
    35         function.setParameter(i, var);
    36         mBasisBit[i] = var;
     36        mBasisBit[i] = mBuilder.createExtract(basisBits, mBuilder.getInteger(i)); assert (mBasisBit[i]);
    3737    }
    3838    mEncodingMask = (static_cast<unsigned>(1) << encodingBits) - static_cast<unsigned>(1);
    3939}
    4040
    41 Assign * CC_Compiler::compileCC(const std::string && canonicalName, const CC *cc, PabloBlock & block) {
    42     return block.createAssign(std::move(canonicalName), charset_expr(cc, block));
    43 }
    44 
    45 Assign * CC_Compiler::compileCC(const std::string && canonicalName, const CC *cc, PabloBuilder & builder) {
    46     return builder.createAssign(std::move(canonicalName), charset_expr(cc, builder));
    47 }
    48 
    49 
     41PabloAST * CC_Compiler::compileCC(const std::string & canonicalName, const CC *cc, PabloBlock & block) {
     42    PabloAST * const var = charset_expr(cc, block);
     43    var->setName(block.makeName(canonicalName));
     44    return var;
     45}
     46
     47PabloAST * CC_Compiler::compileCC(const std::string & canonicalName, const CC *cc, PabloBuilder & builder) {
     48    PabloAST * const var = charset_expr(cc, builder);
     49    var->setName(builder.makeName(canonicalName));
     50    return var;
     51}
    5052   
    5153template<typename PabloBlockOrBuilder>
     
    200202
    201203template<typename PabloBlockOrBuilder>
    202 PabloAST * CC_Compiler::LE_Range(const unsigned N, const unsigned n, PabloBlockOrBuilder &pb)
    203 {
     204PabloAST * CC_Compiler::LE_Range(const unsigned N, const unsigned n, PabloBlockOrBuilder & pb) {
    204205    /*
    205206      If an N-bit pattern is all ones, then it is always true that any n-bit value is LE this pattern.
     
    208209    if ((n + 1) == (1UL << N)) {
    209210        return pb.createOnes(); //True.
    210     }
    211     else {
     211    } else {
    212212        return pb.createNot(GE_Range(N, n + 1, pb));
    213213    }
     
    218218    if (lo == hi) {
    219219        return char_test_expr(lo, pb);
    220     }
    221     else if (lo < hi) {
     220    } else if (lo < hi) {
    222221        return make_range(lo, hi, pb);
    223222    }
     
    225224}
    226225
    227 inline Var * CC_Compiler::getBasisVar(const unsigned i) const {
     226inline PabloAST *CC_Compiler::getBasisVar(const unsigned i) const {
    228227    assert (i < mEncodingBits);
    229     return mBasisBit[mEncodingBits - i - 1];
     228    const unsigned index = mEncodingBits - i - 1; assert (index < mEncodingBits);
     229    assert (mBasisBit[index]);
     230    return mBasisBit[index];
    230231}
    231232   
    232 pablo::PabloFunction * ParabixCharacterClassFunction(std::string ccSetName, std::vector<re::CC *> charClasses, unsigned basisBitsCount) {
    233        
    234     pablo::PabloFunction * cc_function = pablo::PabloFunction::Create(ccSetName + "_fn", basisBitsCount, charClasses.size());
    235     CC_Compiler ccc(* cc_function, basisBitsCount);
    236    
    237     pablo::PabloBuilder pBuilder(ccc.getBuilder().getPabloBlock(), ccc.getBuilder());
    238     const std::vector<pablo::Var *> bits = ccc.getBasisBits();
    239    
    240     for (unsigned i = 0; i < charClasses.size(); i++) {
    241         cc_function->setResult(i, ccc.compileCC(charClasses[i]));
    242     }
    243     return cc_function;
     233PabloFunction * ParabixCharacterClassFunction(const std::string & name, const std::vector<CC *> & charClasses, const unsigned basisBitsCount) {
     234    PabloFunction * f = PabloFunction::Create(name + "_fn");
     235    CC_Compiler ccc(*f, basisBitsCount);
     236    PabloBuilder builder(f->getEntryBlock());
     237    for (CC * cc : charClasses) {
     238        Var * const r = f->addResult(cc->canonicalName(re::ByteClass), getStreamTy());
     239        builder.createAssign(r, ccc.charset_expr(cc, builder));
     240    }
     241    return f;
    244242}
    245243
  • icGREP/icgrep-devel/icgrep/cc/cc_compiler.h

    r5140 r5202  
    1515namespace pablo {
    1616    class PabloFunction;
     17    class Var;
    1718}
    1819
     
    2223
    2324class CC_Compiler{
     25
     26    friend pablo::PabloFunction * ParabixCharacterClassFunction(const std::string &, const std::vector<re::CC *> &, const unsigned);
     27
    2428public:
    2529
     
    2832    CC_Compiler(pablo::PabloFunction & function, const unsigned encodingBits = 8, const std::string prefix = "basis");
    2933
    30     pablo::Assign * compileCC(const re::CC *cc);
     34    pablo::PabloAST * compileCC(const re::CC *cc);
    3135
    32     pablo::Assign * compileCC(const re::CC *cc, pablo::PabloBlock & block);
     36    pablo::PabloAST *compileCC(const re::CC *cc, pablo::PabloBlock & block);
    3337
    34     pablo::Assign * compileCC(const re::CC *cc, pablo::PabloBuilder & builder);
     38    pablo::PabloAST * compileCC(const re::CC *cc, pablo::PabloBuilder & builder);
    3539
    36     pablo::Assign * compileCC(const std::string && canonicalName, const re::CC *cc, pablo::PabloBlock & block);
     40    pablo::PabloAST * compileCC(const std::string & canonicalName, const re::CC *cc, pablo::PabloBlock & block);
    3741
    38     pablo::Assign * compileCC(const std::string && canonicalName, const re::CC *cc, pablo::PabloBuilder & builder);
     42    pablo::PabloAST * compileCC(const std::string & canonicalName, const re::CC *cc, pablo::PabloBuilder & builder);
    3943
    4044    pablo::PabloBuilder & getBuilder();
    4145
    42     const std::vector<pablo::Var *> & getBasisBits() {
     46    const std::vector<pablo::PabloAST *> & getBasisBits() {
    4347        return mBasisBit;
    4448    }
    4549
    46     bool isUTF_16() {
    47         return mEncodingBits == 16;
     50    bool isUTF_16() const {
     51        return mEncodingBits == 16;
    4852    }
    4953
    5054private:
    51     pablo::Var * getBasisVar(const unsigned n) const;
     55    pablo::PabloAST * getBasisVar(const unsigned n) const;
    5256    template<typename PabloBlockOrBuilder>
    5357    pablo::PabloAST * bit_pattern_expr(const unsigned pattern, unsigned selected_bits, PabloBlockOrBuilder & pb);
     
    6569    pablo::PabloAST * charset_expr(const re::CC *cc, PabloBlockOrBuilder & pb);
    6670private:   
    67     pablo::PabloBuilder         mBuilder;
    68     std::vector<pablo::Var *>   mBasisBit;
    69     const unsigned              mEncodingBits;
    70     unsigned                    mEncodingMask;
     71    pablo::PabloBuilder             mBuilder;
     72    std::vector<pablo::PabloAST *>  mBasisBit;
     73    const unsigned                  mEncodingBits;
     74    unsigned                        mEncodingMask;
    7175};
    7276
    73 inline pablo::Assign * CC_Compiler::compileCC(const re::CC *cc) {
     77inline pablo::PabloAST *CC_Compiler::compileCC(const re::CC *cc) {
    7478    return compileCC(cc, mBuilder);
    7579}
    7680
    77 inline pablo::Assign * CC_Compiler::compileCC(const re::CC *cc, pablo::PabloBlock & block) {
    78     return compileCC(std::move(cc->canonicalName(re::ByteClass)), cc, block);
     81inline pablo::PabloAST * CC_Compiler::compileCC(const re::CC *cc, pablo::PabloBlock & block) {
     82    return compileCC(cc->canonicalName(re::ByteClass), cc, block);
    7983}
    8084
    81 inline pablo::Assign * CC_Compiler::compileCC(const re::CC *cc, pablo::PabloBuilder & builder) {
    82     return compileCC(std::move(cc->canonicalName(re::ByteClass)), cc, builder);
     85inline pablo::PabloAST *CC_Compiler::compileCC(const re::CC *cc, pablo::PabloBuilder & builder) {
     86    return compileCC(cc->canonicalName(re::ByteClass), cc, builder);
    8387}
    8488
     
    8791}
    8892
    89 pablo::PabloFunction * ParabixCharacterClassFunction(std::string ccSetName, std::vector<re::CC *> charClasses, unsigned basisBitsCount);
    90 
     93pablo::PabloFunction * ParabixCharacterClassFunction(const std::string & name, const std::vector<re::CC *> & charClasses, const unsigned basisBitsCount);
    9194
    9295}
  • icGREP/icgrep-devel/icgrep/editd/editd.cpp

    r5177 r5202  
    162162}
    163163
    164 Function * editdPipeline(Module * mMod, IDISA::IDISA_Builder * iBuilder, pablo::PabloFunction * function) {
    165     Type * mBitBlockType = iBuilder->getBitBlockType();
    166    
    167     ExternalFileBuffer ChStream(iBuilder, StreamSetType(4, i1));
    168     SingleBlockBuffer MatchResults(iBuilder, StreamSetType(editDistance+1, i1));
     164Function * editdPipeline(Module * mMod, IDISA::IDISA_Builder * iBuilder, PabloFunction * function) {
     165   
     166    ExternalFileBuffer ChStream(iBuilder, StreamSetType(iBuilder, 4, i1));
     167    SingleBlockBuffer MatchResults(iBuilder, StreamSetType(iBuilder, editDistance + 1, i1));
    169168
    170169    pablo_function_passes(function);
    171     pablo::PabloKernel  editdk(iBuilder, "editd", function, {});
     170    PabloKernel editdk(iBuilder, "editd", function);
    172171    kernel::editdScanKernel editdScanK(iBuilder, editDistance);
    173172   
     
    180179    Type * const size_ty = iBuilder->getSizeTy();
    181180    Type * const voidTy = Type::getVoidTy(mMod->getContext());
    182     Type * const inputType = PointerType::get(ArrayType::get(ArrayType::get(mBitBlockType, 8), 1), 0);
     181    Type * const inputType = PointerType::get(ArrayType::get(ArrayType::get(iBuilder->getBitBlockType(), 8), 1), 0);
    183182   
    184183    Function * const main = cast<Function>(mMod->getOrInsertFunction("Main", voidTy, inputType, size_ty, nullptr));
     
    210209}
    211210
    212 Function * preprocessPipeline(Module * mMod, IDISA::IDISA_Builder * iBuilder, pablo::PabloFunction * function) {
     211Function * preprocessPipeline(Module * mMod, IDISA::IDISA_Builder * iBuilder, PabloFunction * function) {
    213212    Type * mBitBlockType = iBuilder->getBitBlockType();
    214213   
    215     ExternalFileBuffer ByteStream(iBuilder, StreamSetType(1, i8));
    216     SingleBlockBuffer BasisBits(iBuilder, StreamSetType(8, i1));
    217     ExternalFileBuffer CCResults(iBuilder, StreamSetType(4, i1));
     214    ExternalFileBuffer ByteStream(iBuilder, StreamSetType(iBuilder,1, i8));
     215    SingleBlockBuffer BasisBits(iBuilder, StreamSetType(iBuilder,8, i1));
     216    ExternalFileBuffer CCResults(iBuilder, StreamSetType(iBuilder,4, i1));
    218217
    219218    s2pKernel  s2pk(iBuilder);
     
    221220
    222221    pablo_function_passes(function);
    223     pablo::PabloKernel  ccck(iBuilder, "ccc", function, {});
     222    PabloKernel  ccck(iBuilder, "ccc", function);
    224223   
    225224    std::unique_ptr<Module> cccM = ccck.createKernelModule({&BasisBits}, {&CCResults});
     
    274273    IDISA::IDISA_Builder * idb = IDISA::GetIDISA_Builder(M);
    275274
    276     PabloFunction * function = PabloFunction::Create("preprocess", 8, 4);
     275    PabloFunction * function = PabloFunction::Create("preprocess"); // , 8, 4
    277276    cc::CC_Compiler ccc(*function);
    278     pablo::PabloBuilder pBuilder(ccc.getBuilder().getPabloBlock(), ccc.getBuilder());
    279 
    280     pablo::PabloAST * A = ccc.compileCC(re::makeCC(re::makeCC(0x41), re::makeCC(0x61)));
    281     pablo::PabloAST * C = ccc.compileCC(re::makeCC(re::makeCC(0x43), re::makeCC(0x63)));
    282     pablo::PabloAST * T = ccc.compileCC(re::makeCC(re::makeCC(0x54), re::makeCC(0x74)));
    283     pablo::PabloAST * G = ccc.compileCC(re::makeCC(re::makeCC(0x47), re::makeCC(0x67)));
    284 
    285     function->setResult(0, pBuilder.createAssign("A", A));
    286     function->setResult(1, pBuilder.createAssign("C", C));
    287     function->setResult(2, pBuilder.createAssign("T", T));
    288     function->setResult(3, pBuilder.createAssign("G", G));
     277    PabloBuilder & pb = ccc.getBuilder();
     278
     279    PabloAST * A = ccc.compileCC(re::makeCC(re::makeCC(0x41), re::makeCC(0x61)), pb);
     280    PabloAST * C = ccc.compileCC(re::makeCC(re::makeCC(0x43), re::makeCC(0x63)), pb);
     281    PabloAST * T = ccc.compileCC(re::makeCC(re::makeCC(0x54), re::makeCC(0x74)), pb);
     282    PabloAST * G = ccc.compileCC(re::makeCC(re::makeCC(0x47), re::makeCC(0x67)), pb);
     283
     284    Var * pat = function->addResult("pat", getStreamTy(1, 4));
     285
     286    pb.createAssign(pb.createExtract(pat, 0), A);
     287    pb.createAssign(pb.createExtract(pat, 1), C);
     288    pb.createAssign(pb.createExtract(pat, 2), T);
     289    pb.createAssign(pb.createExtract(pat, 3), G);
    289290
    290291    llvm::Function * main_IR = preprocessPipeline(M, idb, function);
     
    307308    IDISA::IDISA_Builder * idb = IDISA::GetIDISA_Builder(M);
    308309
    309     PabloFunction * function = PabloFunction::Create("editd", 4, editDistance+1);
    310     pablo::PabloBuilder main (function->getEntryBlock());
    311 
    312     const PabloType * streamType = getPabloType(PabloType::Stream, 1);
    313 
    314     std::vector<pablo::Var *>   basisBits(4);
    315     function->setParameter(0, basisBits[0] = main.createVar("PatA", streamType));
    316     function->setParameter(1, basisBits[1] = main.createVar("PatC", streamType));
    317     function->setParameter(2, basisBits[2] = main.createVar("PatT", streamType));
    318     function->setParameter(3, basisBits[3] = main.createVar("PatG", streamType));
     310    PabloFunction * function = PabloFunction::Create("editd"); // , 4, editDistance + 1
     311    PabloBuilder main (function->getEntryBlock());
     312
     313    Var * pat = function->addParameter("pat", getStreamTy(1, 4));
     314
     315    PabloAST * basisBits[4];
     316
     317    basisBits[0] = main.createExtract(pat, 0, "A");
     318    basisBits[1] = main.createExtract(pat, 1, "C");
     319    basisBits[2] = main.createExtract(pat, 2, "T");
     320    basisBits[3] = main.createExtract(pat, 3, "G");
    319321
    320322    re::Pattern_Compiler pattern_compiler(*function);
  • icGREP/icgrep-devel/icgrep/editd/editdscan_kernel.cpp

    r5173 r5202  
    2121
    2222void editdScanKernel::generateDoBlockMethod() {
    23     IDISA::IDISA_Builder::InsertPoint savePoint = iBuilder->saveIP();
     23    auto savePoint = iBuilder->saveIP();
    2424    Module * m = iBuilder->getModule();
    2525    Function * scanWordFunction = generateScanWordRoutine(m);
  • icGREP/icgrep-devel/icgrep/editd/editdscan_kernel.h

    r5177 r5202  
    2121    editdScanKernel(IDISA::IDISA_Builder * iBuilder, unsigned dist) :
    2222    KernelBuilder(iBuilder, "scanMatch",
    23                   {StreamSetBinding{parabix::StreamSetType(dist+1, parabix::i1), "matchResults"}},
     23                  {Binding{parabix::StreamSetType(iBuilder,dist+1, parabix::i1), "matchResults"}},
    2424                  {}, {}, {}, {}),
    2525    mEditDistance(dist),
  • icGREP/icgrep-devel/icgrep/editd/pattern_compiler.cpp

    r5172 r5202  
    4343
    4444
    45 std::vector<Assign *> optimizer(std::string patt, std::vector<pablo::Var *> basisBits, std::vector<std::vector<Assign*>>  & e, int i, PabloAST * cond, PabloBuilder & pb, int dist, int stepSize){
     45void optimizer(const std::string & patt, PabloAST * basisBits[], std::vector<std::vector<PabloAST *>> & e, unsigned i, PabloAST * cond, PabloBuilder & main, PabloBuilder & pb, int dist, int stepSize){
    4646    PabloBuilder it = PabloBuilder::Create(pb);
    47     std::vector<Assign *> var_list;
     47
     48    Zeroes * zeroes = pb.createZeroes();
     49
    4850    for(int n = 0; n < stepSize; n++){
    49         // PabloAST * name = cast<Name>(seq->at(i))->getCompiled();
    50         int pi = (patt[i] >> 1) & 0x3;
    51         PabloAST * name = basisBits[pi];       
     51
     52        PabloAST * name = basisBits[(patt[i] >> 1) & 0x3];
    5253       
    53         e[i][0] = it.createAssign(make_e(i,0), it.createAnd(it.createAdvance(e[i-1][0],1), name));
    54         for(int j = 1; j <= dist; j++){ 
    55             auto tmp1 = it.createAssign("tmp1", it.createAnd(it.createAdvance(e[i-1][j],1), name));
    56             auto tmp2 = it.createAssign("tmp2", it.createAnd(it.createAdvance(e[i-1][j-1],1), it.createNot(name)));
    57             auto tmp3 = it.createAssign("tmp3", it.createOr(it.createAdvance(e[i][j-1],1), e[i-1][j-1]));
    58             e[i][j] = it.createAssign(make_e(i,j), it.createOr(it.createOr(tmp1,tmp2),tmp3));
     54        e[i][0] = it.createAnd(it.createAdvance(e[i - 1][0], 1), name, make_e(i, 0));
     55        for(int j = 1; j <= dist; j++){
     56            auto tmp1 = it.createAnd(it.createAdvance(e[i-1][j],1), name);
     57            auto tmp2 = it.createAnd(it.createAdvance(e[i-1][j-1],1), it.createNot(name));
     58            auto tmp3 = it.createOr(it.createAdvance(e[i][j-1],1), e[i-1][j-1]);
     59            e[i][j] = it.createOr(it.createOr(tmp1, tmp2), tmp3, make_e(i, j));
    5960        }
    6061       
    6162        i++;
    62         if(i >= patt.length()) break;
     63        if (i >= patt.length()) break;
    6364    }
    64     i--; 
    6565
    66     if(i < patt.length()-1){
    67         var_list = optimizer(patt, basisBits, e, i+1, e[i][dist], it, dist, stepSize);
     66    if (i < patt.length()) {
     67       optimizer(patt, basisBits, e, i, e[i - 1][dist], main, it, dist, stepSize);
     68    } else {
     69        const auto i = patt.length() - 1;
     70        for(int j = 0; j <= dist; j++){
     71            auto eij = main.createVar("m" + std::to_string(j), zeroes);
     72            it.createAssign(eij, e[i][j]);
     73            e[i][j] = eij;
     74        }
    6875    }
    6976
    70     for(int j = 0; j <= dist; j++){
    71         var_list.push_back(e[i][j]);
    72     }
    73 
    74     std::vector<Assign *> new_var_list = var_list;
    75     pb.createIf(cond, std::move(var_list), it);
    76     return new_var_list;
     77    pb.createIf(cond, it);
    7778}
    7879
    79 void Pattern_Compiler::compile(std::vector<std::string> patts, PabloBuilder & pb, std::vector<pablo::Var *> basisBits, int dist, int optPosition, int stepSize) {
    80     std::vector<std::vector<Assign*>> e(patts[0].length()*2, std::vector<Assign*>(dist+1));
    81     std::vector<PabloAST*> E(dist+1);
    82     int i = 0;
    83     int pi = 0;
     80void Pattern_Compiler::compile(const std::vector<std::string> & patts, PabloBuilder & pb, PabloAST * basisBits[], int dist, unsigned optPosition, int stepSize) {
     81    std::vector<std::vector<PabloAST *>> e(patts[0].length() * 2, std::vector<PabloAST *>(dist+1));
     82    std::vector<PabloAST*> E(dist + 1);
    8483
    8584    for(int d=0; d<=dist; d++){
     
    8786    }
    8887
    89     for(int r=0; r< patts.size(); r++){
    90         std::string patt = patts[r];
    91         pi = (patt[0] >> 1) & 0x3;
    92         PabloAST * name = basisBits[pi];
     88    for(unsigned r = 0; r < patts.size(); r++){
     89        const std::string & patt = patts[r];
    9390
    94         e[0][0] = pb.createAssign(make_e(0, 0), name);
     91        PabloAST * name = basisBits[(patt[0] >> 1) & 0x3];
     92
     93        e[0][0] = name;
    9594        for(int j = 1; j <= dist; j++){
    96           e[0][j] = pb.createAssign(make_e(0, j), pb.createOnes());
     95          e[0][j] = pb.createOnes();
    9796        }
    9897
    99         i++;
    100         while (i < patt.length()) {
    101             pi = (patt[i] >> 1) & 0x3;
    102             name = basisBits[pi];
     98        unsigned i = 1;
     99        while (i < patt.length() && i < optPosition) {
    103100
    104             e[i][0] = pb.createAssign(make_e(i,0), pb.createAnd(pb.createAdvance(e[i-1][0],1), name));
     101            name = basisBits[(patt[i] >> 1) & 0x3];
     102
     103            e[i][0] = pb.createAnd(pb.createAdvance(e[i-1][0], 1), name, make_e(i, 0));
    105104            for(int j = 1; j <= dist; j++){     
    106                 auto tmp1 = pb.createAssign("tmp1", pb.createAnd(pb.createAdvance(e[i-1][j],1), name));
    107                 auto tmp2 = pb.createAssign("tmp2", pb.createAnd(pb.createAdvance(e[i-1][j-1],1), pb.createNot(name)));
    108                 auto tmp3 = pb.createAssign("tmp3", pb.createOr(pb.createAdvance(e[i][j-1],1), e[i-1][j-1]));
    109                 e[i][j] = pb.createAssign(make_e(i,j), pb.createOr(pb.createOr(tmp1,tmp2),tmp3));
     105                auto tmp1 = pb.createAnd(pb.createAdvance(e[i-1][j],1), name);
     106                auto tmp2 = pb.createAnd(pb.createAdvance(e[i-1][j-1],1), pb.createNot(name));
     107                auto tmp3 = pb.createOr(pb.createAdvance(e[i][j-1],1), e[i-1][j-1]);
     108                e[i][j] = pb.createOr(pb.createOr(tmp1,tmp2),tmp3, make_e(i, j));
    110109            }
    111110           
    112111            i++;
    113             if(i >= optPosition) break;
    114112        }
    115113
    116114        //Optimize from optPosition
    117         if(i >= optPosition){
    118             optimizer(patt, basisBits, e, i, e[i-1][dist], pb, dist, stepSize);
     115        if (i >= optPosition) {
     116            optimizer(patt, basisBits, e, i, e[i-1][dist], pb, pb, dist, stepSize);
    119117        }
    120118
    121         E[0] = pb.createOr(E[0], e[patt.length()-1][0]);
     119        E[0] = pb.createOr(E[0], e[patt.length() - 1][0]);
    122120        for(int d=1; d<=dist; d++){
    123121            E[d] = pb.createOr(E[d], pb.createAnd(e[patt.length()-1][d], pb.createNot(e[patt.length()-1][d-1])));
    124122        }
    125123
    126         i = 0;
    127124    }
     125
     126    Var * output = mFunction.addResult("E", getStreamTy(1, dist + 1));
     127
    128128    for(int d=0; d<=dist; d++){
    129         mFunction.setResult(d, pb.createAssign("E" + std::to_string(d), E[d]));
     129        pb.createAssign(pb.createExtract(output, d), E[d]);
     130        // mFunction.setResult(d, pb.createAssign("E" + std::to_string(d), E[d]));
    130131    }
    131132}
  • icGREP/icgrep-devel/icgrep/editd/pattern_compiler.h

    r5172 r5202  
    3030    Pattern_Compiler(pablo::PabloFunction & function);
    3131
    32     void compile(std::vector<std::string> patterns, pablo::PabloBuilder & pb, std::vector<pablo::Var *> basisBits, int dist, int optPosition, int stepSize);
     32    void compile(const std::vector<std::string> & patterns, pablo::PabloBuilder & pb, pablo::PabloAST *basisBits[], int dist, unsigned optPosition, int stepSize);
    3333
    3434
  • icGREP/icgrep-devel/icgrep/generate_predefined_ucd_functions.cpp

    r5176 r5202  
    246246    std::cerr << name << std::endl;
    247247    #endif
    248     PabloFunction * pbFunction = PabloFunction::Create(std::move(name), 8, 1);
     248    PabloFunction * pbFunction = PabloFunction::Create(std::move(name), 1, 1);
    249249    Encoding encoding(Encoding::Type::UTF_8, 8);
    250250    CC_Compiler ccCompiler(*pbFunction, encoding);
  • icGREP/icgrep-devel/icgrep/grep_engine.cpp

    r5200 r5202  
    216216    fileIdx->setName("fileIdx");
    217217
    218     ExternalFileBuffer MatchResults(iBuilder, StreamSetType(2, i1));
     218    ExternalFileBuffer MatchResults(iBuilder, StreamSetType(iBuilder, 2, 1));
    219219    MatchResults.setStreamSetBuffer(rsltStream, fileSize);
    220220
     
    234234    int addrSpace = 0;
    235235    bool CPU_Only = true;
    236     LLVMContext TheContext;
    237236    Module * M = nullptr; 
    238237    IDISA::IDISA_Builder * iBuilder = nullptr;
     
    240239#ifdef CUDA_ENABLED
    241240    setNVPTXOption();
    242     if(codegen::NVPTX){     
    243         Module * gpuM = new Module(moduleName+":gpu", TheContext);
     241    if (codegen::NVPTX) {
     242        Module * gpuM = new Module(moduleName+":gpu", getGlobalContext());
    244243        IDISA::IDISA_Builder * GPUBuilder = IDISA::GetIDISA_GPU_Builder(gpuM);
    245244        M = gpuM;
     
    250249        CPU_Only = false;
    251250        codegen::BlockSize = 64;
    252     }   
    253 #endif
    254 
    255     Module * cpuM = new Module(moduleName+":cpu", TheContext);
    256     IDISA::IDISA_Builder * CPUBuilder = IDISA::GetIDISA_Builder(cpuM); 
     251    }
     252#endif
     253
     254    Module * cpuM = new Module(moduleName+":cpu", getGlobalContext());
     255    IDISA::IDISA_Builder * CPUBuilder = IDISA::GetIDISA_Builder(cpuM);
    257256
    258257    if(CPU_Only) {
     
    262261
    263262    const unsigned segmentSize = codegen::SegmentSize;
    264     if (segmentPipelineParallel && codegen::BufferSegments < 2) codegen::BufferSegments = 2;
     263    if (segmentPipelineParallel && codegen::BufferSegments < 2) {
     264        codegen::BufferSegments = 2;
     265    }
    265266    const unsigned bufferSegments = codegen::BufferSegments;
    266267
     
    297298            fileSize = &*(args++);
    298299            fileSize->setName("fileSize");
    299         }
    300         else{
     300        } else {
    301301            mainFn = cast<Function>(M->getOrInsertFunction("Main", resultTy, inputType, size_ty, outputType, nullptr));
    302302            mainFn->setCallingConv(CallingConv::C);
     
    327327    }
    328328       
    329     ExternalFileBuffer ByteStream(iBuilder, StreamSetType(1, i8));
    330     CircularBuffer BasisBits(iBuilder, StreamSetType(8, i1), segmentSize * bufferSegments);
     329    ExternalFileBuffer ByteStream(iBuilder, StreamSetType(iBuilder, 1, 8));
     330    CircularBuffer BasisBits(iBuilder, StreamSetType(iBuilder, 8, 1), segmentSize * bufferSegments);
    331331
    332332    kernel::s2pKernel  s2pk(iBuilder);
     
    365365
    366366    if (CountOnly) {
    367         pablo::PabloKernel  icgrepK(iBuilder, "icgrep", function, {"matchedLineCount"});
     367        pablo::PabloKernel icgrepK(iBuilder, "icgrep", function);
    368368        icgrepK.generateKernel({&BasisBits}, {});       
    369369        Value * icgrepInstance = icgrepK.createInstance({});
    370 
    371370        if (pipelineParallel){
    372371            generatePipelineParallel(iBuilder, {&s2pk, &icgrepK}, {s2pInstance, icgrepInstance});
    373         }
    374         else if (segmentPipelineParallel){           
     372        } else if (segmentPipelineParallel){
    375373            generateSegmentParallelPipeline(iBuilder, {&s2pk, &icgrepK}, {s2pInstance, icgrepInstance}, fileSize);
    376         }
    377         else{
     374        } else {
    378375            generatePipelineLoop(iBuilder, {&s2pk, &icgrepK}, {s2pInstance, icgrepInstance}, fileSize);
    379376        }
    380        
     377
    381378        Value * matchCount = icgrepK.createGetAccumulatorCall(icgrepInstance, "matchedLineCount");
     379
    382380        iBuilder->CreateRet(matchCount);
    383381
    384     }
    385     else {
     382    } else {
    386383#ifdef CUDA_ENABLED
    387384        if (codegen::NVPTX){
    388             ExternalFileBuffer MatchResults(iBuilder, StreamSetType(2, i1), addrSpace);
     385            ExternalFileBuffer MatchResults(iBuilder, StreamSetType(iBuilder,2, i1), addrSpace);
    389386            MatchResults.setStreamSetBuffer(outputStream, fileSize);
    390387
     
    397394        }
    398395#endif
    399         if (CPU_Only){
    400             CircularBuffer MatchResults(iBuilder, StreamSetType(2, i1), segmentSize * bufferSegments);
     396        if (CPU_Only) {
     397            CircularBuffer MatchResults(iBuilder, StreamSetType(iBuilder, 2, 1), segmentSize * bufferSegments);
    401398            MatchResults.allocateBuffer();
    402399
    403             pablo::PabloKernel  icgrepK(iBuilder, "icgrep", function, {});
    404             icgrepK.generateKernel({&BasisBits},  {&MatchResults});
     400            pablo::PabloKernel  icgrepK(iBuilder, "icgrep", function);
     401            icgrepK.generateKernel({&BasisBits}, {&MatchResults});
    405402            Value * icgrepInstance = icgrepK.createInstance({});
    406403
     
    411408            if (pipelineParallel){
    412409                generatePipelineParallel(iBuilder, {&s2pk, &icgrepK, &scanMatchK}, {s2pInstance, icgrepInstance, scanMatchInstance});
    413             }
    414             else if (segmentPipelineParallel){
     410            } else if (segmentPipelineParallel){
    415411                generateSegmentParallelPipeline(iBuilder, {&s2pk, &icgrepK, &scanMatchK}, {s2pInstance, icgrepInstance, scanMatchInstance}, fileSize);
    416             }
    417             else{
     412            }  else{
    418413                generatePipelineLoop(iBuilder, {&s2pk, &icgrepK, &scanMatchK}, {s2pInstance, icgrepInstance, scanMatchInstance}, fileSize);
    419414            }
     
    483478}
    484479
    485 
    486480static int * total_count;
    487481static std::stringstream * resultStrs = nullptr;
  • icGREP/icgrep-devel/icgrep/icgrep-devel.files

    r5160 r5202  
    1 include/simd-lib/idisa_cpp/idisa_sse2.cpp
    2 include/simd-lib/bitblock.hpp
    3 include/simd-lib/bitblock128.hpp
    4 include/simd-lib/bitblock_iterator.hpp
    5 include/simd-lib/buffer.hpp
    6 include/simd-lib/builtins.hpp
    7 include/simd-lib/carryQ.hpp
    8 include/simd-lib/config.hpp
    9 include/simd-lib/idisa.hpp
    10 include/simd-lib/idisa128.hpp
    11 include/simd-lib/pabloSupport.hpp
    12 include/simd-lib/s2p.hpp
    13 include/simd-lib/transpose.hpp
     1basis_bits.h
     2casefold.cpp
     3cc/cc_compiler.cpp
     4cc/cc_compiler.h
     5cc/cc_compiler_helper.cpp
     6cc/cc_compiler_helper.h
     7cc/cc_namemap.cpp
     8cc/cc_namemap.hpp
    149cc_compiler.cpp
    1510cc_compiler.h
    1611cc_compiler_helper.cpp
    1712cc_compiler_helper.h
    18 compiler.cpp
    19 compiler.h
    20 hrtime.h
    21 icgrep.cpp
    22 icgrep.h
    23 llvm_gen.cpp
    24 llvm_gen.h
    25 parsefailure.cpp
    26 parsefailure.h
    27 parseresult.cpp
    28 parseresult.h
    29 parsesuccess.cpp
    30 parsesuccess.h
    31 pbix_compiler.cpp
    32 pbix_compiler.h
    33 pe_advance.cpp
    34 pe_advance.h
    35 pe_all.cpp
    36 pe_all.h
    37 pe_and.cpp
    38 pe_and.h
    39 pe_call.cpp
    40 pe_call.h
    41 pe_charclass.cpp
    42 pe_charclass.h
    43 pe_matchstar.cpp
    44 pe_matchstar.h
    45 pe_not.cpp
    46 pe_not.h
    47 pe_or.cpp
    48 pe_or.h
    49 pabloAST.cpp
    50 pabloAST.h
    51 pe_scanthru.cpp
    52 pe_scanthru.h
    53 pe_sel.cpp
    54 pe_sel.h
    55 pe_var.cpp
    56 pe_var.h
    57 pe_xor.cpp
    58 pe_xor.h
    59 printer_pablos.cpp
    60 printer_pablos.h
    61 printer_re.cpp
    62 printer_re.h
    63 ps_assign.cpp
    64 ps_assign.h
    65 ps_if.cpp
    66 ps_if.h
    67 ps_pablos.cpp
    68 ps_pablos.h
    69 ps_while.cpp
    70 ps_while.h
    71 re_alt.cpp
    72 re_alt.h
    73 re_cc.cpp
    74 re_cc.h
    75 re_compiler.cpp
    76 re_compiler.h
    77 re_end.cpp
    78 re_end.h
    79 re_name.cpp
    80 re_name.h
    81 re_nullable.cpp
    82 re_nullable.h
    83 re_parser.cpp
    84 re_parser.h
    85 re_re.cpp
    86 re_re.h
    87 re_reducer.cpp
    88 re_reducer.h
    89 re_rep.cpp
    90 re_rep.h
    91 re_seq.cpp
    92 re_seq.h
    93 re_simplifier.cpp
    94 re_simplifier.h
    95 re_start.cpp
    96 re_start.h
    97 symbol_generator.cpp
    98 symbol_generator.h
    99 unicode_categories-flat.h
    100 unicode_categories-simple.h
    101 unicode_categories.h
    102 utf8_encoder.cpp
    103 utf8_encoder.h
    104 utf_encoding.cpp
    105 utf_encoding.h
    106 re/parsefailure.cpp
    107 re/parsefailure.h
    108 re/re_alt.cpp
    109 re/re_alt.h
    110 re/re_cc.cpp
    111 re/re_cc.h
    112 re/re_compiler.cpp
    113 re/re_compiler.h
    114 re/re_end.cpp
    115 re/re_end.h
    116 re/re_name.cpp
    117 re/re_name.h
    118 re/re_nullable.cpp
    119 re/re_nullable.h
    120 re/re_parser.cpp
    121 re/re_parser.h
    122 re/re_re.cpp
    123 re/re_re.h
    124 re/re_reducer.cpp
    125 re/re_reducer.h
    126 re/re_rep.cpp
    127 re/re_rep.h
    128 re/re_seq.cpp
    129 re/re_seq.h
    130 re/re_simplifier.cpp
    131 re/re_simplifier.h
    132 re/re_start.cpp
    133 re/re_start.h
    134 re/symbol_generator.cpp
    135 re/symbol_generator.h
    136 cc/cc_compiler.cpp
    137 cc/cc_compiler.h
    138 cc/cc_compiler_helper.cpp
    139 cc/cc_compiler_helper.h
    140 pablo/pbix_compiler.cpp
    141 pablo/pbix_compiler.h
    142 pablo/pe_advance.cpp
    143 pablo/pe_advance.h
    144 pablo/pe_all.cpp
    145 pablo/pe_all.h
    146 pablo/pe_and.cpp
    147 pablo/pe_and.h
    148 pablo/pe_call.cpp
    149 pablo/pe_call.h
    150 pablo/pe_charclass.cpp
    151 pablo/pe_charclass.h
    152 pablo/pe_matchstar.cpp
    153 pablo/pe_matchstar.h
    154 pablo/pe_not.cpp
    155 pablo/pe_not.h
    156 pablo/pe_or.cpp
    157 pablo/pe_or.h
    158 pablo/pabloAST.cpp
    159 pablo/pabloAST.h
    160 pablo/pe_scanthru.cpp
    161 pablo/pe_scanthru.h
    162 pablo/pe_sel.cpp
    163 pablo/pe_sel.h
    164 pablo/pe_var.cpp
    165 pablo/pe_var.h
    166 pablo/pe_xor.cpp
    167 pablo/pe_xor.h
    168 pablo/ps_assign.h
    169 pablo/ps_if.h
    170 pablo/ps_pablos.cpp
    171 pablo/ps_pablos.h
    172 pablo/ps_while.cpp
    173 pablo/ps_while.h
    174 pablo/pablo_routines.cpp
    175 pablo/pablo_routines.h
    176 re/printer_re.cpp
    177 re/printer_re.h
    178 pablo/pablo_compiler.cpp
    179 pablo/pablo_compiler.h
    180 pablo/codegenstate.cpp
    181 pablo/codegenstate.h
    182 pablo/printer_pablos.cpp
    183 pablo/printer_pablos.h
    184 CMakeLists.txt
    185 cc/cc_namemap.cpp
    186 cc/cc_namemap.hpp
    187 pablo/codegenstate.cpp
    188 pablo/codegenstate.h
    189 pablo/pabloAST.cpp
    190 pablo/pabloAST.h
    191 pablo/pablo_compiler.cpp
    192 pablo/pablo_compiler.h
    193 pablo/pe_advance.h
    194 pablo/pe_all.cpp
    195 pablo/pe_all.h
    196 pablo/pe_and.cpp
    197 pablo/pe_and.h
    198 pablo/pe_call.h
    199 pablo/pe_matchstar.h
    200 pablo/pe_next.h
    201 pablo/pe_not.cpp
    202 pablo/pe_not.h
    203 pablo/pe_ones.h
    204 pablo/pe_or.cpp
    205 pablo/pe_or.h
    206 pablo/pe_scanthru.h
    207 pablo/pe_sel.cpp
    208 pablo/pe_sel.h
    209 pablo/pe_string.h
    210 pablo/pe_var.h
    211 pablo/pe_xor.cpp
    212 pablo/pe_xor.h
    213 pablo/pe_zeroes.h
    214 pablo/printer_pablos.cpp
    215 pablo/printer_pablos.h
    216 pablo/ps_assign.h
    217 pablo/ps_if.h
    218 pablo/ps_while.h
    219 pablo/symbol_generator.cpp
    220 pablo/symbol_generator.h
    221 re/re_diff.h
    222 pablo/analysis/useanalysis.cpp
    223 pablo/analysis/useanalysis.h
    224 slab_allocator.h
    225 re/re_re.cpp
    226 pablo/ps_if.cpp
    227 pablo/pe_metadata.h
     13CMakeFiles/3.2.2/CompilerIdC/CMakeCCompilerId.c
     14CMakeFiles/3.2.2/CompilerIdCXX/CMakeCXXCompilerId.cpp
     15CMakeFiles/feature_tests.c
     16CMakeFiles/feature_tests.cxx
    22817CMakeLists.txt
    22918compiler.cpp
     
    23120do_grep.cpp
    23221do_grep.h
     22editd/editd.cpp
     23editd/editdscan_kernel.cpp
     24editd/editdscan_kernel.h
     25editd/pattern_compiler.cpp
     26editd/pattern_compiler.h
     27generate_predefined_ucd_functions.cpp
     28grep_engine.cpp
     29grep_engine.h
    23330hrtime.h
    23431icgrep.cpp
    235 icgrep.h
    23632icgrep-devel.config
    23733icgrep-devel.creator
     
    23935icgrep-devel.files
    24036icgrep-devel.includes
    241 resolve_properties.cpp
    242 slab_allocator.h
    243 utf8_encoder.cpp
    244 utf8_encoder.h
    245 utf_encoding.h
    246 pablo/optimizers/pablo_automultiplexing.cpp
    247 pablo/optimizers/pablo_automultiplexing.hpp
    248 pablo/optimizers/pablo_simplifier.cpp
    249 pablo/optimizers/pablo_simplifier.hpp
    250 pablo/builder.hpp
    251 pablo/codegenstate.cpp
    252 pablo/codegenstate.h
    253 pablo/expression_map.hpp
    254 pablo/pablo_compiler.cpp
    255 pablo/pablo_compiler.h
    256 pablo/pabloAST.cpp
    257 pablo/pabloAST.h
    258 pablo/pe_advance.h
    259 pablo/pe_and.cpp
    260 pablo/pe_and.h
    261 pablo/pe_call.h
    262 pablo/pe_integer.h
    263 pablo/pe_matchstar.h
    264 pablo/pe_next.h
    265 pablo/pe_not.cpp
    266 pablo/pe_not.h
    267 pablo/pe_ones.h
    268 pablo/pe_or.cpp
    269 pablo/pe_or.h
    270 pablo/pe_scanthru.h
    271 pablo/pe_sel.cpp
    272 pablo/pe_sel.h
    273 pablo/pe_string.h
    274 pablo/pe_var.h
    275 pablo/pe_xor.cpp
    276 pablo/pe_xor.h
    277 pablo/pe_zeroes.h
    278 pablo/printer_pablos.cpp
    279 pablo/printer_pablos.h
    280 pablo/ps_assign.cpp
    281 pablo/ps_assign.h
    282 pablo/ps_if.cpp
    283 pablo/ps_if.h
    284 pablo/ps_while.cpp
    285 pablo/ps_while.h
    286 pablo/symbol_generator.cpp
    287 pablo/symbol_generator.h
    288 pablo/builder.cpp
    289 pablo/optimizers/pablo_codesinking.cpp
    290 pablo/optimizers/pablo_codesinking.hpp
    291 UCD/Blocks.h
    292 UCD/CaseFolding_txt.cpp
    293 UCD/CaseFolding_txt.h
    294 UCD/DerivedCoreProperties.h
    295 UCD/DerivedGeneralCategory.h
    296 UCD/EastAsianWidth.h
    297 UCD/HangulSyllableType.h
    298 UCD/LineBreak.h
    299 UCD/precompiled_blk.cpp
    300 UCD/precompiled_blk.h
    301 UCD/precompiled_derivedcoreproperties.cpp
    302 UCD/precompiled_derivedcoreproperties.h
    303 UCD/precompiled_gc.cpp
    304 UCD/precompiled_gc.h
    305 UCD/precompiled_proplist.cpp
    306 UCD/precompiled_proplist.h
    307 UCD/precompiled_sc.cpp
    308 UCD/precompiled_sc.h
    309 UCD/precompiled_scx.cpp
    310 UCD/precompiled_scx.h
    311 UCD/PropertyAliases.h
    312 UCD/PropertyObjects.h
    313 UCD/PropertyObjectTable.h
    314 UCD/PropertyValueAliases.h
    315 UCD/PropList.h
    316 UCD/ScriptExtensions.h
    317 UCD/Scripts.h
    318 UCD/unicode_set.cpp
    319 UCD/unicode_set.h
    320 ../ucd/ucdcompiler.cpp
    321 ../ucd/ucdcompiler.hpp
    322 UCD/ucd_compiler.cpp
    323 UCD/ucd_compiler.hpp
    324 UCD/PropertyObjects.cpp
    325 ../QA/unit-tests/unicode_set_tests.hpp
    326 pablo/optimizers/pablo_bddminimization.h
    327 pablo/optimizers/pablo_bddminimization.cpp
    328 pablo/carry_data.h
    329 pablo/carry_manager.cpp
    330 pablo/carry_manager.h
    331 pablo/carry_data.cpp
    332 pablo/function.h
    333 pablo/function.cpp
    334 UCD/resolve_properties.cpp
    335 UCD/resolve_properties.h
    336 generate_predefined_ucd_functions.cpp
    337 pablo/optimizers/booleanreassociationpass.cpp
    338 pablo/optimizers/booleanreassociationpass.h
    339 pablo/optimizers/graph-facade.hpp
    340 pablo/analysis/pabloverifier.hpp
    341 pablo/analysis/pabloverifier.cpp
    342 basis_bits.h
    343 toolchain.h
    344 toolchain.cpp
    345 re/re_compiler.cpp
    346 re/re_compiler.h
    347 re/re_cc.cpp
    348 re/re_cc.h
    349 re/re_parser.cpp
    350 re/re_name.h
    351 re/re_parser.h
    352 re/re_nullable.cpp
    353 re/printer_re.cpp
    354 re/re_analysis.cpp
    355 re/re_diff.h
    356 re/re_assertion.h
    357 re/re_re.h
    358 re/re_end.h
    359 re/re_simplifier.h
    360 re/re_diff.cpp
    361 re/re_re.cpp
    362 re/re_intersect.h
    363 re/re_simplifier.cpp
    364 re/re_nullable.h
    365 re/re_start.h
    366 re/parsefailure.h
    367 re/re_intersect.cpp
    368 re/re_seq.h
    369 re/parsefailure.cpp
    370 re/re_any.h
    371 re/re_rep.h
    372 re/printer_re.h
    373 re/re_analysis.h
    374 re/re_rep.cpp
    375 re/re_alt.h
    376 re/re_parser.cpp
    377 re/re_name.h
    378 re/re_parser.h
    379 re/re_memoizer.hpp
    380 re/re_compiler.cpp
    381 re/re_cc.h
    382 re/re_cc.cpp
    383 re/re_compiler.h
    384 re/re_nullable.cpp
    385 re/printer_re.cpp
    386 re/re_analysis.cpp
    387 re/re_diff.h
    388 re/re_assertion.h
    389 re/re_re.h
    390 re/re_end.h
    391 re/re_simplifier.h
    392 re/re_diff.cpp
    393 re/re_re.cpp
    394 re/re_intersect.h
    395 re/re_simplifier.cpp
    396 re/re_nullable.h
    397 re/re_start.h
    398 re/parsefailure.h
    399 re/re_intersect.cpp
    400 re/re_seq.h
    401 re/parsefailure.cpp
    402 re/re_any.h
    403 re/re_rep.h
    404 re/printer_re.h
    405 re/re_analysis.h
    406 re/re_rep.cpp
    407 re/re_alt.h
    408 re/re_grapheme_boundary.hpp
    409 pablo/optimizers/codemotionpass.h
    410 pablo/optimizers/codemotionpass.cpp
    411 ../buddy-2.4/src/bdd.h
    412 ../buddy-2.4/src/bddop.cpp
    413 ../buddy-2.4/src/cache.cpp
    414 ../buddy-2.4/src/cache.h
    415 ../buddy-2.4/src/imatrix.cpp
    416 ../buddy-2.4/src/imatrix.h
    417 ../buddy-2.4/src/kernel.cpp
    418 ../buddy-2.4/src/kernel.h
    419 ../buddy-2.4/src/pairs.cpp
    420 ../buddy-2.4/src/prime.cpp
    421 ../buddy-2.4/src/prime.h
    422 ../buddy-2.4/src/reorder.cpp
    423 ../buddy-2.4/src/bdd.h
    424 ../buddy-2.4/src/bddio.c
    425 ../buddy-2.4/src/bddop.c
    426 ../buddy-2.4/src/bddtest.cxx
    427 ../buddy-2.4/src/cache.h
    428 ../buddy-2.4/src/cache.c
    429 ../buddy-2.4/src/bvec.c
    430 ../buddy-2.4/src/bvec.h
    431 ../buddy-2.4/src/cppext.cxx
    432 ../buddy-2.4/src/fdd.c
    433 ../buddy-2.4/src/fdd.h
    434 ../buddy-2.4/src/imatrix.h
    435 ../buddy-2.4/src/imatrix.c
    436 ../buddy-2.4/src/pairs.c
    437 ../buddy-2.4/src/prime.c
    438 ../buddy-2.4/src/prime.h
    439 ../buddy-2.4/src/tree.c
    440 ../buddy-2.4/src/kernel.h
    441 ../buddy-2.4/src/kernel.c
    442 ../buddy-2.4/src/bddtree.h
    443 UCD/EastAsianWidth.h
    444 UCD/DerivedCoreProperties.h
    445 UCD/PropList.h
    446 UCD/LineBreak.h
    447 UCD/Scripts.h
    448 UCD/ScriptExtensions.h
    449 UCD/HangulSyllableType.h
    450 UCD/Blocks.h
    451 UCD/PropertyAliases.h
    452 UCD/DerivedGeneralCategory.h
    453 UCD/CaseFolding_txt.h
    454 UCD/DerivedJoiningGroup.h
    455 UCD/GraphemeBreakProperty.h
    456 UCD/DerivedCombiningClass.h
    457 UCD/WordBreakProperty.h
    458 UCD/DerivedDecompositionType.h
    459 UCD/DerivedBinaryProperties.h
    460 UCD/DerivedNumericType.h
    461 UCD/CaseFolding_txt.cpp
    462 UCD/DerivedBidiClass.h
    463 UCD/PropertyObjectTable.h
    464 UCD/DerivedAge.h
    465 UCD/DerivedJoiningType.h
    466 UCD/PropertyValueAliases.h
    467 UCD/SentenceBreakProperty.h
    468 UCD/resolve_properties.h
    469 UCD/PropertyObjects.h
    470 UCD/PropertyObjects.cpp
    471 UCD/precompiled_properties.cpp
    472 UCD/precompiled_properties.h
    473 UCD/resolve_properties.cpp
    474 UCD/ucd_compiler.hpp
    475 UCD/ucd_compiler.cpp
    476 UCD/unicode_set.h
    477 UCD/unicode_set.cpp
    478 pablo/passes/flattenassociativedfg.h
    479 pablo/passes/flattenassociativedfg.cpp
    480 pablo/optimizers/distributivepass.h
    481 pablo/optimizers/distributivepass.cpp
    482 pablo/passes/factorizedfg.h
    483 pablo/passes/factorizedfg.cpp
    484 ispc.cpp
    485 pablo/optimizers/schedulingprepass.h
    486 pablo/optimizers/schedulingprepass.cpp
    487 papi_helper.hpp
    488 kernels/s2p_gen.cpp
    489 kernels/scanmatchgen.cpp
    490 kernels/s2p_gen.h
    491 kernels/scanmatchgen.h
    492 IDISA/idisa_builder.cpp
    493 IDISA/idisa_sse_builder.h
    494 IDISA/idisa_sse_builder.cpp
    495 IDISA/idisa_avx_builder.h
    496 IDISA/idisa_avx_builder.cpp
    497 IDISA/idisa_builder.h
    498 ../buddy-2.4/src/bddtree.h
    499 ../buddy-2.4/src/tree.cpp
    500 pablo/pe_lookahead.h
    501 pablo/symbol-table/length_group_generator.h
    502 pablo/symbol-table/length_group_generator.cpp
    503 kernels/pipeline.h
    504 kernels/kernel.h
    505 kernels/kernel.cpp
    506 kernels/scanmatchgen.h
    507 kernels/pipeline.cpp
    508 kernels/scanmatchgen.cpp
    509 kernels/s2p_gen.cpp
    510 kernels/s2p_gen.h
    511 cc/cc_compiler.cpp
    512 cc/cc_compiler.h
    513 CMakeFiles/3.2.2/CompilerIdC/CMakeCCompilerId.c
    514 CMakeFiles/3.2.2/CompilerIdCXX/CMakeCXXCompilerId.cpp
    515 CMakeFiles/feature_tests.c
    516 CMakeFiles/feature_tests.cxx
    517 IDISA/idisa_avx_builder.cpp
    518 IDISA/idisa_avx_builder.h
    519 IDISA/idisa_builder.cpp
    520 IDISA/idisa_builder.h
    521 IDISA/idisa_sse_builder.cpp
    522 IDISA/idisa_sse_builder.h
    523 include/simd-lib/idisa_cpp/idisa_avx2.cpp
    524 include/simd-lib/idisa_cpp/idisa_sse2.cpp
    525 include/simd-lib/bitblock.hpp
    526 include/simd-lib/bitblock128.hpp
    527 include/simd-lib/bitblock256.hpp
    528 include/simd-lib/bitblock_iterator.hpp
    529 include/simd-lib/buffer.hpp
    530 include/simd-lib/builtins.hpp
    531 include/simd-lib/carryQ.hpp
    532 include/simd-lib/config.hpp
    533 include/simd-lib/idisa.hpp
    534 include/simd-lib/idisa128.hpp
    535 include/simd-lib/idisa256.hpp
    536 include/simd-lib/pabloSupport.hpp
    537 include/simd-lib/s2p.hpp
    538 include/simd-lib/transpose.hpp
    539 kernels/kernel.cpp
    540 kernels/kernel.h
    541 kernels/pipeline.cpp
    542 kernels/pipeline.h
    543 kernels/s2p_kernel.cpp
    544 kernels/s2p_kernel.h
    545 kernels/scanmatchgen.cpp
    546 kernels/scanmatchgen.h
    547 pablo/analysis/pabloverifier.cpp
    548 pablo/analysis/pabloverifier.hpp
    549 pablo/optimizers/booleanreassociationpass.cpp
    550 pablo/optimizers/booleanreassociationpass.h
    551 pablo/optimizers/codemotionpass.cpp
    552 pablo/optimizers/codemotionpass.h
    553 pablo/optimizers/distributivepass.cpp
    554 pablo/optimizers/distributivepass.h
    555 pablo/optimizers/graph-facade.hpp
    556 pablo/optimizers/pablo_automultiplexing.cpp
    557 pablo/optimizers/pablo_automultiplexing.hpp
    558 pablo/optimizers/pablo_bddminimization.cpp
    559 pablo/optimizers/pablo_bddminimization.h
    560 pablo/optimizers/pablo_simplifier.cpp
    561 pablo/optimizers/pablo_simplifier.hpp
    562 pablo/optimizers/schedulingprepass.cpp
    563 pablo/optimizers/schedulingprepass.h
    564 pablo/passes/factorizedfg.cpp
    565 pablo/passes/factorizedfg.h
    566 pablo/passes/flattenassociativedfg.cpp
    567 pablo/passes/flattenassociativedfg.h
    568 pablo/symbol-table/length_group_generator.cpp
    569 pablo/symbol-table/length_group_generator.h
    570 pablo/builder.cpp
    571 pablo/builder.hpp
    572 pablo/carry_data.cpp
    573 pablo/carry_data.h
    574 pablo/carry_manager.cpp
    575 pablo/carry_manager.h
    576 pablo/codegenstate.cpp
    577 pablo/codegenstate.h
    578 pablo/expression_map.hpp
    579 pablo/function.cpp
    580 pablo/function.h
    581 pablo/pablo_compiler.cpp
    582 pablo/pablo_compiler.h
    583 pablo/pabloAST.cpp
    584 pablo/pabloAST.h
    585 pablo/pe_advance.h
    586 pablo/pe_and.h
    587 pablo/pe_call.h
    588 pablo/pe_count.h
    589 pablo/pe_integer.h
    590 pablo/pe_lookahead.h
    591 pablo/pe_matchstar.h
    592 pablo/pe_next.h
    593 pablo/pe_not.h
    594 pablo/pe_ones.h
    595 pablo/pe_or.h
    596 pablo/pe_scanthru.h
    597 pablo/pe_sel.h
    598 pablo/pe_setithbit.h
    599 pablo/pe_string.h
    600 pablo/pe_var.h
    601 pablo/pe_xor.h
    602 pablo/pe_zeroes.h
    603 pablo/printer_pablos.cpp
    604 pablo/printer_pablos.h
    605 pablo/ps_assign.h
    606 pablo/ps_if.cpp
    607 pablo/ps_if.h
    608 pablo/ps_while.cpp
    609 pablo/ps_while.h
    610 pablo/symbol_generator.cpp
    611 pablo/symbol_generator.h
    612 re/parsefailure.cpp
    613 re/parsefailure.h
    614 re/printer_re.cpp
    615 re/printer_re.h
    616 re/re_alt.h
    617 re/re_analysis.cpp
    618 re/re_analysis.h
    619 re/re_any.h
    620 re/re_assertion.h
    621 re/re_cc.cpp
    622 re/re_cc.h
    623 re/re_compiler.cpp
    624 re/re_compiler.h
    625 re/re_diff.cpp
    626 re/re_diff.h
    627 re/re_end.h
    628 re/re_grapheme_boundary.hpp
    629 re/re_intersect.cpp
    630 re/re_intersect.h
    631 re/re_memoizer.hpp
    632 re/re_name.h
    633 re/re_nullable.cpp
    634 re/re_nullable.h
    635 re/re_parser.cpp
    636 re/re_parser.h
    637 re/re_re.cpp
    638 re/re_re.h
    639 re/re_rep.cpp
    640 re/re_rep.h
    641 re/re_seq.h
    642 re/re_simplifier.cpp
    643 re/re_simplifier.h
    644 re/re_start.h
    645 UCD/Blocks.h
    646 UCD/CaseFolding_txt.cpp
    647 UCD/CaseFolding_txt.h
    648 UCD/DerivedAge.h
    649 UCD/DerivedBidiClass.h
    650 UCD/DerivedBinaryProperties.h
    651 UCD/DerivedCombiningClass.h
    652 UCD/DerivedCoreProperties.h
    653 UCD/DerivedDecompositionType.h
    654 UCD/DerivedGeneralCategory.h
    655 UCD/DerivedJoiningGroup.h
    656 UCD/DerivedJoiningType.h
    657 UCD/DerivedNumericType.h
    658 UCD/EastAsianWidth.h
    659 UCD/GraphemeBreakProperty.h
    660 UCD/HangulSyllableType.h
    661 UCD/LineBreak.h
    662 UCD/precompiled_properties.cpp
    663 UCD/precompiled_properties.h
    664 UCD/PropertyAliases.h
    665 UCD/PropertyObjects.cpp
    666 UCD/PropertyObjects.h
    667 UCD/PropertyObjectTable.h
    668 UCD/PropertyValueAliases.h
    669 UCD/PropList.h
    670 UCD/resolve_properties.cpp
    671 UCD/resolve_properties.h
    672 UCD/ScriptExtensions.h
    673 UCD/Scripts.h
    674 UCD/SentenceBreakProperty.h
    675 UCD/ucd_compiler.cpp
    676 UCD/ucd_compiler.hpp
    677 UCD/unicode_set.cpp
    678 UCD/unicode_set.h
    679 UCD/WordBreakProperty.h
    680 do_grep.cpp
    681 do_grep.h
    682 generate_predefined_ucd_functions.cpp
    683 hrtime.h
    684 icgrep.cpp
    685 ispc.cpp
    686 papi_helper.hpp
    687 slab_allocator.h
    688 toolchain.cpp
    689 toolchain.h
    690 utf8_encoder.cpp
    691 utf8_encoder.h
    692 utf_encoding.h
    693 kernels/lookaheadextractor.h
    694 kernels/lookaheadextractor.cpp
    695 kernels/symboltablepipeline.h
    696 kernels/symboltablepipeline.cpp
    697 symboltable.cpp
    698 grep_engine.h
    699 grep_engine.cpp
    700 IDISA/idisa_i64_builder.cpp
    701 IDISA/idisa_i64_builder.h
    702 kernels/instance.h
    703 kernels/streamset.h
    704 util/papi_helper.hpp
    705 util/slab_allocator.h
    706 util/ispc.cpp
    707 IDISA/idisa_target.h
    708 IDISA/idisa_target.cpp
    709 pablo/pablo_toolchain.cpp
    710 pablo/pablo_toolchain.h
    711 cc/cc_compiler.cpp
    712 cc/cc_compiler.h
    713 IDISA/idisa_avx_builder.cpp
    714 IDISA/idisa_avx_builder.h
    715 IDISA/idisa_builder.cpp
    716 IDISA/idisa_builder.h
    717 IDISA/idisa_i64_builder.cpp
    718 IDISA/idisa_i64_builder.h
    719 IDISA/idisa_sse_builder.cpp
    720 IDISA/idisa_sse_builder.h
    721 IDISA/idisa_target.cpp
    722 IDISA/idisa_target.h
    723 kernels/deletion.cpp
    724 kernels/deletion.h
    725 kernels/instance.h
    726 kernels/kernel.cpp
    727 kernels/kernel.h
    728 kernels/pipeline.cpp
    729 kernels/pipeline.h
    730 kernels/s2p_kernel.cpp
    731 kernels/s2p_kernel.h
    732 kernels/scanmatchgen.cpp
    733 kernels/scanmatchgen.h
    734 kernels/streamset.h
    735 kernels/symboltablepipeline.cpp
    736 kernels/symboltablepipeline.h
    737 pablo/analysis/pabloverifier.cpp
    738 pablo/analysis/pabloverifier.hpp
    739 pablo/optimizers/booleanreassociationpass.cpp
    740 pablo/optimizers/booleanreassociationpass.h
    741 pablo/optimizers/codemotionpass.cpp
    742 pablo/optimizers/codemotionpass.h
    743 pablo/optimizers/distributivepass.cpp
    744 pablo/optimizers/distributivepass.h
    745 pablo/optimizers/graph-facade.hpp
    746 pablo/optimizers/pablo_automultiplexing.cpp
    747 pablo/optimizers/pablo_automultiplexing.hpp
    748 pablo/optimizers/pablo_bddminimization.cpp
    749 pablo/optimizers/pablo_bddminimization.h
    750 pablo/optimizers/pablo_simplifier.cpp
    751 pablo/optimizers/pablo_simplifier.hpp
    752 pablo/optimizers/schedulingprepass.cpp
    753 pablo/optimizers/schedulingprepass.h
    754 pablo/passes/factorizedfg.cpp
    755 pablo/passes/factorizedfg.h
    756 pablo/passes/flattenassociativedfg.cpp
    757 pablo/passes/flattenassociativedfg.h
    758 pablo/builder.cpp
    759 pablo/builder.hpp
    760 pablo/carry_data.cpp
    761 pablo/carry_data.h
    762 pablo/carry_manager.cpp
    763 pablo/carry_manager.h
    764 pablo/codegenstate.cpp
    765 pablo/codegenstate.h
    766 pablo/expression_map.hpp
    767 pablo/function.cpp
    768 pablo/function.h
    769 pablo/pablo_compiler.cpp
    770 pablo/pablo_compiler.h
    771 pablo/pablo_toolchain.cpp
    772 pablo/pablo_toolchain.h
    773 pablo/pabloAST.cpp
    774 pablo/pabloAST.h
    775 pablo/pe_advance.h
    776 pablo/pe_and.h
    777 pablo/pe_call.h
    778 pablo/pe_count.h
    779 pablo/pe_integer.h
    780 pablo/pe_lookahead.h
    781 pablo/pe_matchstar.h
    782 pablo/pe_next.h
    783 pablo/pe_not.h
    784 pablo/pe_ones.h
    785 pablo/pe_or.h
    786 pablo/pe_scanthru.h
    787 pablo/pe_sel.h
    788 pablo/pe_setithbit.h
    789 pablo/pe_string.h
    790 pablo/pe_var.h
    791 pablo/pe_xor.h
    792 pablo/pe_zeroes.h
    793 pablo/printer_pablos.cpp
    794 pablo/printer_pablos.h
    795 pablo/ps_assign.h
    796 pablo/ps_if.cpp
    797 pablo/ps_if.h
    798 pablo/ps_while.cpp
    799 pablo/ps_while.h
    800 pablo/symbol_generator.cpp
    801 pablo/symbol_generator.h
    802 re/parsefailure.cpp
    803 re/parsefailure.h
    804 re/printer_re.cpp
    805 re/printer_re.h
    806 re/re_alt.h
    807 re/re_analysis.cpp
    808 re/re_analysis.h
    809 re/re_any.h
    810 re/re_assertion.h
    811 re/re_cc.cpp
    812 re/re_cc.h
    813 re/re_compiler.cpp
    814 re/re_compiler.h
    815 re/re_diff.cpp
    816 re/re_diff.h
    817 re/re_end.h
    818 re/re_grapheme_boundary.hpp
    819 re/re_intersect.cpp
    820 re/re_intersect.h
    821 re/re_memoizer.hpp
    822 re/re_name.h
    823 re/re_nullable.cpp
    824 re/re_nullable.h
    825 re/re_parser.cpp
    826 re/re_parser.h
    827 re/re_re.cpp
    828 re/re_re.h
    829 re/re_rep.cpp
    830 re/re_rep.h
    831 re/re_seq.h
    832 re/re_simplifier.cpp
    833 re/re_simplifier.h
    834 re/re_start.h
    835 re/re_toolchain.cpp
    836 re/re_toolchain.h
    837 UCD/Blocks.h
    838 UCD/CaseFolding_txt.cpp
    839 UCD/CaseFolding_txt.h
    840 UCD/DerivedAge.h
    841 UCD/DerivedBidiClass.h
    842 UCD/DerivedBinaryProperties.h
    843 UCD/DerivedCombiningClass.h
    844 UCD/DerivedCoreProperties.h
    845 UCD/DerivedDecompositionType.h
    846 UCD/DerivedGeneralCategory.h
    847 UCD/DerivedJoiningGroup.h
    848 UCD/DerivedJoiningType.h
    849 UCD/DerivedNumericType.h
    850 UCD/EastAsianWidth.h
    851 UCD/GraphemeBreakProperty.h
    852 UCD/HangulSyllableType.h
    853 UCD/LineBreak.h
    854 UCD/precompiled_properties.cpp
    855 UCD/precompiled_properties.h
    856 UCD/PropertyAliases.h
    857 UCD/PropertyObjects.cpp
    858 UCD/PropertyObjects.h
    859 UCD/PropertyObjectTable.h
    860 UCD/PropertyValueAliases.h
    861 UCD/PropList.h
    862 UCD/resolve_properties.cpp
    863 UCD/resolve_properties.h
    864 UCD/ScriptExtensions.h
    865 UCD/Scripts.h
    866 UCD/SentenceBreakProperty.h
    867 UCD/ucd_compiler.cpp
    868 UCD/ucd_compiler.hpp
    869 UCD/unicode_set.cpp
    870 UCD/unicode_set.h
    871 UCD/UnicodeNameData.cpp
    872 UCD/UnicodeNameData.h
    873 UCD/WordBreakProperty.h
    874 util/ispc.cpp
    875 util/papi_helper.hpp
    876 util/slab_allocator.h
    877 generate_predefined_ucd_functions.cpp
    878 grep_engine.cpp
    879 grep_engine.h
    880 hrtime.h
    881 icgrep.cpp
    882 object_cache.cpp
    883 object_cache.h
    884 symboltable.cpp
    885 toolchain.cpp
    886 toolchain.h
    887 utf8_encoder.cpp
    888 utf8_encoder.h
    889 utf_encoding.h
    890 kernels/casefold_pipeline.h
    891 kernels/casefold_pipeline.cpp
    892 kernels/symboltablepipeline.cpp
    893 kernels/symboltablepipeline.h
    894 kernels/kernel.cpp
    895 kernels/kernel.h
    896 kernels/p2s_kernel.cpp
    897 kernels/instance.h
    898 kernels/casefold_pipeline.cpp
    899 kernels/stdout_kernel.h
    900 kernels/casefold_pipeline.h
    901 kernels/p2s_kernel.h
    902 kernels/stdout_kernel.cpp
    903 kernels/pipeline.cpp
    904 kernels/scanmatchgen.cpp
    905 kernels/s2p_kernel.cpp
    906 kernels/pipeline.h
    907 kernels/deletion.h
    908 kernels/deletion.cpp
    909 kernels/streamset.h
    910 kernels/s2p_kernel.h
    911 kernels/scanmatchgen.h
    912 kernels/lane_pipeline.cpp
    913 kernels/lane_pipeline.h
    914 kernels/lane_s2p_kernel.cpp
    915 kernels/lane_s2p_kernel.h
    916 lanes.cpp
    917 kernels/instance.cpp
    918 casefold.cpp
    919 cc/cc_compiler.cpp
    920 cc/cc_compiler.h
    921 IDISA/idisa_avx_builder.cpp
    922 IDISA/idisa_avx_builder.h
    923 IDISA/idisa_builder.cpp
    924 IDISA/idisa_builder.h
    925 IDISA/idisa_i64_builder.cpp
    926 IDISA/idisa_i64_builder.h
    927 IDISA/idisa_sse_builder.cpp
    928 IDISA/idisa_sse_builder.h
    929 IDISA/idisa_target.cpp
    930 IDISA/idisa_target.h
    931 kernels/casefold_pipeline.cpp
    932 kernels/casefold_pipeline.h
    933 kernels/deletion.cpp
    934 kernels/deletion.h
    935 kernels/instance.cpp
    936 kernels/instance.h
    937 kernels/kernel.cpp
    938 kernels/kernel.h
    939 kernels/p2s_kernel.cpp
    940 kernels/p2s_kernel.h
    941 kernels/pipeline.cpp
    942 kernels/pipeline.h
    943 kernels/s2p_kernel.cpp
    944 kernels/s2p_kernel.h
    945 kernels/scanmatchgen.cpp
    946 kernels/scanmatchgen.h
    947 kernels/stdout_kernel.cpp
    948 kernels/stdout_kernel.h
    949 kernels/streamset.h
    950 kernels/symboltablepipeline.cpp
    951 kernels/symboltablepipeline.h
    952 kernels/u8u16_pipeline.cpp
    953 kernels/u8u16_pipeline.h
    954 pablo/analysis/pabloverifier.cpp
    955 pablo/analysis/pabloverifier.hpp
    956 pablo/optimizers/booleanreassociationpass.cpp
    957 pablo/optimizers/booleanreassociationpass.h
    958 pablo/optimizers/codemotionpass.cpp
    959 pablo/optimizers/codemotionpass.h
    960 pablo/optimizers/distributivepass.cpp
    961 pablo/optimizers/distributivepass.h
    962 pablo/optimizers/graph-facade.hpp
    963 pablo/optimizers/pablo_automultiplexing.cpp
    964 pablo/optimizers/pablo_automultiplexing.hpp
    965 pablo/optimizers/pablo_bddminimization.cpp
    966 pablo/optimizers/pablo_bddminimization.h
    967 pablo/optimizers/pablo_simplifier.cpp
    968 pablo/optimizers/pablo_simplifier.hpp
    969 pablo/optimizers/schedulingprepass.cpp
    970 pablo/optimizers/schedulingprepass.h
    971 pablo/passes/factorizedfg.cpp
    972 pablo/passes/factorizedfg.h
    973 pablo/passes/flattenassociativedfg.cpp
    974 pablo/passes/flattenassociativedfg.h
    975 pablo/builder.cpp
    976 pablo/builder.hpp
    977 pablo/carry_data.cpp
    978 pablo/carry_data.h
    979 pablo/carry_manager.cpp
    980 pablo/carry_manager.h
    981 pablo/codegenstate.cpp
    982 pablo/codegenstate.h
    983 pablo/expression_map.hpp
    984 pablo/function.cpp
    985 pablo/function.h
    986 pablo/pablo_compiler.cpp
    987 pablo/pablo_compiler.h
    988 pablo/pablo_toolchain.cpp
    989 pablo/pablo_toolchain.h
    990 pablo/pabloAST.cpp
    991 pablo/pabloAST.h
    992 pablo/pe_advance.h
    993 pablo/pe_and.h
    994 pablo/pe_call.h
    995 pablo/pe_count.h
    996 pablo/pe_integer.h
    997 pablo/pe_lookahead.h
    998 pablo/pe_matchstar.h
    999 pablo/pe_next.h
    1000 pablo/pe_not.h
    1001 pablo/pe_ones.h
    1002 pablo/pe_or.h
    1003 pablo/pe_scanthru.h
    1004 pablo/pe_sel.h
    1005 pablo/pe_setithbit.h
    1006 pablo/pe_string.h
    1007 pablo/pe_var.h
    1008 pablo/pe_xor.h
    1009 pablo/pe_zeroes.h
    1010 pablo/printer_pablos.cpp
    1011 pablo/printer_pablos.h
    1012 pablo/ps_assign.h
    1013 pablo/ps_if.cpp
    1014 pablo/ps_if.h
    1015 pablo/ps_while.cpp
    1016 pablo/ps_while.h
    1017 pablo/symbol_generator.cpp
    1018 pablo/symbol_generator.h
    1019 re/parsefailure.cpp
    1020 re/parsefailure.h
    1021 re/printer_re.cpp
    1022 re/printer_re.h
    1023 re/re_alt.h
    1024 re/re_analysis.cpp
    1025 re/re_analysis.h
    1026 re/re_any.h
    1027 re/re_assertion.h
    1028 re/re_cc.cpp
    1029 re/re_cc.h
    1030 re/re_compiler.cpp
    1031 re/re_compiler.h
    1032 re/re_diff.cpp
    1033 re/re_diff.h
    1034 re/re_end.h
    1035 re/re_grapheme_boundary.hpp
    1036 re/re_intersect.cpp
    1037 re/re_intersect.h
    1038 re/re_memoizer.hpp
    1039 re/re_name.h
    1040 re/re_nullable.cpp
    1041 re/re_nullable.h
    1042 re/re_parser.cpp
    1043 re/re_parser.h
    1044 re/re_re.cpp
    1045 re/re_re.h
    1046 re/re_rep.cpp
    1047 re/re_rep.h
    1048 re/re_seq.h
    1049 re/re_simplifier.cpp
    1050 re/re_simplifier.h
    1051 re/re_start.h
    1052 re/re_toolchain.cpp
    1053 re/re_toolchain.h
    1054 UCD/Blocks.h
    1055 UCD/CaseFolding_txt.cpp
    1056 UCD/CaseFolding_txt.h
    1057 UCD/DerivedAge.h
    1058 UCD/DerivedBidiClass.h
    1059 UCD/DerivedBinaryProperties.h
    1060 UCD/DerivedCombiningClass.h
    1061 UCD/DerivedCoreProperties.h
    1062 UCD/DerivedDecompositionType.h
    1063 UCD/DerivedGeneralCategory.h
    1064 UCD/DerivedJoiningGroup.h
    1065 UCD/DerivedJoiningType.h
    1066 UCD/DerivedNumericType.h
    1067 UCD/EastAsianWidth.h
    1068 UCD/GraphemeBreakProperty.h
    1069 UCD/HangulSyllableType.h
    1070 UCD/LineBreak.h
    1071 UCD/PropertyAliases.h
    1072 UCD/PropertyObjects.cpp
    1073 UCD/PropertyObjects.h
    1074 UCD/PropertyObjectTable.h
    1075 UCD/PropertyValueAliases.h
    1076 UCD/PropList.h
    1077 UCD/resolve_properties.cpp
    1078 UCD/resolve_properties.h
    1079 UCD/ScriptExtensions.h
    1080 UCD/Scripts.h
    1081 UCD/SentenceBreakProperty.h
    1082 UCD/ucd_compiler.cpp
    1083 UCD/ucd_compiler.hpp
    1084 UCD/unicode_set.cpp
    1085 UCD/unicode_set.h
    1086 UCD/UnicodeNameData.cpp
    1087 UCD/UnicodeNameData.h
    1088 UCD/WordBreakProperty.h
    1089 util/ispc.cpp
    1090 util/papi_helper.hpp
    1091 util/slab_allocator.h
    1092 casefold.cpp
    1093 grep_engine.cpp
    1094 grep_engine.h
    1095 hrtime.h
    1096 icgrep.cpp
    1097 object_cache.cpp
    1098 object_cache.h
    1099 symboltable.cpp
    1100 toolchain.cpp
    1101 toolchain.h
    1102 u8u16.cpp
    1103 utf8_encoder.cpp
    1104 utf8_encoder.h
    1105 utf_encoding.h
    1106 cc/cc_compiler.cpp
    1107 cc/cc_compiler.h
    1108 IDISA/idisa_avx_builder.cpp
    1109 IDISA/idisa_avx_builder.h
    1110 IDISA/idisa_builder.cpp
    1111 IDISA/idisa_builder.h
    1112 IDISA/idisa_i64_builder.cpp
    1113 IDISA/idisa_i64_builder.h
    1114 IDISA/idisa_sse_builder.cpp
    1115 IDISA/idisa_sse_builder.h
    1116 IDISA/idisa_target.cpp
    1117 IDISA/idisa_target.h
    1118 kernels/casefold_pipeline.cpp
    1119 kernels/casefold_pipeline.h
    1120 kernels/deletion.cpp
    1121 kernels/deletion.h
    1122 kernels/instance.cpp
    1123 kernels/instance.h
    1124 kernels/kernel.cpp
    1125 kernels/kernel.h
    1126 kernels/p2s_kernel.cpp
    1127 kernels/p2s_kernel.h
    1128 kernels/pipeline.cpp
    1129 kernels/pipeline.h
    1130 kernels/s2p_kernel.cpp
    1131 kernels/s2p_kernel.h
    1132 kernels/scanmatchgen.cpp
    1133 kernels/scanmatchgen.h
    1134 kernels/stdout_kernel.cpp
    1135 kernels/stdout_kernel.h
    1136 kernels/streamset.h
    1137 kernels/symboltablepipeline.cpp
    1138 kernels/symboltablepipeline.h
    1139 kernels/u8u16_pipeline.cpp
    1140 kernels/u8u16_pipeline.h
    1141 pablo/analysis/pabloverifier.cpp
    1142 pablo/analysis/pabloverifier.hpp
    1143 pablo/optimizers/booleanreassociationpass.cpp
    1144 pablo/optimizers/booleanreassociationpass.h
    1145 pablo/optimizers/codemotionpass.cpp
    1146 pablo/optimizers/codemotionpass.h
    1147 pablo/optimizers/distributivepass.cpp
    1148 pablo/optimizers/distributivepass.h
    1149 pablo/optimizers/graph-facade.hpp
    1150 pablo/optimizers/pablo_automultiplexing.cpp
    1151 pablo/optimizers/pablo_automultiplexing.hpp
    1152 pablo/optimizers/pablo_bddminimization.cpp
    1153 pablo/optimizers/pablo_bddminimization.h
    1154 pablo/optimizers/pablo_simplifier.cpp
    1155 pablo/optimizers/pablo_simplifier.hpp
    1156 pablo/optimizers/schedulingprepass.cpp
    1157 pablo/optimizers/schedulingprepass.h
    1158 pablo/passes/factorizedfg.cpp
    1159 pablo/passes/factorizedfg.h
    1160 pablo/passes/flattenassociativedfg.cpp
    1161 pablo/passes/flattenassociativedfg.h
    1162 pablo/builder.cpp
    1163 pablo/builder.hpp
    1164 pablo/carry_data.cpp
    1165 pablo/carry_data.h
    1166 pablo/carry_manager.cpp
    1167 pablo/carry_manager.h
    1168 pablo/codegenstate.cpp
    1169 pablo/codegenstate.h
    1170 pablo/expression_map.hpp
    1171 pablo/function.cpp
    1172 pablo/function.h
    1173 pablo/pablo_compiler.cpp
    1174 pablo/pablo_compiler.h
    1175 pablo/pablo_toolchain.cpp
    1176 pablo/pablo_toolchain.h
    1177 pablo/pabloAST.cpp
    1178 pablo/pabloAST.h
    1179 pablo/pe_advance.h
    1180 pablo/pe_and.h
    1181 pablo/pe_call.h
    1182 pablo/pe_count.h
    1183 pablo/pe_infile.h
    1184 pablo/pe_integer.h
    1185 pablo/pe_lookahead.h
    1186 pablo/pe_matchstar.h
    1187 pablo/pe_next.h
    1188 pablo/pe_not.h
    1189 pablo/pe_ones.h
    1190 pablo/pe_or.h
    1191 pablo/pe_scanthru.h
    1192 pablo/pe_sel.h
    1193 pablo/pe_setithbit.h
    1194 pablo/pe_string.h
    1195 pablo/pe_var.h
    1196 pablo/pe_xor.h
    1197 pablo/pe_zeroes.h
    1198 pablo/printer_pablos.cpp
    1199 pablo/printer_pablos.h
    1200 pablo/ps_assign.h
    1201 pablo/ps_if.cpp
    1202 pablo/ps_if.h
    1203 pablo/ps_while.cpp
    1204 pablo/ps_while.h
    1205 pablo/symbol_generator.cpp
    1206 pablo/symbol_generator.h
    1207 re/parsefailure.cpp
    1208 re/parsefailure.h
    1209 re/printer_re.cpp
    1210 re/printer_re.h
    1211 re/re_alt.h
    1212 re/re_analysis.cpp
    1213 re/re_analysis.h
    1214 re/re_any.h
    1215 re/re_assertion.h
    1216 re/re_cc.cpp
    1217 re/re_cc.h
    1218 re/re_compiler.cpp
    1219 re/re_compiler.h
    1220 re/re_diff.cpp
    1221 re/re_diff.h
    1222 re/re_end.h
    1223 re/re_grapheme_boundary.hpp
    1224 re/re_intersect.cpp
    1225 re/re_intersect.h
    1226 re/re_memoizer.hpp
    1227 re/re_name.h
    1228 re/re_nullable.cpp
    1229 re/re_nullable.h
    1230 re/re_parser.cpp
    1231 re/re_parser.h
    1232 re/re_re.cpp
    1233 re/re_re.h
    1234 re/re_rep.cpp
    1235 re/re_rep.h
    1236 re/re_seq.h
    1237 re/re_simplifier.cpp
    1238 re/re_simplifier.h
    1239 re/re_start.h
    1240 re/re_toolchain.cpp
    1241 re/re_toolchain.h
    1242 UCD/Blocks.h
    1243 UCD/CaseFolding_txt.cpp
    1244 UCD/CaseFolding_txt.h
    1245 UCD/DerivedAge.h
    1246 UCD/DerivedBidiClass.h
    1247 UCD/DerivedBinaryProperties.h
    1248 UCD/DerivedCombiningClass.h
    1249 UCD/DerivedCoreProperties.h
    1250 UCD/DerivedDecompositionType.h
    1251 UCD/DerivedGeneralCategory.h
    1252 UCD/DerivedJoiningGroup.h
    1253 UCD/DerivedJoiningType.h
    1254 UCD/DerivedNumericType.h
    1255 UCD/EastAsianWidth.h
    1256 UCD/GraphemeBreakProperty.h
    1257 UCD/HangulSyllableType.h
    1258 UCD/LineBreak.h
    1259 UCD/PropertyAliases.h
    1260 UCD/PropertyObjects.cpp
    1261 UCD/PropertyObjects.h
    1262 UCD/PropertyObjectTable.h
    1263 UCD/PropertyValueAliases.h
    1264 UCD/PropList.h
    1265 UCD/resolve_properties.cpp
    1266 UCD/resolve_properties.h
    1267 UCD/ScriptExtensions.h
    1268 UCD/Scripts.h
    1269 UCD/SentenceBreakProperty.h
    1270 UCD/ucd_compiler.cpp
    1271 UCD/ucd_compiler.hpp
    1272 UCD/unicode_set.cpp
    1273 UCD/unicode_set.h
    1274 UCD/UnicodeNameData.cpp
    1275 UCD/UnicodeNameData.h
    1276 UCD/WordBreakProperty.h
    1277 util/ispc.cpp
    1278 util/papi_helper.hpp
    1279 util/slab_allocator.h
    1280 casefold.cpp
    1281 generate_predefined_ucd_functions.cpp
    1282 grep_engine.cpp
    1283 grep_engine.h
    1284 hrtime.h
    1285 icgrep.cpp
    1286 object_cache.cpp
    1287 object_cache.h
    1288 symboltable.cpp
    1289 toolchain.cpp
    1290 toolchain.h
    1291 u8u16.cpp
    1292 utf8_encoder.cpp
    1293 utf8_encoder.h
    1294 utf_encoding.h
    1295 wc.cpp
    1296 util/ispc.h
    1297 pablo/builder.cpp
    1298 pablo/builder.hpp
    1299 pablo/carry_data.cpp
    1300 pablo/carry_data.h
    1301 pablo/carry_manager.cpp
    1302 pablo/carry_manager.h
    1303 pablo/codegenstate.cpp
    1304 pablo/codegenstate.h
    1305 pablo/expression_map.hpp
    1306 pablo/function.cpp
    1307 pablo/function.h
    1308 pablo/pabloAST.cpp
    1309 pablo/pabloAST.h
    1310 pablo/pablo_compiler.cpp
    1311 pablo/pablo_compiler.h
    1312 pablo/pablo_kernel.cpp
    1313 pablo/pablo_kernel.h
    1314 pablo/pablo_toolchain.cpp
    1315 pablo/pablo_toolchain.h
    1316 pablo/pe_advance.h
    1317 pablo/pe_and.h
    1318 pablo/pe_call.h
    1319 pablo/pe_count.h
    1320 pablo/pe_infile.h
    1321 pablo/pe_integer.h
    1322 pablo/pe_lookahead.h
    1323 pablo/pe_matchstar.h
    1324 pablo/pe_next.h
    1325 pablo/pe_not.h
    1326 pablo/pe_ones.h
    1327 pablo/pe_or.h
    1328 pablo/pe_scanthru.h
    1329 pablo/pe_sel.h
    1330 pablo/pe_setithbit.h
    1331 pablo/pe_string.h
    1332 pablo/pe_var.h
    1333 pablo/pe_xor.h
    1334 pablo/pe_zeroes.h
    1335 pablo/printer_pablos.cpp
    1336 pablo/printer_pablos.h
    1337 pablo/ps_assign.h
    1338 pablo/ps_if.cpp
    1339 pablo/ps_if.h
    1340 pablo/ps_while.cpp
    1341 pablo/ps_while.h
    1342 pablo/symbol_generator.cpp
    1343 pablo/symbol_generator.h
    1344 cc/cc_compiler.cpp
    1345 cc/cc_compiler.h
    1346 IDISA/idisa_avx_builder.cpp
    1347 IDISA/idisa_avx_builder.h
    1348 IDISA/idisa_builder.cpp
    1349 IDISA/idisa_builder.h
    1350 IDISA/idisa_i64_builder.cpp
    1351 IDISA/idisa_i64_builder.h
    1352 IDISA/idisa_sse_builder.cpp
    1353 IDISA/idisa_sse_builder.h
    1354 IDISA/idisa_target.cpp
    1355 IDISA/idisa_target.h
    1356 kernels/deletion.cpp
    1357 kernels/deletion.h
    1358 kernels/interface.cpp
    1359 kernels/interface.h
    1360 kernels/kernel.cpp
    1361 kernels/kernel.h
    1362 kernels/p2s_kernel.cpp
    1363 kernels/p2s_kernel.h
    1364 kernels/pipeline.cpp
    1365 kernels/pipeline.h
    1366 kernels/s2p_kernel.cpp
    1367 kernels/s2p_kernel.h
    1368 kernels/scanmatchgen.cpp
    1369 kernels/scanmatchgen.h
    1370 kernels/stdout_kernel.cpp
    1371 kernels/stdout_kernel.h
    1372 kernels/streamset.cpp
    1373 kernels/streamset.h
    1374 kernels/symboltablepipeline.cpp
    1375 kernels/symboltablepipeline.h
    1376 pablo/analysis/pabloverifier.cpp
    1377 pablo/analysis/pabloverifier.hpp
    1378 pablo/optimizers/booleanreassociationpass.cpp
    1379 pablo/optimizers/booleanreassociationpass.h
    1380 pablo/optimizers/codemotionpass.cpp
    1381 pablo/optimizers/codemotionpass.h
    1382 pablo/optimizers/distributivepass.cpp
    1383 pablo/optimizers/distributivepass.h
    1384 pablo/optimizers/graph-facade.hpp
    1385 pablo/optimizers/pablo_automultiplexing.cpp
    1386 pablo/optimizers/pablo_automultiplexing.hpp
    1387 pablo/optimizers/pablo_bddminimization.cpp
    1388 pablo/optimizers/pablo_bddminimization.h
    1389 pablo/optimizers/pablo_simplifier.cpp
    1390 pablo/optimizers/pablo_simplifier.hpp
    1391 pablo/optimizers/schedulingprepass.cpp
    1392 pablo/optimizers/schedulingprepass.h
    1393 pablo/passes/factorizedfg.cpp
    1394 pablo/passes/factorizedfg.h
    1395 pablo/passes/flattenassociativedfg.cpp
    1396 pablo/passes/flattenassociativedfg.h
    1397 pablo/passes/flattenif.cpp
    1398 pablo/passes/flattenif.hpp
    1399 pablo/builder.cpp
    1400 pablo/builder.hpp
    1401 pablo/carry_data.cpp
    1402 pablo/carry_data.h
    1403 pablo/carry_manager.cpp
    1404 pablo/carry_manager.h
    1405 pablo/codegenstate.cpp
    1406 pablo/codegenstate.h
    1407 pablo/expression_map.hpp
    1408 pablo/function.cpp
    1409 pablo/function.h
    1410 pablo/pablo_compiler.cpp
    1411 pablo/pablo_compiler.h
    1412 pablo/pablo_kernel.cpp
    1413 pablo/pablo_kernel.h
    1414 pablo/pablo_toolchain.cpp
    1415 pablo/pablo_toolchain.h
    1416 pablo/pabloAST.cpp
    1417 pablo/pabloAST.h
    1418 pablo/pe_advance.h
    1419 pablo/pe_and.h
    1420 pablo/pe_call.h
    1421 pablo/pe_count.h
    1422 pablo/pe_infile.h
    1423 pablo/pe_integer.h
    1424 pablo/pe_lookahead.h
    1425 pablo/pe_matchstar.h
    1426 pablo/pe_next.h
    1427 pablo/pe_not.h
    1428 pablo/pe_ones.h
    1429 pablo/pe_or.h
    1430 pablo/pe_scanthru.h
    1431 pablo/pe_sel.h
    1432 pablo/pe_setithbit.h
    1433 pablo/pe_string.h
    1434 pablo/pe_var.h
    1435 pablo/pe_xor.h
    1436 pablo/pe_zeroes.h
    1437 pablo/printer_pablos.cpp
    1438 pablo/printer_pablos.h
    1439 pablo/ps_assign.h
    1440 pablo/ps_if.cpp
    1441 pablo/ps_if.h
    1442 pablo/ps_while.cpp
    1443 pablo/ps_while.h
    1444 pablo/symbol_generator.cpp
    1445 pablo/symbol_generator.h
    1446 re/parsefailure.cpp
    1447 re/parsefailure.h
    1448 re/printer_re.cpp
    1449 re/printer_re.h
    1450 re/re_alt.h
    1451 re/re_analysis.cpp
    1452 re/re_analysis.h
    1453 re/re_any.h
    1454 re/re_assertion.h
    1455 re/re_cc.cpp
    1456 re/re_cc.h
    1457 re/re_compiler.cpp
    1458 re/re_compiler.h
    1459 re/re_diff.cpp
    1460 re/re_diff.h
    1461 re/re_end.h
    1462 re/re_intersect.cpp
    1463 re/re_intersect.h
    1464 re/re_memoizer.hpp
    1465 re/re_name.h
    1466 re/re_name_resolve.cpp
    1467 re/re_name_resolve.h
    1468 re/re_nullable.cpp
    1469 re/re_nullable.h
    1470 re/re_parser.cpp
    1471 re/re_parser.h
    1472 re/re_re.cpp
    1473 re/re_re.h
    1474 re/re_rep.cpp
    1475 re/re_rep.h
    1476 re/re_seq.h
    1477 re/re_simplifier.cpp
    1478 re/re_simplifier.h
    1479 re/re_start.h
    1480 re/re_toolchain.cpp
    1481 re/re_toolchain.h
    1482 UCD/Blocks.h
    1483 UCD/CaseFolding_txt.cpp
    1484 UCD/CaseFolding_txt.h
    1485 UCD/DerivedAge.h
    1486 UCD/DerivedBidiClass.h
    1487 UCD/DerivedBinaryProperties.h
    1488 UCD/DerivedCombiningClass.h
    1489 UCD/DerivedCoreProperties.h
    1490 UCD/DerivedDecompositionType.h
    1491 UCD/DerivedGeneralCategory.h
    1492 UCD/DerivedJoiningGroup.h
    1493 UCD/DerivedJoiningType.h
    1494 UCD/DerivedNumericType.h
    1495 UCD/EastAsianWidth.h
    1496 UCD/GraphemeBreakProperty.h
    1497 UCD/HangulSyllableType.h
    1498 UCD/LineBreak.h
    1499 UCD/PropertyAliases.h
    1500 UCD/PropertyObjects.cpp
    1501 UCD/PropertyObjects.h
    1502 UCD/PropertyObjectTable.h
    1503 UCD/PropertyValueAliases.h
    1504 UCD/PropList.h
    1505 UCD/resolve_properties.cpp
    1506 UCD/resolve_properties.h
    1507 UCD/ScriptExtensions.h
    1508 UCD/Scripts.h
    1509 UCD/SentenceBreakProperty.h
    1510 UCD/ucd_compiler.cpp
    1511 UCD/ucd_compiler.hpp
    1512 UCD/unicode_set.cpp
    1513 UCD/unicode_set.h
    1514 UCD/UnicodeNameData.cpp
    1515 UCD/UnicodeNameData.h
    1516 UCD/WordBreakProperty.h
    1517 util/papi_helper.hpp
    1518 util/slab_allocator.h
    1519 grep_engine.cpp
    1520 grep_engine.h
    1521 hrtime.h
    1522 icgrep.cpp
    1523 object_cache.cpp
    1524 object_cache.h
    1525 symboltable.cpp
    1526 toolchain.cpp
    1527 toolchain.h
    1528 u8u16.cpp
    1529 utf16_encoder.cpp
    1530 utf16_encoder.h
    1531 utf8_encoder.cpp
    1532 utf8_encoder.h
    1533 utf_encoding.h
    1534 wc.cpp
    1535 pablo/optimizers/maxsat.hpp
    1536 cc/cc_compiler.cpp
    1537 cc/cc_compiler.h
     37icgrep.h
    153838IDISA/CudaDriver.h
    153939IDISA/idisa_avx_builder.cpp
     
    155050IDISA/idisa_target.h
    155151IDISA/llvm2ptx.h
     52include/simd-lib/bitblock128.hpp
     53include/simd-lib/bitblock256.hpp
     54include/simd-lib/bitblock.hpp
     55include/simd-lib/bitblock_iterator.hpp
     56include/simd-lib/buffer.hpp
     57include/simd-lib/builtins.hpp
     58include/simd-lib/carryQ.hpp
     59include/simd-lib/config.hpp
     60include/simd-lib/idisa128.hpp
     61include/simd-lib/idisa256.hpp
     62include/simd-lib/idisa_cpp/idisa_avx2.cpp
     63include/simd-lib/idisa_cpp/idisa_sse2.cpp
     64include/simd-lib/idisa.hpp
     65include/simd-lib/pabloSupport.hpp
     66include/simd-lib/s2p.hpp
     67include/simd-lib/transpose.hpp
     68ispc.cpp
     69kernels/casefold_pipeline.cpp
     70kernels/casefold_pipeline.h
     71kernels/cc_kernel.cpp
     72kernels/cc_kernel.h
    155273kernels/deletion.cpp
    155374kernels/deletion.h
     75kernels/instance.cpp
     76kernels/instance.h
    155477kernels/interface.cpp
    155578kernels/interface.h
    155679kernels/kernel.cpp
    155780kernels/kernel.h
     81kernels/lane_pipeline.cpp
     82kernels/lane_pipeline.h
     83kernels/lane_s2p_kernel.cpp
     84kernels/lane_s2p_kernel.h
     85kernels/lookaheadextractor.cpp
     86kernels/lookaheadextractor.h
    155887kernels/p2s_kernel.cpp
    155988kernels/p2s_kernel.h
    156089kernels/pipeline.cpp
    156190kernels/pipeline.h
     91kernels/s2p_gen.cpp
     92kernels/s2p_gen.h
    156293kernels/s2p_kernel.cpp
    156394kernels/s2p_kernel.h
     
    1570101kernels/symboltablepipeline.cpp
    1571102kernels/symboltablepipeline.h
     103kernels/u8u16_pipeline.cpp
     104kernels/u8u16_pipeline.h
     105lanes.cpp
     106object_cache.cpp
     107object_cache.h
    1572108pablo/analysis/pabloverifier.cpp
    1573109pablo/analysis/pabloverifier.hpp
     110pablo/analysis/useanalysis.cpp
     111pablo/analysis/useanalysis.h
     112pablo/branch.cpp
     113pablo/branch.h
     114pablo/builder.cpp
     115pablo/builder.hpp
     116pablo/carry_data.cpp
     117pablo/carry_data.h
     118pablo/carry_manager.cpp
     119pablo/carry_manager.h
     120pablo/codegenstate.cpp
     121pablo/codegenstate.h
     122pablo/expression_map.hpp
     123pablo/function.cpp
     124pablo/function.h
    1574125pablo/optimizers/booleanreassociationpass.cpp
    1575126pablo/optimizers/booleanreassociationpass.h
     
    1584135pablo/optimizers/pablo_bddminimization.cpp
    1585136pablo/optimizers/pablo_bddminimization.h
     137pablo/optimizers/pablo_codesinking.cpp
     138pablo/optimizers/pablo_codesinking.hpp
    1586139pablo/optimizers/pablo_simplifier.cpp
    1587140pablo/optimizers/pablo_simplifier.hpp
    1588141pablo/optimizers/schedulingprepass.cpp
    1589142pablo/optimizers/schedulingprepass.h
     143pablo/pabloAST.cpp
     144pablo/pabloAST.h
     145pablo/pablo_compiler.cpp
     146pablo/pablo_compiler.h
     147pablo/pablo_kernel.cpp
     148pablo/pablo_kernel.h
     149pablo/pablo_routines.cpp
     150pablo/pablo_routines.h
     151pablo/pablo_toolchain.cpp
     152pablo/pablo_toolchain.h
    1590153pablo/passes/factorizedfg.cpp
    1591154pablo/passes/factorizedfg.h
     
    1594157pablo/passes/flattenif.cpp
    1595158pablo/passes/flattenif.hpp
    1596 pablo/builder.cpp
    1597 pablo/builder.hpp
    1598 pablo/carry_data.cpp
    1599 pablo/carry_data.h
    1600 pablo/carry_manager.cpp
    1601 pablo/carry_manager.h
    1602 pablo/codegenstate.cpp
    1603 pablo/codegenstate.h
    1604 pablo/expression_map.hpp
    1605 pablo/function.cpp
    1606 pablo/function.h
    1607 pablo/pablo_compiler.cpp
    1608 pablo/pablo_compiler.h
    1609 pablo/pablo_kernel.cpp
    1610 pablo/pablo_kernel.h
    1611 pablo/pablo_toolchain.cpp
    1612 pablo/pablo_toolchain.h
    1613 pablo/pabloAST.cpp
    1614 pablo/pabloAST.h
     159pablo/pbix_compiler.cpp
     160pablo/pbix_compiler.h
     161pablo/pe_advance.cpp
    1615162pablo/pe_advance.h
     163pablo/pe_all.cpp
     164pablo/pe_all.h
     165pablo/pe_and.cpp
    1616166pablo/pe_and.h
     167pablo/pe_call.cpp
    1617168pablo/pe_call.h
     169pablo/pe_charclass.cpp
     170pablo/pe_charclass.h
     171pablo/pe_constant.h
    1618172pablo/pe_count.h
    1619173pablo/pe_infile.h
    1620174pablo/pe_integer.h
    1621175pablo/pe_lookahead.h
     176pablo/pe_matchstar.cpp
    1622177pablo/pe_matchstar.h
     178pablo/pe_metadata.h
    1623179pablo/pe_next.h
     180pablo/pe_not.cpp
    1624181pablo/pe_not.h
    1625182pablo/pe_ones.h
     183pablo/pe_or.cpp
    1626184pablo/pe_or.h
     185pablo/pe_scanthru.cpp
    1627186pablo/pe_scanthru.h
     187pablo/pe_sel.cpp
    1628188pablo/pe_sel.h
    1629189pablo/pe_setithbit.h
    1630190pablo/pe_string.h
    1631191pablo/pe_var.h
     192pablo/pe_xor.cpp
    1632193pablo/pe_xor.h
    1633194pablo/pe_zeroes.h
     
    1637198pablo/ps_if.cpp
    1638199pablo/ps_if.h
     200pablo/ps_pablos.cpp
     201pablo/ps_pablos.h
    1639202pablo/ps_while.cpp
    1640203pablo/ps_while.h
    1641204pablo/symbol_generator.cpp
    1642205pablo/symbol_generator.h
     206pablo/symbol-table/length_group_generator.cpp
     207pablo/symbol-table/length_group_generator.h
     208pablo/type.cpp
     209pablo/type.h
     210pablo/type/streamtype.cpp
     211pablo/type/streamtype.h
     212papi_helper.hpp
    1643213re/parsefailure.cpp
    1644214re/parsefailure.h
     215re_parser.cpp
     216re_parser.h
    1645217re/printer_re.cpp
    1646218re/printer_re.h
     219re/re_alt.cpp
    1647220re/re_alt.h
    1648221re/re_analysis.cpp
     
    1654227re/re_compiler.cpp
    1655228re/re_compiler.h
     229re_re.cpp
    1656230re/re_diff.cpp
    1657231re/re_diff.h
     232re_reducer.cpp
     233re_reducer.h
     234re/re_end.cpp
    1658235re/re_end.h
     236re/re_grapheme_boundary.hpp
     237re_re.h
    1659238re/re_intersect.cpp
    1660239re/re_intersect.h
    1661240re/re_memoizer.hpp
     241re/re_name.cpp
    1662242re/re_name.h
    1663243re/re_name_resolve.cpp
     
    1667247re/re_parser.cpp
    1668248re/re_parser.h
     249re_rep.cpp
     250re_rep.h
    1669251re/re_re.cpp
     252re/re_reducer.cpp
     253re/re_reducer.h
    1670254re/re_re.h
    1671255re/re_rep.cpp
    1672256re/re_rep.h
     257re/re_seq.cpp
    1673258re/re_seq.h
    1674259re/re_simplifier.cpp
    1675260re/re_simplifier.h
     261re/re_start.cpp
    1676262re/re_start.h
    1677263re/re_toolchain.cpp
    1678264re/re_toolchain.h
    1679 UCD/Blocks.h
    1680 UCD/CaseFolding_txt.cpp
    1681 UCD/CaseFolding_txt.h
    1682 UCD/DerivedAge.h
    1683 UCD/DerivedBidiClass.h
    1684 UCD/DerivedBinaryProperties.h
    1685 UCD/DerivedCombiningClass.h
    1686 UCD/DerivedCoreProperties.h
    1687 UCD/DerivedDecompositionType.h
    1688 UCD/DerivedGeneralCategory.h
    1689 UCD/DerivedJoiningGroup.h
    1690 UCD/DerivedJoiningType.h
    1691 UCD/DerivedNumericType.h
    1692 UCD/EastAsianWidth.h
    1693 UCD/GraphemeBreakProperty.h
    1694 UCD/HangulSyllableType.h
    1695 UCD/LineBreak.h
    1696 UCD/PropertyAliases.h
    1697 UCD/PropertyObjects.cpp
    1698 UCD/PropertyObjects.h
    1699 UCD/PropertyObjectTable.h
    1700 UCD/PropertyValueAliases.h
    1701 UCD/PropList.h
    1702 UCD/resolve_properties.cpp
    1703 UCD/resolve_properties.h
    1704 UCD/ScriptExtensions.h
    1705 UCD/Scripts.h
    1706 UCD/SentenceBreakProperty.h
    1707 UCD/ucd_compiler.cpp
    1708 UCD/ucd_compiler.hpp
    1709 UCD/unicode_set.cpp
    1710 UCD/unicode_set.h
    1711 UCD/UnicodeNameData.cpp
    1712 UCD/UnicodeNameData.h
    1713 UCD/WordBreakProperty.h
    1714 util/papi_helper.hpp
    1715 util/slab_allocator.h
    1716 generate_predefined_ucd_functions.cpp
    1717 grep_engine.cpp
    1718 grep_engine.h
    1719 hrtime.h
    1720 icgrep.cpp
    1721 object_cache.cpp
    1722 object_cache.h
     265re_seq.cpp
     266re_seq.h
     267re_simplifier.cpp
     268re_simplifier.h
     269resolve_properties.cpp
     270re_start.cpp
     271re_start.h
     272re/symbol_generator.cpp
     273re/symbol_generator.h
     274slab_allocator.h
     275symbol_generator.cpp
     276symbol_generator.h
    1723277symboltable.cpp
    1724278toolchain.cpp
    1725279toolchain.h
    1726280u8u16.cpp
    1727 utf16_encoder.cpp
    1728 utf16_encoder.h
    1729 utf8_encoder.cpp
    1730 utf8_encoder.h
    1731 utf_encoding.h
    1732 wc.cpp
    1733 grep_engine.cpp
    1734 grep_engine.h
    1735 object_cache.cpp
    1736 object_cache.h
    1737 toolchain.cpp
    1738 toolchain.h
    1739 IDISA/CudaDriver.h
    1740 IDISA/idisa_avx_builder.cpp
    1741 IDISA/idisa_avx_builder.h
    1742 IDISA/idisa_builder.cpp
    1743 IDISA/idisa_builder.h
    1744 IDISA/idisa_i64_builder.cpp
    1745 IDISA/idisa_i64_builder.h
    1746 IDISA/idisa_nvptx_builder.cpp
    1747 IDISA/idisa_nvptx_builder.h
    1748 IDISA/idisa_sse_builder.cpp
    1749 IDISA/idisa_sse_builder.h
    1750 IDISA/idisa_target.cpp
    1751 IDISA/idisa_target.h
    1752 IDISA/llvm2ptx.h
    1753 kernels/deletion.cpp
    1754 kernels/deletion.h
    1755 kernels/interface.cpp
    1756 kernels/interface.h
    1757 kernels/kernel.cpp
    1758 kernels/kernel.h
    1759 kernels/p2s_kernel.cpp
    1760 kernels/p2s_kernel.h
    1761 kernels/pipeline.cpp
    1762 kernels/pipeline.h
    1763 kernels/s2p_kernel.cpp
    1764 kernels/s2p_kernel.h
    1765 kernels/scanmatchgen.cpp
    1766 kernels/scanmatchgen.h
    1767 kernels/stdout_kernel.cpp
    1768 kernels/stdout_kernel.h
    1769 kernels/streamset.cpp
    1770 kernels/streamset.h
    1771 kernels/symboltablepipeline.cpp
    1772 kernels/symboltablepipeline.h
    1773 pablo/analysis/pabloverifier.cpp
    1774 pablo/analysis/pabloverifier.hpp
    1775 pablo/optimizers/booleanreassociationpass.cpp
    1776 pablo/optimizers/booleanreassociationpass.h
    1777 pablo/optimizers/codemotionpass.cpp
    1778 pablo/optimizers/codemotionpass.h
    1779 pablo/optimizers/distributivepass.cpp
    1780 pablo/optimizers/distributivepass.h
    1781 pablo/optimizers/graph-facade.hpp
    1782 pablo/optimizers/maxsat.hpp
    1783 pablo/optimizers/pablo_automultiplexing.cpp
    1784 pablo/optimizers/pablo_automultiplexing.hpp
    1785 pablo/optimizers/pablo_bddminimization.cpp
    1786 pablo/optimizers/pablo_bddminimization.h
    1787 pablo/optimizers/pablo_simplifier.cpp
    1788 pablo/optimizers/pablo_simplifier.hpp
    1789 pablo/optimizers/schedulingprepass.cpp
    1790 pablo/optimizers/schedulingprepass.h
    1791 pablo/passes/factorizedfg.cpp
    1792 pablo/passes/factorizedfg.h
    1793 pablo/passes/flattenassociativedfg.cpp
    1794 pablo/passes/flattenassociativedfg.h
    1795 pablo/passes/flattenif.cpp
    1796 pablo/passes/flattenif.hpp
    1797 pablo/builder.cpp
    1798 pablo/builder.hpp
    1799 pablo/carry_data.cpp
    1800 pablo/carry_data.h
    1801 pablo/carry_manager.cpp
    1802 pablo/carry_manager.h
    1803 pablo/codegenstate.cpp
    1804 pablo/codegenstate.h
    1805 pablo/expression_map.hpp
    1806 pablo/function.cpp
    1807 pablo/function.h
    1808 pablo/pablo_compiler.cpp
    1809 pablo/pablo_compiler.h
    1810 pablo/pablo_kernel.cpp
    1811 pablo/pablo_kernel.h
    1812 pablo/pablo_toolchain.cpp
    1813 pablo/pablo_toolchain.h
    1814 pablo/pabloAST.cpp
    1815 pablo/pabloAST.h
    1816 pablo/pe_advance.h
    1817 pablo/pe_and.h
    1818 pablo/pe_call.h
    1819 pablo/pe_count.h
    1820 pablo/pe_infile.h
    1821 pablo/pe_integer.h
    1822 pablo/pe_lookahead.h
    1823 pablo/pe_matchstar.h
    1824 pablo/pe_next.h
    1825 pablo/pe_not.h
    1826 pablo/pe_ones.h
    1827 pablo/pe_or.h
    1828 pablo/pe_scanthru.h
    1829 pablo/pe_sel.h
    1830 pablo/pe_setithbit.h
    1831 pablo/pe_string.h
    1832 pablo/pe_var.h
    1833 pablo/pe_xor.h
    1834 pablo/pe_zeroes.h
    1835 pablo/printer_pablos.cpp
    1836 pablo/printer_pablos.h
    1837 pablo/ps_assign.h
    1838 pablo/ps_if.cpp
    1839 pablo/ps_if.h
    1840 pablo/ps_while.cpp
    1841 pablo/ps_while.h
    1842 pablo/symbol_generator.cpp
    1843 pablo/symbol_generator.h
    1844 util/papi_helper.hpp
    1845 util/slab_allocator.h
    1846 pablo/type.h
    1847 pablo/type.cpp
    1848 pablo/pablo_type.cpp
    1849 pablo/pablo_type.h
    1850 pablo/pe_constant.h
    1851 cc/cc_compiler.cpp
    1852 cc/cc_compiler.h
    1853 IDISA/CudaDriver.h
    1854 IDISA/idisa_avx_builder.cpp
    1855 IDISA/idisa_avx_builder.h
    1856 IDISA/idisa_builder.cpp
    1857 IDISA/idisa_builder.h
    1858 IDISA/idisa_i64_builder.cpp
    1859 IDISA/idisa_i64_builder.h
    1860 IDISA/idisa_nvptx_builder.cpp
    1861 IDISA/idisa_nvptx_builder.h
    1862 IDISA/idisa_sse_builder.cpp
    1863 IDISA/idisa_sse_builder.h
    1864 IDISA/idisa_target.cpp
    1865 IDISA/idisa_target.h
    1866 IDISA/llvm2ptx.h
    1867 kernels/cc_kernel.cpp
    1868 kernels/cc_kernel.h
    1869 kernels/deletion.cpp
    1870 kernels/deletion.h
    1871 kernels/interface.cpp
    1872 kernels/interface.h
    1873 kernels/kernel.cpp
    1874 kernels/kernel.h
    1875 kernels/p2s_kernel.cpp
    1876 kernels/p2s_kernel.h
    1877 kernels/pipeline.cpp
    1878 kernels/pipeline.h
    1879 kernels/s2p_kernel.cpp
    1880 kernels/s2p_kernel.h
    1881 kernels/scanmatchgen.cpp
    1882 kernels/scanmatchgen.h
    1883 kernels/stdout_kernel.cpp
    1884 kernels/stdout_kernel.h
    1885 kernels/streamset.cpp
    1886 kernels/streamset.h
    1887 kernels/symboltablepipeline.cpp
    1888 kernels/symboltablepipeline.h
    1889 pablo/analysis/pabloverifier.cpp
    1890 pablo/analysis/pabloverifier.hpp
    1891 pablo/optimizers/booleanreassociationpass.cpp
    1892 pablo/optimizers/booleanreassociationpass.h
    1893 pablo/optimizers/codemotionpass.cpp
    1894 pablo/optimizers/codemotionpass.h
    1895 pablo/optimizers/distributivepass.cpp
    1896 pablo/optimizers/distributivepass.h
    1897 pablo/optimizers/graph-facade.hpp
    1898 pablo/optimizers/maxsat.hpp
    1899 pablo/optimizers/pablo_automultiplexing.cpp
    1900 pablo/optimizers/pablo_automultiplexing.hpp
    1901 pablo/optimizers/pablo_bddminimization.cpp
    1902 pablo/optimizers/pablo_bddminimization.h
    1903 pablo/optimizers/pablo_simplifier.cpp
    1904 pablo/optimizers/pablo_simplifier.hpp
    1905 pablo/optimizers/schedulingprepass.cpp
    1906 pablo/optimizers/schedulingprepass.h
    1907 pablo/passes/factorizedfg.cpp
    1908 pablo/passes/factorizedfg.h
    1909 pablo/passes/flattenassociativedfg.cpp
    1910 pablo/passes/flattenassociativedfg.h
    1911 pablo/passes/flattenif.cpp
    1912 pablo/passes/flattenif.hpp
    1913 pablo/builder.cpp
    1914 pablo/builder.hpp
    1915 pablo/carry_data.cpp
    1916 pablo/carry_data.h
    1917 pablo/carry_manager.cpp
    1918 pablo/carry_manager.h
    1919 pablo/codegenstate.cpp
    1920 pablo/codegenstate.h
    1921 pablo/expression_map.hpp
    1922 pablo/function.cpp
    1923 pablo/function.h
    1924 pablo/pablo_compiler.cpp
    1925 pablo/pablo_compiler.h
    1926 pablo/pablo_kernel.cpp
    1927 pablo/pablo_kernel.h
    1928 pablo/pablo_toolchain.cpp
    1929 pablo/pablo_toolchain.h
    1930 pablo/pablo_type.cpp
    1931 pablo/pablo_type.h
    1932 pablo/pabloAST.cpp
    1933 pablo/pabloAST.h
    1934 pablo/pe_advance.h
    1935 pablo/pe_and.h
    1936 pablo/pe_call.h
    1937 pablo/pe_constant.h
    1938 pablo/pe_count.h
    1939 pablo/pe_infile.h
    1940 pablo/pe_integer.h
    1941 pablo/pe_lookahead.h
    1942 pablo/pe_matchstar.h
    1943 pablo/pe_next.h
    1944 pablo/pe_not.h
    1945 pablo/pe_ones.h
    1946 pablo/pe_or.h
    1947 pablo/pe_scanthru.h
    1948 pablo/pe_sel.h
    1949 pablo/pe_setithbit.h
    1950 pablo/pe_string.h
    1951 pablo/pe_var.h
    1952 pablo/pe_xor.h
    1953 pablo/pe_zeroes.h
    1954 pablo/printer_pablos.cpp
    1955 pablo/printer_pablos.h
    1956 pablo/ps_assign.h
    1957 pablo/ps_if.cpp
    1958 pablo/ps_if.h
    1959 pablo/ps_while.cpp
    1960 pablo/ps_while.h
    1961 pablo/symbol_generator.cpp
    1962 pablo/symbol_generator.h
    1963 re/parsefailure.cpp
    1964 re/parsefailure.h
    1965 re/printer_re.cpp
    1966 re/printer_re.h
    1967 re/re_alt.h
    1968 re/re_analysis.cpp
    1969 re/re_analysis.h
    1970 re/re_any.h
    1971 re/re_assertion.h
    1972 re/re_cc.cpp
    1973 re/re_cc.h
    1974 re/re_compiler.cpp
    1975 re/re_compiler.h
    1976 re/re_diff.cpp
    1977 re/re_diff.h
    1978 re/re_end.h
    1979 re/re_intersect.cpp
    1980 re/re_intersect.h
    1981 re/re_memoizer.hpp
    1982 re/re_name.h
    1983 re/re_name_resolve.cpp
    1984 re/re_name_resolve.h
    1985 re/re_nullable.cpp
    1986 re/re_nullable.h
    1987 re/re_parser.cpp
    1988 re/re_parser.h
    1989 re/re_re.cpp
    1990 re/re_re.h
    1991 re/re_rep.cpp
    1992 re/re_rep.h
    1993 re/re_seq.h
    1994 re/re_simplifier.cpp
    1995 re/re_simplifier.h
    1996 re/re_start.h
    1997 re/re_toolchain.cpp
    1998 re/re_toolchain.h
    1999281UCD/Blocks.h
    2000282UCD/CaseFolding_txt.cpp
     
    2015297UCD/HangulSyllableType.h
    2016298UCD/LineBreak.h
     299UCD/precompiled_blk.cpp
     300UCD/precompiled_blk.h
     301UCD/precompiled_derivedcoreproperties.cpp
     302UCD/precompiled_derivedcoreproperties.h
     303UCD/precompiled_gc.cpp
     304UCD/precompiled_gc.h
     305UCD/precompiled_properties.cpp
     306UCD/precompiled_properties.h
     307UCD/precompiled_proplist.cpp
     308UCD/precompiled_proplist.h
     309UCD/precompiled_sc.cpp
     310UCD/precompiled_sc.h
     311UCD/precompiled_scx.cpp
     312UCD/precompiled_scx.h
    2017313UCD/PropertyAliases.h
    2018314UCD/PropertyObjects.cpp
     
    2028324UCD/ucd_compiler.cpp
    2029325UCD/ucd_compiler.hpp
     326UCD/UnicodeNameData.cpp
     327UCD/UnicodeNameData.h
    2030328UCD/unicode_set.cpp
    2031329UCD/unicode_set.h
    2032 UCD/UnicodeNameData.cpp
    2033 UCD/UnicodeNameData.h
    2034330UCD/WordBreakProperty.h
    2035 util/papi_helper.hpp
    2036 util/slab_allocator.h
    2037 grep_engine.cpp
    2038 grep_engine.h
    2039 hrtime.h
    2040 icgrep.cpp
    2041 object_cache.cpp
    2042 object_cache.h
    2043 symboltable.cpp
    2044 toolchain.cpp
    2045 toolchain.h
    2046 u8u16.cpp
     331unicode_categories-flat.h
     332unicode_categories.h
     333unicode_categories-simple.h
    2047334utf16_encoder.cpp
    2048335utf16_encoder.h
    2049336utf8_encoder.cpp
    2050337utf8_encoder.h
     338utf_encoding.cpp
     339utf_encoding.h
     340util/ispc.cpp
     341util/ispc.h
     342util/papi_helper.hpp
     343util/slab_allocator.h
    2051344wc.cpp
     345pablo/ps_assign.cpp
     346pablo/pe_var.cpp
  • icGREP/icgrep-devel/icgrep/icgrep-devel.includes

    r4986 r5202  
    2222CMakeFiles/3.2.2/CompilerIdCXX
    2323util
     24pablo/type
     25editd
  • icGREP/icgrep-devel/icgrep/icgrep.cpp

    r5199 r5202  
    364364    GrepEngine grepEngine;
    365365    grepEngine.grepCodeGen(module_name, re_ast, CountOnly, UTF_16);
    366     //std::cerr << "grepCodeGen complete";
    367366
    368367    releaseSlabAllocatorMemory();
     
    376375            if (boost::filesystem::exists(f)) {
    377376                std::cout << f << "\n";
    378             }
    379             else {
     377            } else {
    380378                std::cerr << "Error: cannot open " << f << " for processing. Skipped.\n";
    381379            }
  • icGREP/icgrep-devel/icgrep/kernels/cc_kernel.cpp

    r5140 r5202  
    1111
    1212void DirectCharacterClassKernelBuilder::generateDoBlockMethod() {
    13     IDISA::IDISA_Builder::InsertPoint savePoint = iBuilder->saveIP();
     13    auto savePoint = iBuilder->saveIP();
    1414    Module * m = iBuilder->getModule();
    1515
  • icGREP/icgrep-devel/icgrep/kernels/cc_kernel.h

    r5140 r5202  
    2424    DirectCharacterClassKernelBuilder(IDISA::IDISA_Builder * iBuilder, std::string ccSetName, std::vector<re::CC *> charClasses, unsigned codeUnitSize) :
    2525    KernelBuilder(iBuilder, "cc",
    26                   {StreamSetBinding{parabix::StreamSetType(1, 8 * codeUnitSize), "codeUnitStream"}},
    27                   {StreamSetBinding{parabix::StreamSetType(charClasses.size(), parabix::i1), "ccStream"}},
     26                  {Binding{parabix::StreamSetType(iBuilder,1, 8 * codeUnitSize), "codeUnitStream"}},
     27                  {Binding{parabix::StreamSetType(iBuilder,charClasses.size(), 1), "ccStream"}},
    2828                  {}, {}, {}), mCharClasses(charClasses), mCodeUnitSize(codeUnitSize) {}
    2929   
     
    4141public:
    4242    ParabixCharacterClassKernelBuilder(IDISA::IDISA_Builder * iBuilder, std::string ccSetName, std::vector<re::CC *> charClasses, unsigned basisBitsCount) :
    43         PabloKernel(iBuilder, ccSetName +"_kernel", cc::ParabixCharacterClassFunction(ccSetName, charClasses, basisBitsCount), {}) {}
     43        PabloKernel(iBuilder, ccSetName +"_kernel", cc::ParabixCharacterClassFunction(ccSetName, charClasses, basisBitsCount)) {}
    4444   
    4545};
  • icGREP/icgrep-devel/icgrep/kernels/deletion.cpp

    r5184 r5202  
    4848// Outputs: the deleted streams, plus a partial sum popcount
    4949
     50namespace kernel {
    5051
    51 void deletionKernel::generateDoBlockMethod() {
    52     IDISA::IDISA_Builder::InsertPoint savePoint = iBuilder->saveIP();
     52void DeletionKernel::generateDoBlockMethod() {
     53    auto savePoint = iBuilder->saveIP();
    5354    Module * m = iBuilder->getModule();
    5455   
     
    8384}
    8485
    85 void deletionKernel::generateFinalBlockMethod() {
    86     IDISA::IDISA_Builder::InsertPoint savePoint = iBuilder->saveIP();
     86void DeletionKernel::generateFinalBlockMethod() {
     87    auto savePoint = iBuilder->saveIP();
    8788    Module * m = iBuilder->getModule();
    8889   
     
    111112}
    112113
    113 
     114}
  • icGREP/icgrep-devel/icgrep/kernels/deletion.h

    r5133 r5202  
    3333llvm::Value * apply_parallel_prefix_deletion(IDISA::IDISA_Builder * iBuilder, unsigned fw, llvm::Value * del_mask, std::vector<llvm::Value *> mv, llvm::Value * strm);
    3434
    35 using namespace kernel;
    3635using namespace parabix;
    3736
    38 class deletionKernel : public kernel::KernelBuilder {
     37namespace kernel {
     38
     39class DeletionKernel : public kernel::KernelBuilder {
    3940public:
    40     deletionKernel(IDISA::IDISA_Builder * iBuilder, unsigned fw, unsigned streamCount) :
     41    DeletionKernel(IDISA::IDISA_Builder * iBuilder, unsigned fw, unsigned streamCount) :
    4142    KernelBuilder(iBuilder, "del",
    42                   {StreamSetBinding{StreamSetType(streamCount + 2, 1), "inputStreamSet"}},
    43                   {StreamSetBinding{StreamSetType(streamCount, 1), "outputStreamSet"},
    44                    StreamSetBinding{StreamSetType(1, 1), "deletionCounts"}},
     43                  {Binding{StreamSetType(iBuilder,streamCount + 2, 1), "inputStreamSet"}},
     44                  {Binding{StreamSetType(iBuilder,streamCount, 1), "outputStreamSet"},
     45                   Binding{StreamSetType(iBuilder,1, 1), "deletionCounts"}},
    4546                  {}, {}, {}),
    4647    mDeletionFieldWidth(fw),
     
    5354    unsigned mStreamCount;
    5455};
     56
     57}
    5558   
    5659#endif
  • icGREP/icgrep-devel/icgrep/kernels/interface.cpp

    r5185 r5202  
    1515void KernelInterface::addKernelDeclarations(Module * client) {
    1616    Module * saveModule = iBuilder->getModule();
    17     IDISA::IDISA_Builder::InsertPoint savePoint = iBuilder->saveIP();
     17    auto savePoint = iBuilder->saveIP();
    1818    iBuilder->setModule(client);
    1919    if (mKernelStateType == nullptr) {
     
    2323    // Create the accumulator get function prototypes
    2424    for (auto binding : mScalarOutputs) {
    25         FunctionType * accumFnType = FunctionType::get(binding.scalarType, {selfType}, false);
    26         std::string fnName = mKernelName + accumulator_infix + binding.scalarName;
     25        FunctionType * accumFnType = FunctionType::get(binding.type, {selfType}, false);
     26        std::string fnName = mKernelName + accumulator_infix + binding.name;
    2727        Function * accumFn = Function::Create(accumFnType, GlobalValue::ExternalLinkage, fnName, client);
    2828        accumFn->setCallingConv(CallingConv::C);
     
    3535    std::vector<Type *> initParameters = {selfType};
    3636    for (auto binding : mScalarInputs) {
    37         initParameters.push_back(binding.scalarType);
     37        initParameters.push_back(binding.type);
    3838    }
    3939    FunctionType * initFunctionType = FunctionType::get(iBuilder->getVoidTy(), initParameters, false);
     
    4747    for (auto binding : mScalarInputs) {
    4848        initArg = &*(initArgs++);
    49         initArg->setName(binding.scalarName);
     49        initArg->setName(binding.name);
    5050    }
    5151
  • icGREP/icgrep-devel/icgrep/kernels/interface.h

    r5174 r5202  
    1111#include <llvm/IR/Type.h>
    1212#include <IDISA/idisa_builder.h>
    13 #include "streamset.h"
     13#include <kernels/streamset.h>
    1414
     15struct Binding {
     16    llvm::Type * type;
     17    std::string name;
    1518
    16 struct ScalarBinding {
    17     llvm::Type * scalarType;
    18     std::string scalarName;
     19    Binding(llvm::Type * type, std::string name)
     20    : type(type)
     21    , name(std::move(name)) {
     22
     23    }
    1924};
    2025
    21 struct StreamSetBinding {
    22     parabix::StreamSetType ssType;
    23     std::string ssName;
    24 };
    25    
    26 const std::string init_suffix = "_Init";
    27 const std::string doBlock_suffix = "_DoBlock";
    28 const std::string doSegment_suffix = "_DoSegment";
    29 const std::string finalBlock_suffix = "_FinalBlock";
    30 const std::string accumulator_infix = "_get_";
     26static const std::string init_suffix = "_Init";
     27static const std::string doBlock_suffix = "_DoBlock";
     28static const std::string doSegment_suffix = "_DoSegment";
     29static const std::string finalBlock_suffix = "_FinalBlock";
     30static const std::string accumulator_infix = "_get_";
    3131
    3232class KernelInterface {
     
    4444    std::string & getName() { return mKernelName;}
    4545   
    46     std::vector<StreamSetBinding> getStreamInputs() {return mStreamSetInputs;}
    47     std::vector<StreamSetBinding> getStreamOutputs() {return mStreamSetOutputs;}
    48     std::vector<ScalarBinding> getScalarInputs() { return mScalarInputs;}
    49     std::vector<ScalarBinding> getScalarOutputs() { return mScalarOutputs;}
     46    std::vector<Binding> getStreamInputs() {return mStreamSetInputs;}
     47    std::vector<Binding> getStreamOutputs() {return mStreamSetOutputs;}
     48    std::vector<Binding> getScalarInputs() { return mScalarInputs;}
     49    std::vector<Binding> getScalarOutputs() { return mScalarOutputs;}
    5050   
    5151   
     
    5959    llvm::Value * createGetAccumulatorCall(llvm::Value * kernelInstance, std::string accumName);
    6060   
    61     unsigned getLookAhead() { return mLookAheadPositions; }
     61    unsigned getLookAhead() const {
     62        return mLookAheadPositions;
     63    }
    6264   
    63    
     65    IDISA::IDISA_Builder * getBuilder() const {
     66        return iBuilder;
     67    }
     68
    6469    virtual llvm::Value * getLogicalSegmentNo(llvm::Value * kernelInstance) = 0;
    6570    virtual llvm::Value * getProcessedItemCount(llvm::Value * kernelInstance) = 0;
     
    6772    virtual llvm::Value * getTerminationSignal(llvm::Value * kernelInstance) = 0;
    6873   
     74    void setLookAhead(unsigned lookAheadPositions) {
     75        mLookAheadPositions = lookAheadPositions;
     76    }
     77
     78    llvm::Value * createDoBlockCall(llvm::Value * kernelInstance);
     79
    6980protected:
     81
    7082    KernelInterface(IDISA::IDISA_Builder * builder,
    7183                    std::string kernelName,
    72                     std::vector<StreamSetBinding> stream_inputs,
    73                     std::vector<StreamSetBinding> stream_outputs,
    74                     std::vector<ScalarBinding> scalar_parameters,
    75                     std::vector<ScalarBinding> scalar_outputs,
    76                     std::vector<ScalarBinding> internal_scalars) :
     84                    std::vector<Binding> stream_inputs,
     85                    std::vector<Binding> stream_outputs,
     86                    std::vector<Binding> scalar_inputs,
     87                    std::vector<Binding> scalar_outputs,
     88                    std::vector<Binding> internal_scalars) :
    7789    iBuilder(builder),
    7890    mKernelName(kernelName),
    7991    mStreamSetInputs(stream_inputs),
    8092    mStreamSetOutputs(stream_outputs),
    81     mScalarInputs(scalar_parameters),
     93    mScalarInputs(scalar_inputs),
    8294    mScalarOutputs(scalar_outputs),
    8395    mInternalScalars(internal_scalars),
     
    8597    mLookAheadPositions(0) {}
    8698   
     99protected:
    87100   
    88    
    89     IDISA::IDISA_Builder * iBuilder;
     101    IDISA::IDISA_Builder * const iBuilder;
    90102    std::string mKernelName;
    91     std::vector<StreamSetBinding> mStreamSetInputs;
    92     std::vector<StreamSetBinding> mStreamSetOutputs;
    93     std::vector<ScalarBinding> mScalarInputs;
    94     std::vector<ScalarBinding> mScalarOutputs;
    95     std::vector<ScalarBinding> mInternalScalars;
     103    std::vector<Binding> mStreamSetInputs;
     104    std::vector<Binding> mStreamSetOutputs;
     105    std::vector<Binding> mScalarInputs;
     106    std::vector<Binding> mScalarOutputs;
     107    std::vector<Binding> mInternalScalars;
    96108    llvm::Type * mKernelStateType;
    97109    unsigned mLookAheadPositions;
    98110   
    99     void setLookAhead(unsigned lookAheadPositions) {mLookAheadPositions = lookAheadPositions;}
    100     llvm::Value * createDoBlockCall(llvm::Value * kernelInstance);
    101 
    102111};
    103112#endif
  • icGREP/icgrep-devel/icgrep/kernels/kernel.cpp

    r5194 r5202  
    1818KernelBuilder::KernelBuilder(IDISA::IDISA_Builder * builder,
    1919                                 std::string kernelName,
    20                                  std::vector<StreamSetBinding> stream_inputs,
    21                                  std::vector<StreamSetBinding> stream_outputs,
    22                                  std::vector<ScalarBinding> scalar_parameters,
    23                                  std::vector<ScalarBinding> scalar_outputs,
    24                                  std::vector<ScalarBinding> internal_scalars) :
     20                                 std::vector<Binding> stream_inputs,
     21                                 std::vector<Binding> stream_outputs,
     22                                 std::vector<Binding> scalar_parameters,
     23                                 std::vector<Binding> scalar_outputs,
     24                                 std::vector<Binding> internal_scalars) :
    2525    KernelInterface(builder, kernelName, stream_inputs, stream_outputs, scalar_parameters, scalar_outputs, internal_scalars) {}
    2626
    27 void KernelBuilder::addScalar(Type * t, std::string scalarName) {
     27void KernelBuilder::addScalar(Type * t, std::string name) {
    2828    if (LLVM_UNLIKELY(mKernelStateType != nullptr)) {
    29         llvm::report_fatal_error("Illegal addition of kernel field after kernel state finalized: " + scalarName);
     29        llvm::report_fatal_error("Illegal addition of kernel field after kernel state finalized: " + name);
    3030    }
    3131    unsigned index = mKernelFields.size();
    3232    mKernelFields.push_back(t);
    33     mInternalStateNameMap.emplace(scalarName, index);
     33    mInternalStateNameMap.emplace(name, index);
    3434}
    3535
     
    3737    unsigned blockSize = iBuilder->getBitBlockWidth();
    3838    if (mStreamSetInputs.size() != mStreamSetInputBuffers.size()) {
    39         llvm::report_fatal_error("Kernel preparation: Incorrect number of input buffers");
     39        std::string tmp;
     40        raw_string_ostream out(tmp);
     41        out << "kernel contains " << mStreamSetInputBuffers.size() << " input buffers for "
     42            << mStreamSetInputs.size() << " input stream sets.";
     43        llvm::report_fatal_error(out.str());
    4044    }
    4145    if (mStreamSetOutputs.size() != mStreamSetOutputBuffers.size()) {
    42         llvm::report_fatal_error("Kernel preparation: Incorrect number of output buffers");
     46        std::string tmp;
     47        raw_string_ostream out(tmp);
     48        out << "kernel contains " << mStreamSetOutputBuffers.size() << " output buffers for "
     49            << mStreamSetOutputs.size() << " output stream sets.";
     50        llvm::report_fatal_error(out.str());
    4351    }
    4452    addScalar(iBuilder->getSizeTy(), blockNoScalar);
     
    4957    int streamSetNo = 0;
    5058    for (unsigned i = 0; i < mStreamSetInputs.size(); i++) {
    51         if (!(mStreamSetInputBuffers[i]->getBufferStreamSetType() == mStreamSetInputs[i].ssType)) {
    52              llvm::report_fatal_error("Kernel preparation: Incorrect input buffer type");
     59        if ((mStreamSetInputBuffers[i]->getBufferSize() > 0) && (mStreamSetInputBuffers[i]->getBufferSize() < codegen::SegmentSize + (blockSize + mLookAheadPositions - 1)/blockSize)) {
     60             llvm::report_fatal_error("Kernel preparation: Buffer size too small " + mStreamSetInputs[i].name);
    5361        }
    54         if ((mStreamSetInputBuffers[i]->getBufferSize() > 0) && (mStreamSetInputBuffers[i]->getBufferSize() < codegen::SegmentSize + (blockSize + mLookAheadPositions - 1)/blockSize)) {
    55              errs() << " buffer size = " << mStreamSetInputBuffers[i]->getBufferSize() << "\n";
    56              llvm::report_fatal_error("Kernel preparation: Buffer size too small " + mStreamSetInputs[i].ssName);
    57         }
    58         mScalarInputs.push_back(ScalarBinding{mStreamSetInputBuffers[i]->getStreamSetStructPointerType(), mStreamSetInputs[i].ssName + structPtrSuffix});
    59         mStreamSetNameMap.emplace(mStreamSetInputs[i].ssName, streamSetNo);
     62        mScalarInputs.push_back(Binding{mStreamSetInputBuffers[i]->getStreamSetStructPointerType(), mStreamSetInputs[i].name + structPtrSuffix});
     63        mStreamSetNameMap.emplace(mStreamSetInputs[i].name, streamSetNo);
    6064        streamSetNo++;
    6165    }
    6266    for (unsigned i = 0; i < mStreamSetOutputs.size(); i++) {
    63         if (!(mStreamSetOutputBuffers[i]->getBufferStreamSetType() == mStreamSetOutputs[i].ssType)) {
    64              llvm::report_fatal_error("Kernel preparation: Incorrect output buffer type " + mStreamSetOutputs[i].ssName);
    65         }
    66         mScalarInputs.push_back(ScalarBinding{mStreamSetOutputBuffers[i]->getStreamSetStructPointerType(), mStreamSetOutputs[i].ssName + structPtrSuffix});
    67         mStreamSetNameMap.emplace(mStreamSetOutputs[i].ssName, streamSetNo);
     67        mScalarInputs.push_back(Binding{mStreamSetOutputBuffers[i]->getStreamSetStructPointerType(), mStreamSetOutputs[i].name + structPtrSuffix});
     68        mStreamSetNameMap.emplace(mStreamSetOutputs[i].name, streamSetNo);
    6869        streamSetNo++;
    6970    }
    7071    for (auto binding : mScalarInputs) {
    71         addScalar(binding.scalarType, binding.scalarName);
     72        addScalar(binding.type, binding.name);
    7273    }
    7374    for (auto binding : mScalarOutputs) {
    74         addScalar(binding.scalarType, binding.scalarName);
     75        addScalar(binding.type, binding.name);
    7576    }
    7677    for (auto binding : mInternalScalars) {
    77         addScalar(binding.scalarType, binding.scalarName);
     78        addScalar(binding.type, binding.name);
    7879    }
    7980    mKernelStateType = StructType::create(iBuilder->getContext(), mKernelFields, mKernelName);
     
    8283std::unique_ptr<Module> KernelBuilder::createKernelModule(std::vector<StreamSetBuffer *> input_buffers, std::vector<StreamSetBuffer *> output_buffers) {
    8384    Module * saveModule = iBuilder->getModule();
    84     IDISA::IDISA_Builder::InsertPoint savePoint = iBuilder->saveIP();
     85    auto savePoint = iBuilder->saveIP();
    8586    std::unique_ptr<Module> theModule = make_unique<Module>(mKernelName + "_" + iBuilder->getBitBlockTypeName(), iBuilder->getContext());
    8687    Module * m = theModule.get();
     
    9394
    9495void KernelBuilder::generateKernel(std::vector<StreamSetBuffer *> input_buffers, std::vector<StreamSetBuffer*> output_buffers) {
    95     IDISA::IDISA_Builder::InsertPoint savePoint = iBuilder->saveIP();
     96    auto savePoint = iBuilder->saveIP();
    9697    Module * m = iBuilder->getModule();
    9798    mStreamSetInputBuffers = input_buffers;
     
    105106    // Implement the accumulator get functions
    106107    for (auto binding : mScalarOutputs) {
    107         auto fnName = mKernelName + accumulator_infix + binding.scalarName;
     108        auto fnName = mKernelName + accumulator_infix + binding.name;
    108109        Function * accumFn = m->getFunction(fnName);
    109         iBuilder->SetInsertPoint(BasicBlock::Create(iBuilder->getContext(), "get_" + binding.scalarName, accumFn, 0));
     110        iBuilder->SetInsertPoint(BasicBlock::Create(iBuilder->getContext(), "get_" + binding.name, accumFn, 0));
    110111        Value * self = &*(accumFn->arg_begin());
    111         Value * ptr = iBuilder->CreateGEP(self, {iBuilder->getInt32(0), getScalarIndex(binding.scalarName)});
     112        Value * ptr = iBuilder->CreateGEP(self, {iBuilder->getInt32(0), getScalarIndex(binding.name)});
    112113        Value * retVal = iBuilder->CreateLoad(ptr);
    113114        iBuilder->CreateRet(retVal);
     
    122123    for (auto binding : mScalarInputs) {
    123124        Value * parm = &*(args++);
    124         Value * ptr = iBuilder->CreateGEP(self, {iBuilder->getInt32(0), getScalarIndex(binding.scalarName)});
     125        Value * ptr = iBuilder->CreateGEP(self, {iBuilder->getInt32(0), getScalarIndex(binding.name)});
    125126        iBuilder->CreateStore(parm, ptr);
    126127    }
     
    131132//  The default finalBlock method simply dispatches to the doBlock routine.
    132133void KernelBuilder::generateFinalBlockMethod() {
    133     IDISA::IDISA_Builder::InsertPoint savePoint = iBuilder->saveIP();
     134    auto savePoint = iBuilder->saveIP();
    134135    Module * m = iBuilder->getModule();
    135136    Function * doBlockFunction = m->getFunction(mKernelName + doBlock_suffix);
     
    159160//  each block of the given number of blocksToDo, and then updates counts.
    160161void KernelBuilder::generateDoSegmentMethod() {
    161     IDISA::IDISA_Builder::InsertPoint savePoint = iBuilder->saveIP();
     162    auto savePoint = iBuilder->saveIP();
    162163    Module * m = iBuilder->getModule();
    163164    Function * doSegmentFunction = m->getFunction(mKernelName + doSegment_suffix);
     
    184185    std::vector<Value *> endSignalPtrs;
    185186    for (unsigned i = 0; i < mStreamSetInputs.size(); i++) {
    186         Value * ssStructPtr = getStreamSetStructPtr(self, mStreamSetInputs[i].ssName);
     187        Value * ssStructPtr = getStreamSetStructPtr(self, mStreamSetInputs[i].name);
    187188        inbufProducerPtrs.push_back(mStreamSetInputBuffers[i]->getProducerPosPtr(ssStructPtr));
    188189        endSignalPtrs.push_back(mStreamSetInputBuffers[i]->hasEndOfInputPtr(ssStructPtr));
     
    202203    Value * processed = getProcessedItemCount(self);
    203204    Value * itemsAvail = iBuilder->CreateSub(availablePos, processed);
    204 #ifndef NDEBUG
    205     iBuilder->CallPrintInt(mKernelName + "_itemsAvail", itemsAvail);
    206 #endif
     205//#ifndef NDEBUG
     206//    iBuilder->CallPrintInt(mKernelName + "_itemsAvail", itemsAvail);
     207//#endif
    207208    Value * stridesToDo = iBuilder->CreateUDiv(blocksToDo, strideBlocks);
    208209    Value * stridesAvail = iBuilder->CreateUDiv(itemsAvail, stride);
     
    260261   
    261262    for (unsigned i = 0; i < mStreamSetOutputs.size(); i++) {
    262         Value * ssStructPtr = getStreamSetStructPtr(self, mStreamSetOutputs[i].ssName);
     263        Value * ssStructPtr = getStreamSetStructPtr(self, mStreamSetOutputs[i].name);
    263264        mStreamSetOutputBuffers[i]->setEndOfInput(ssStructPtr);
    264265    }
     
    268269    iBuilder->SetInsertPoint(segmentDone);
    269270    Value * produced = getProducedItemCount(self);
    270 #ifndef NDEBUG
    271     iBuilder->CallPrintInt(mKernelName + "_produced", produced);
    272 #endif
     271//#ifndef NDEBUG
     272//    iBuilder->CallPrintInt(mKernelName + "_produced", produced);
     273//#endif
    273274    for (unsigned i = 0; i < mStreamSetOutputs.size(); i++) {
    274         Value * ssStructPtr = getStreamSetStructPtr(self, mStreamSetOutputs[i].ssName);
     275        Value * ssStructPtr = getStreamSetStructPtr(self, mStreamSetOutputs[i].name);
    275276        Value * producerPosPtr = mStreamSetOutputBuffers[i]->getProducerPosPtr(ssStructPtr);
    276277        iBuilder->CreateAtomicStoreRelease(produced, producerPosPtr);
     
    290291    const auto f = mInternalStateNameMap.find(fieldName);
    291292    if (LLVM_UNLIKELY(f == mInternalStateNameMap.end())) {
    292         llvm::report_fatal_error("Kernel does not contain internal state: " + fieldName);
     293        throw std::runtime_error("Kernel does not contain internal state: " + fieldName);
    293294    }
    294295    return iBuilder->getInt32(f->second);
    295296}
    296297
    297 
     298Value * KernelBuilder::getScalarFieldPtr(Value * self, std::string fieldName) {
     299    return iBuilder->CreateGEP(self, {iBuilder->getInt32(0), getScalarIndex(fieldName)});
     300}
    298301
    299302Value * KernelBuilder::getScalarField(Value * self, std::string fieldName) {
    300     Value * ptr = iBuilder->CreateGEP(self, {iBuilder->getInt32(0), getScalarIndex(fieldName)});
    301     return iBuilder->CreateLoad(ptr);
     303    return iBuilder->CreateLoad(getScalarFieldPtr(self, fieldName));
    302304}
    303305
    304306void KernelBuilder::setScalarField(Value * self, std::string fieldName, Value * newFieldVal) {
    305     Value * ptr = iBuilder->CreateGEP(self, {iBuilder->getInt32(0), getScalarIndex(fieldName)});
    306     iBuilder->CreateStore(newFieldVal, ptr);
     307    iBuilder->CreateStore(newFieldVal, getScalarFieldPtr(self, fieldName));
    307308}
    308309
     
    325326}
    326327
    327 
    328328void KernelBuilder::setLogicalSegmentNo(Value * self, Value * newCount) {
    329329    Value * ptr = iBuilder->CreateGEP(self, {iBuilder->getInt32(0), getScalarIndex(logicalSegmentNoScalar)});
     
    368368}
    369369
    370 unsigned KernelBuilder::getStreamSetIndex(std::string ssName) {
    371     const auto f = mStreamSetNameMap.find(ssName);
     370unsigned KernelBuilder::getStreamSetIndex(std::string name) {
     371    const auto f = mStreamSetNameMap.find(name);
    372372    if (LLVM_UNLIKELY(f == mStreamSetNameMap.end())) {
    373         llvm::report_fatal_error("Kernel does not contain stream set: " + ssName);
     373        llvm::report_fatal_error("Kernel does not contain stream set: " + name);
    374374    }
    375375    return f->second;
    376376}
    377377
    378 size_t KernelBuilder::getStreamSetBufferSize(Value * self, std::string ssName) {
    379     unsigned ssIndex = getStreamSetIndex(ssName);
    380     if (ssIndex < mStreamSetInputs.size()) {
    381         return mStreamSetInputBuffers[ssIndex]->getBufferSize();
    382     }
    383     else {
    384         return mStreamSetOutputBuffers[ssIndex - mStreamSetInputs.size()]->getBufferSize();
    385     }
    386 }
    387 
    388 Value * KernelBuilder::getStreamSetStructPtr(Value * self, std::string ssName) {
    389     return getScalarField(self, ssName + structPtrSuffix);
    390 }
    391 
    392 Value * KernelBuilder::getStreamSetBlockPtr(Value * self, std::string ssName, Value * blockNo) {
    393     Value * ssStructPtr = getStreamSetStructPtr(self, ssName);
    394     unsigned ssIndex = getStreamSetIndex(ssName);
    395     if (ssIndex < mStreamSetInputs.size()) {
    396         return mStreamSetInputBuffers[ssIndex]->getStreamSetBlockPointer(ssStructPtr, blockNo);
    397     }
    398     else {
    399         return mStreamSetOutputBuffers[ssIndex - mStreamSetInputs.size()]->getStreamSetBlockPointer(ssStructPtr, blockNo);
    400     }
     378size_t KernelBuilder::getStreamSetBufferSize(Value * self, std::string name) {
     379    const unsigned index = getStreamSetIndex(name);
     380    StreamSetBuffer * buf = nullptr;
     381    if (index < mStreamSetInputs.size()) {
     382        buf = mStreamSetInputBuffers[index];
     383    } else {
     384        buf = mStreamSetOutputBuffers[index - mStreamSetInputs.size()];
     385    }
     386    return buf->getBufferSize();
     387}
     388
     389Value * KernelBuilder::getStreamSetStructPtr(Value * self, std::string name) {
     390    return getScalarField(self, name + structPtrSuffix);
     391}
     392
     393Value * KernelBuilder::getStreamSetBlockPtr(Value * self, std::string name, Value * blockNo) {
     394    Value * const structPtr = getStreamSetStructPtr(self, name);
     395    const unsigned index = getStreamSetIndex(name);
     396    StreamSetBuffer * buf = nullptr;
     397    if (index < mStreamSetInputs.size()) {
     398        buf = mStreamSetInputBuffers[index];
     399    } else {
     400        buf = mStreamSetOutputBuffers[index - mStreamSetInputs.size()];
     401    }   
     402    return buf->getStreamSetBlockPointer(structPtr, blockNo);
    401403}
    402404
     
    408410        init_args.push_back(a);
    409411    }
    410     for (auto b : mStreamSetInputBuffers) { 
     412    for (auto b : mStreamSetInputBuffers) {
    411413        init_args.push_back(b->getStreamSetStructPtr());
    412414    }
    413     for (auto b : mStreamSetOutputBuffers) { 
     415    for (auto b : mStreamSetOutputBuffers) {
    414416        init_args.push_back(b->getStreamSetStructPtr());
    415417    }
     
    448450
    449451    for (unsigned i = 0; i < mStreamSetInputs.size(); i++) {
    450         Value * ssStructPtr = getStreamSetStructPtr(self, mStreamSetInputs[i].ssName);
     452        Value * ssStructPtr = getStreamSetStructPtr(self, mStreamSetInputs[i].name);
    451453        inbufProducerPtrs.push_back(mStreamSetInputBuffers[i]->getProducerPosPtr(ssStructPtr));
    452454        inbufConsumerPtrs.push_back(mStreamSetInputBuffers[i]->getConsumerPosPtr(ssStructPtr));
     
    454456    }
    455457    for (unsigned i = 0; i < mStreamSetOutputs.size(); i++) {
    456         Value * ssStructPtr = getStreamSetStructPtr(self, mStreamSetOutputs[i].ssName);
     458        Value * ssStructPtr = getStreamSetStructPtr(self, mStreamSetOutputs[i].name);
    457459        outbufProducerPtrs.push_back(mStreamSetOutputBuffers[i]->getProducerPosPtr(ssStructPtr));
    458460        outbufConsumerPtrs.push_back(mStreamSetOutputBuffers[i]->getConsumerPosPtr(ssStructPtr));
     
    540542        iBuilder->SetInsertPoint(earlyEndBlock);
    541543        for (unsigned i = 0; i < mStreamSetOutputs.size(); i++) {
    542             Value * ssStructPtr = getStreamSetStructPtr(self, mStreamSetOutputs[i].ssName);
     544            Value * ssStructPtr = getStreamSetStructPtr(self, mStreamSetOutputs[i].name);
    543545            mStreamSetOutputBuffers[i]->setEndOfInput(ssStructPtr);
    544546        }       
     
    575577
    576578    for (unsigned i = 0; i < mStreamSetOutputs.size(); i++) {
    577         Value * ssStructPtr = getStreamSetStructPtr(self, mStreamSetOutputs[i].ssName);
     579        Value * ssStructPtr = getStreamSetStructPtr(self, mStreamSetOutputs[i].name);
    578580        mStreamSetOutputBuffers[i]->setEndOfInput(ssStructPtr);
    579581    }
  • icGREP/icgrep-devel/icgrep/kernels/kernel.h

    r5194 r5202  
    3232    KernelBuilder(IDISA::IDISA_Builder * builder,
    3333                    std::string kernelName,
    34                     std::vector<StreamSetBinding> stream_inputs,
    35                     std::vector<StreamSetBinding> stream_outputs,
    36                     std::vector<ScalarBinding> scalar_parameters,
    37                     std::vector<ScalarBinding> scalar_outputs,
    38                     std::vector<ScalarBinding> internal_scalars);
     34                    std::vector<Binding> stream_inputs,
     35                    std::vector<Binding> stream_outputs,
     36                    std::vector<Binding> scalar_parameters,
     37                    std::vector<Binding> scalar_outputs,
     38                    std::vector<Binding> internal_scalars);
    3939   
    4040    // Create a module for the kernel, including the kernel state type declaration and
     
    5656    llvm::Value * getTerminationSignal(llvm::Value * kernelInstance);
    5757   
    58    
     58
    5959protected:
    6060    //
     
    8989    // Add an additional scalar field to the KernelState struct.
    9090    // Must occur before any call to addKernelDeclarations or createKernelModule.
    91     void addScalar(llvm::Type * t, std::string scalarName);
     91    void addScalar(llvm::Type * t, std::string name);
    9292   
    9393    // Run-time access of Kernel State and parameters of methods for
     
    9999    // Get the value of a scalar field for a given instance.
    100100    llvm::Value * getScalarField(llvm::Value * self, std::string fieldName);
    101    
     101
    102102    // Set the value of a scalar field for a given instance.
    103103    void setScalarField(llvm::Value * self, std::string fieldName, llvm::Value * newFieldVal);
     
    107107   
    108108    // Stream set helpers.
    109     unsigned getStreamSetIndex(std::string ssName);
     109    unsigned getStreamSetIndex(std::string name);
    110110   
    111     llvm::Value * getStreamSetStructPtr(Value * self, std::string ssName);
    112     size_t getStreamSetBufferSize(Value * self, std::string ssName);
     111    llvm::Value * getScalarFieldPtr(Value * self, std::string name);
    113112
    114     llvm::Value * getStreamSetBlockPtr(Value * self, std::string ssName, Value * blockNo);
     113    llvm::Value * getStreamSetStructPtr(Value * self, std::string name);
     114    size_t getStreamSetBufferSize(Value * self, std::string name);
     115
     116    llvm::Value * getStreamSetBlockPtr(Value * self, std::string name, Value * blockNo);
    115117   
    116118    void setBlockNo(Value * self, Value * newFieldVal);
     
    119121    virtual void setProducedItemCount(llvm::Value * self, Value * newFieldVal);
    120122    void setTerminationSignal(llvm::Value * self);
    121    
     123
    122124
    123125protected:
  • icGREP/icgrep-devel/icgrep/kernels/p2s_kernel.cpp

    r5193 r5202  
    4242               
    4343void p2sKernel::generateDoBlockMethod() {
    44     IDISA::IDISA_Builder::InsertPoint savePoint = iBuilder->saveIP();
     44    auto savePoint = iBuilder->saveIP();
    4545    Module * m = iBuilder->getModule();
    4646   
     
    7373
    7474void p2sKernel_withCompressedOutput::generateDoBlockMethod() {
    75     IDISA::IDISA_Builder::InsertPoint savePoint = iBuilder->saveIP();
     75    auto savePoint = iBuilder->saveIP();
    7676    Module * m = iBuilder->getModule();
    7777    Type * i8PtrTy = iBuilder->getInt8PtrTy();
     
    112112   
    113113void p2s_16Kernel::generateDoBlockMethod() {
    114     IDISA::IDISA_Builder::InsertPoint savePoint = iBuilder->saveIP();
     114    auto savePoint = iBuilder->saveIP();
    115115    Module * m = iBuilder->getModule();
    116116   
     
    154154
    155155void p2s_16Kernel_withCompressedOutput::generateDoBlockMethod() {
    156     IDISA::IDISA_Builder::InsertPoint savePoint = iBuilder->saveIP();
     156    auto savePoint = iBuilder->saveIP();
    157157    Module * m = iBuilder->getModule();
    158158    Type * i32 = iBuilder->getIntNTy(32);
     
    216216
    217217void p2s_16Kernel_withCompressedOutput::generateFinalBlockMethod() {
    218     IDISA::IDISA_Builder::InsertPoint savePoint = iBuilder->saveIP();
     218    auto savePoint = iBuilder->saveIP();
    219219    Module * m = iBuilder->getModule();
    220220    Function * doBlockFunction = m->getFunction(mKernelName + doBlock_suffix);
     
    234234    i16UnitsGenerated = getProducedItemCount(self); // units generated to buffer
    235235    for (unsigned i = 0; i < mStreamSetOutputs.size(); i++) {
    236         Value * ssStructPtr = getStreamSetStructPtr(self, mStreamSetOutputs[i].ssName);
     236        Value * ssStructPtr = getStreamSetStructPtr(self, mStreamSetOutputs[i].name);
    237237        Value * producerPosPtr = mStreamSetOutputBuffers[i]->getProducerPosPtr(ssStructPtr);
    238238        iBuilder->CreateAtomicStoreRelease(i16UnitsGenerated, producerPosPtr);
  • icGREP/icgrep-devel/icgrep/kernels/p2s_kernel.h

    r5133 r5202  
    2121    p2sKernel(IDISA::IDISA_Builder * iBuilder) :
    2222    KernelBuilder(iBuilder, "p2s",
    23                   {StreamSetBinding{StreamSetType(8, 1), "basisBits"}},
    24                   {StreamSetBinding{StreamSetType(1, 8), "byteStream"}},
     23                  {Binding{StreamSetType(iBuilder,8, 1), "basisBits"}},
     24                  {Binding{StreamSetType(iBuilder,1, 8), "byteStream"}},
    2525                  {}, {}, {}) {}
    2626   
     
    3434    p2sKernel_withCompressedOutput(IDISA::IDISA_Builder * iBuilder) :
    3535    KernelBuilder(iBuilder, "p2s_compress",
    36                   {StreamSetBinding{StreamSetType(8, 1), "basisBits"}, StreamSetBinding{StreamSetType(1, 1), "deletionCounts"}},
    37                   {StreamSetBinding{StreamSetType(1, 8), "byteStream"}},
     36                  {Binding{StreamSetType(iBuilder,8, 1), "basisBits"}, Binding{StreamSetType(iBuilder,1, 1), "deletionCounts"}},
     37                  {Binding{StreamSetType(iBuilder,1, 8), "byteStream"}},
    3838                  {}, {}, {}) {}
    3939   
     
    4848    p2s_16Kernel(IDISA::IDISA_Builder * iBuilder) :
    4949    KernelBuilder(iBuilder, "p2s_16",
    50                   {StreamSetBinding{StreamSetType(16, 1), "basisBits"}},
    51                   {StreamSetBinding{StreamSetType(1, 16), "i16Stream"}},
     50                  {Binding{StreamSetType(iBuilder,16, 1), "basisBits"}},
     51                  {Binding{StreamSetType(iBuilder,1, 16), "i16Stream"}},
    5252                  {}, {}, {}) {}
    5353   
     
    6262    p2s_16Kernel_withCompressedOutput(IDISA::IDISA_Builder * iBuilder) :
    6363    KernelBuilder(iBuilder, "p2s_16_compress",
    64                   {StreamSetBinding{StreamSetType(16, 1), "basisBits"}, StreamSetBinding{StreamSetType(1, 1), "deletionCounts"}},
    65                   {StreamSetBinding{StreamSetType(1, 16), "i16Stream"}},
     64                  {Binding{StreamSetType(iBuilder,16, 1), "basisBits"}, Binding{StreamSetType(iBuilder,1, 1), "deletionCounts"}},
     65                  {Binding{StreamSetType(iBuilder,1, 16), "i16Stream"}},
    6666                  {},
    6767                  {},
    68                   {ScalarBinding{iBuilder->getSizeTy(), "unitsGenerated"}, ScalarBinding{iBuilder->getSizeTy(), "unitsWritten"}}) {}
     68                  {Binding{iBuilder->getSizeTy(), "unitsGenerated"}, Binding{iBuilder->getSizeTy(), "unitsWritten"}}) {}
    6969       
    7070private:
  • icGREP/icgrep-devel/icgrep/kernels/pipeline.cpp

    r5194 r5202  
    119119    Type * sharedStructType = StructType::get(m->getContext(), structTypes);
    120120
    121     AllocaInst * sharedStruct;
    122     sharedStruct = iBuilder->CreateAlloca(sharedStructType);
     121    AllocaInst * sharedStruct = iBuilder->CreateAlloca(sharedStructType);
    123122    Value * sizePtr = iBuilder->CreateGEP(sharedStruct, {iBuilder->getInt32(0), iBuilder->getInt32(0)});
    124123    iBuilder->CreateStore(fileSize, sizePtr);
  • icGREP/icgrep-devel/icgrep/kernels/s2p_kernel.cpp

    r5183 r5202  
    125125     if remaining bytes is zero, no read should be performed (e.g. for mmapped buffer).
    126126     */
    127     IDISA::IDISA_Builder::InsertPoint savePoint = iBuilder->saveIP();
     127    auto savePoint = iBuilder->saveIP();
    128128    Module * m = iBuilder->getModule();
    129129    Function * doBlockFunction = m->getFunction(mKernelName + doBlock_suffix);
     
    162162   
    163163void s2pKernel::generateDoBlockLogic(Value * self, Value * blockNo) {
    164     Value * byteStreamBlock_ptr = getStreamSetBlockPtr(self, "byteStream", blockNo);
    165     Value * basisBitsBlock_ptr = getStreamSetBlockPtr(self, "basisBits", blockNo);
    166    
    167     Value * s_bytepack[8];
     164    Value * byteStream = getStreamSetBlockPtr(self, "byteStream", blockNo);
     165    Value * basisBits = getStreamSetBlockPtr(self, "basisBits", blockNo);
     166
     167    Value * bytepack[8];
    168168    for (unsigned i = 0; i < 8; i++) {
    169         s_bytepack[i] = iBuilder->CreateBlockAlignedLoad(byteStreamBlock_ptr, {iBuilder->getInt32(0), iBuilder->getInt32(0), iBuilder->getInt32(i)});
     169        bytepack[i] = iBuilder->CreateBlockAlignedLoad(byteStream, {iBuilder->getInt32(0), iBuilder->getInt32(0), iBuilder->getInt32(i)});
    170170    }
    171     Value * p_bitblock[8];
    172     s2p(iBuilder, s_bytepack, p_bitblock);
    173     for (unsigned j = 0; j < 8; ++j) {
    174         iBuilder->CreateBlockAlignedStore(p_bitblock[j], basisBitsBlock_ptr, {iBuilder->getInt32(0), iBuilder->getInt32(j)});
     171    Value * bitblock[8];
     172    s2p(iBuilder, bytepack, bitblock);
     173    for (unsigned i = 0; i < 8; ++i) {
     174        iBuilder->CreateBlockAlignedStore(bitblock[i], basisBits, {iBuilder->getInt32(0), iBuilder->getInt32(i)});
    175175    }
    176176    Value * produced = getProducedItemCount(self);
     
    180180   
    181181void s2pKernel::generateDoBlockMethod() {
    182     IDISA::IDISA_Builder::InsertPoint savePoint = iBuilder->saveIP();
    183     Module * m = iBuilder->getModule();
    184    
    185     Function * doBlockFunction = m->getFunction(mKernelName + doBlock_suffix);
     182    auto savePoint = iBuilder->saveIP();
     183
     184    Function * doBlockFunction = iBuilder->getModule()->getFunction(mKernelName + doBlock_suffix);
    186185   
    187186    iBuilder->SetInsertPoint(BasicBlock::Create(iBuilder->getContext(), "entry", doBlockFunction, 0));
     
    191190   
    192191    generateDoBlockLogic(self, blockNo);
     192
    193193    iBuilder->CreateRetVoid();
    194194    iBuilder->restoreIP(savePoint);
  • icGREP/icgrep-devel/icgrep/kernels/s2p_kernel.h

    r5174 r5202  
    2727    s2pKernel(IDISA::IDISA_Builder * iBuilder) :
    2828    KernelBuilder(iBuilder, "s2p",
    29                   {StreamSetBinding{parabix::StreamSetType(1, parabix::i8), "byteStream"}},
    30                   {StreamSetBinding{parabix::StreamSetType(8, parabix::i1), "basisBits"}},
     29                  {Binding{parabix::StreamSetType(iBuilder,1, 8), "byteStream"}},
     30                  {Binding{parabix::StreamSetType(iBuilder,8, 1), "basisBits"}},
    3131                  {}, {}, {}) {}
    3232   
  • icGREP/icgrep-devel/icgrep/kernels/scanmatchgen.cpp

    r5104 r5202  
    4141       
    4242void scanMatchKernel::generateDoBlockMethod() {
    43     IDISA::IDISA_Builder::InsertPoint savePoint = iBuilder->saveIP();
     43    auto savePoint = iBuilder->saveIP();
    4444    Module * m = iBuilder->getModule();
    4545    Function * scanWordFunction = generateScanWordRoutine(m);
  • icGREP/icgrep-devel/icgrep/kernels/scanmatchgen.h

    r5133 r5202  
    2121    scanMatchKernel(IDISA::IDISA_Builder * iBuilder, bool isNameExpression) :
    2222    KernelBuilder(iBuilder, "scanMatch",
    23                   {StreamSetBinding{parabix::StreamSetType(2, parabix::i1), "matchResults"}},
     23                  {Binding{parabix::StreamSetType(iBuilder,2, 1), "matchResults"}},
    2424                    {},
    25                     {ScalarBinding{iBuilder->getInt8PtrTy(), "FileBuf"}, ScalarBinding{iBuilder->getSizeTy(), "FileSize"}, ScalarBinding{iBuilder->getSizeTy(), "FileIdx"}},
     25                    {Binding{iBuilder->getInt8PtrTy(), "FileBuf"}, Binding{iBuilder->getSizeTy(), "FileSize"}, Binding{iBuilder->getSizeTy(), "FileIdx"}},
    2626                    {},
    27                     {ScalarBinding{iBuilder->getSizeTy(), "BlockNo"}, ScalarBinding{iBuilder->getSizeTy(), "LineStart"}, ScalarBinding{iBuilder->getSizeTy(), "LineNum"}}),
     27                    {Binding{iBuilder->getSizeTy(), "BlockNo"}, Binding{iBuilder->getSizeTy(), "LineStart"}, Binding{iBuilder->getSizeTy(), "LineNum"}}),
    2828
    2929    mScanwordBitWidth(Triple(llvm::sys::getProcessTriple()).isArch32Bit() ? 32 : 64),
  • icGREP/icgrep-devel/icgrep/kernels/stdout_kernel.cpp

    r5195 r5202  
    2424// 1 as the number of blocks to do.
    2525void stdOutKernel::generateDoBlockMethod() {
    26     IDISA::IDISA_Builder::InsertPoint savePoint = iBuilder->saveIP();
     26    auto savePoint = iBuilder->saveIP();
    2727    Module * m = iBuilder->getModule();
    2828    Function * doBlockFunction = m->getFunction(mKernelName + doBlock_suffix);
     
    3838// doSegment method, writes the entire segment with a single write call.
    3939void stdOutKernel::generateDoSegmentMethod() {
    40     IDISA::IDISA_Builder::InsertPoint savePoint = iBuilder->saveIP();
     40    auto savePoint = iBuilder->saveIP();
    4141    Module * m = iBuilder->getModule();
    4242    Function * writefn = create_write(m);
     
    104104
    105105void stdOutKernel::generateFinalBlockMethod() {
    106     IDISA::IDISA_Builder::InsertPoint savePoint = iBuilder->saveIP();
     106    auto savePoint = iBuilder->saveIP();
    107107    Module * m = iBuilder->getModule();
    108108    Function * writefn = create_write(m);
     
    118118    Value * processed = getProcessedItemCount(self);
    119119    Value * itemsAvail = iBuilder->CreateSub(producerPos, processed);
    120     Value * segmentNo = getLogicalSegmentNo(self);
     120//    Value * segmentNo = getLogicalSegmentNo(self);
    121121    Value * blockNo = getScalarField(self, blockNoScalar);
    122122    Value * basePtr = getStreamSetBlockPtr(self, "codeUnitBuffer", blockNo);
  • icGREP/icgrep-devel/icgrep/kernels/stdout_kernel.h

    r5185 r5202  
    1818    stdOutKernel(IDISA::IDISA_Builder * iBuilder, unsigned codeUnitWidth) :
    1919    KernelBuilder(iBuilder, "stdout",
    20                   {StreamSetBinding{parabix::StreamSetType(1, codeUnitWidth), "codeUnitBuffer"}}, {}, {}, {}, {}),
     20                  {Binding{parabix::StreamSetType(iBuilder, 1, codeUnitWidth), "codeUnitBuffer"}}, {}, {}, {}, {}),
    2121    mCodeUnitWidth(codeUnitWidth) {}
    2222   
  • icGREP/icgrep-devel/icgrep/kernels/streamset.cpp

    r5191 r5202  
    1414enum SS_struct_index {iProducer_pos = 0, iConsumer_pos = 1, iEnd_of_input = 2, iBuffer_ptr = 3};
    1515
    16 llvm::Value * parabix::getProducerPosPtr(IDISA::IDISA_Builder * b, Value * bufferStructPtr) {
    17     return b->CreateGEP(bufferStructPtr, {b->getInt32(0), b->getInt32(iProducer_pos)});
    18 }
    19 
    20 llvm::Value * parabix::getConsumerPosPtr(IDISA::IDISA_Builder * b, Value * bufferStructPtr) {
    21     return b->CreateGEP(bufferStructPtr, {b->getInt32(0), b->getInt32(iConsumer_pos)});
    22 }
    23 
    24 llvm::Value * parabix::hasEndOfInputPtr(IDISA::IDISA_Builder * b, Value * bufferStructPtr) {
    25     return b->CreateGEP(bufferStructPtr, {b->getInt32(0), b->getInt32(iEnd_of_input)});
    26 }
    27 
    28 llvm::Value * parabix::getStreamSetBufferPtr(IDISA::IDISA_Builder * b, Value * bufferStructPtr) {
    29     return b->CreateLoad(b->CreateGEP(bufferStructPtr, {b->getInt32(0), b->getInt32(iBuffer_ptr)}));
    30 }
    31 
    32 llvm::Type * StreamSetType::getStreamSetBlockType(IDISA::IDISA_Builder * iBuilder) {
    33     llvm::Type * streamType = mFieldWidth == 1 ? iBuilder->getBitBlockType() : ArrayType::get(iBuilder->getBitBlockType(), mFieldWidth);
    34     return ArrayType::get(streamType, mStreamCount);
    35 }
    36 
    3716llvm::PointerType * StreamSetBuffer::getStreamBufferPointerType() {
    38     return PointerType::get(mStreamSetType.getStreamSetBlockType(iBuilder), mAddrSpace);
     17    return PointerType::get(mStreamSetType, mAddrSpace);
    3918}
    4019
     
    6746}
    6847
    69 
    7048llvm::Value * StreamSetBuffer::getStreamSetStructPtr(){
    7149    return mStreamSetStructPtr;
     
    7553    Type * const size_ty = iBuilder->getSizeTy();
    7654    Type * const int1ty = iBuilder->getInt1Ty();
    77     mStreamSetBufferPtr = iBuilder->CreateCacheAlignedAlloca(mStreamSetType.getStreamSetBlockType(iBuilder), ConstantInt::get(iBuilder->getSizeTy(), mBufferBlocks));
     55    mStreamSetBufferPtr = iBuilder->CreateCacheAlignedAlloca(mStreamSetType, ConstantInt::get(iBuilder->getSizeTy(), mBufferBlocks));
    7856    mStreamSetStructPtr = iBuilder->CreateCacheAlignedAlloca(mStreamSetStructType);
    79     //iBuilder->CallPrintInt("mStreamSetBufferPtr", iBuilder->CreatePtrToInt(mStreamSetBufferPtr, iBuilder->getInt64Ty()));
    80     //iBuilder->CallPrintInt("mStreamSetStructPtr", iBuilder->CreatePtrToInt(mStreamSetStructPtr, iBuilder->getInt64Ty()));
     57
    8158    iBuilder->CreateStore(ConstantInt::get(size_ty, 0), iBuilder->CreateGEP(mStreamSetStructPtr, {iBuilder->getInt32(0), iBuilder->getInt32(iProducer_pos)}));
    8259    iBuilder->CreateStore(ConstantInt::get(size_ty, 0), iBuilder->CreateGEP(mStreamSetStructPtr, {iBuilder->getInt32(0), iBuilder->getInt32(iConsumer_pos)}));
     
    9168    return iBuilder->CreateGEP(iBuilder->CreateLoad(handle), {blockNo});
    9269}
    93 
    94 
    95 
    9670
    9771// Single Block Buffer
     
    199173
    200174    Value * copyBlocks = iBuilder->CreateAdd(iBuilder->CreateSub(lastProducerBlock, new_consumer_block), one);
    201     Constant * blockBytes = ConstantInt::get(iBuilder->getSizeTy(), mStreamSetType.StreamCount() * mStreamSetType.StreamFieldWidth() * iBuilder->getStride()/8);
     175
     176    DataLayout dl(iBuilder->getModule());
     177
     178    Constant * blockBytes = ConstantInt::get(iBuilder->getSizeTy(), dl.getTypeAllocSize(mStreamSetType) * iBuilder->getStride());
    202179    Value * copyLength = iBuilder->CreateMul(copyBlocks, blockBytes);
    203180    //iBuilder->CallPrintInt("memmove copyLength", copyLength);
  • icGREP/icgrep-devel/icgrep/kernels/streamset.h

    r5191 r5202  
    1616enum FieldType {i1 = 1, i2 = 2, i4 = 4, i8 = 8, i16 = 16, i32 = 32, i64 = 64, i128 = 128, i256 = 256};
    1717
    18 class StreamSetType {
    19 public:
    20     StreamSetType(int count, int width) : mStreamCount(count), mFieldWidth(width) {}
    21     int StreamCount() { return mStreamCount;}
    22     int StreamFieldWidth() { return mFieldWidth;}
    23     bool operator== (StreamSetType& other) {return (mStreamCount == other.mStreamCount) && (mFieldWidth == other.mFieldWidth);}
    24    
    25     llvm::Type * getStreamSetBlockType(IDISA::IDISA_Builder * iBuilder);
    26    
    27 private:
    28     int mStreamCount;
    29     int mFieldWidth;
    30 };
     18inline llvm::Type * StreamSetType(IDISA::IDISA_Builder * iBuilder, const unsigned count, const unsigned width) {
     19    llvm::Type * streamType = ((width == 1) ? iBuilder->getBitBlockType() : ArrayType::get(iBuilder->getBitBlockType(), width));
     20    return ArrayType::get(streamType, count);
     21}
    3122
    32    
    3323// Stream Set Structs hold information about the current state
    3424// of a stream set buffer.
    35    
    36 llvm::Value * getProducerPosPtr(IDISA::IDISA_Builder * b, Value * bufferStructPtr);   
     25
     26llvm::Value * getProducerPosPtr(IDISA::IDISA_Builder * b, Value * bufferStructPtr);
    3727llvm::Value * getConsumerPosPtr(IDISA::IDISA_Builder * b, Value * bufferStructPtr);
    38 llvm::Value * hasEndOfInputPtr(IDISA::IDISA_Builder * b, Value * bufferStructPtr);   
    39 llvm::Value * getStreamSetBufferPtr(IDISA::IDISA_Builder * b, Value * bufferStructPtr);   
    40    
     28llvm::Value * hasEndOfInputPtr(IDISA::IDISA_Builder * b, Value * bufferStructPtr);
     29llvm::Value * getStreamSetBufferPtr(IDISA::IDISA_Builder * b, Value * bufferStructPtr);
     30
    4131class StreamSetBuffer {
    4232public:
     33
    4334    enum class BufferKind : unsigned {BlockBuffer, ExternalFileBuffer, CircularBuffer, LinearCopybackBuffer};
     35
    4436    inline BufferKind getBufferKind() const {return mBufferKind;}
    45     inline StreamSetType& getBufferStreamSetType() {return mStreamSetType;}
     37
     38    inline llvm::Type * getBufferStreamSetType() {return mStreamSetType;}
    4639
    4740    llvm::PointerType * getStreamBufferPointerType();
     
    7568   
    7669protected:
    77     StreamSetBuffer(BufferKind k, IDISA::IDISA_Builder * b, StreamSetType ss_type, unsigned blocks, unsigned AddressSpace = 0) :
    78         mBufferKind(k), iBuilder(b), mStreamSetType(ss_type), mBufferBlocks(blocks), mAddrSpace(AddressSpace), mStreamSetBufferPtr(nullptr) {
     70    StreamSetBuffer(BufferKind k, IDISA::IDISA_Builder * b, llvm::Type * type, unsigned blocks, unsigned AddressSpace = 0) :
     71        mBufferKind(k), iBuilder(b), mStreamSetType(type), mBufferBlocks(blocks), mAddrSpace(AddressSpace), mStreamSetBufferPtr(nullptr) {
    7972            mStreamSetStructType =
    8073                StructType::get(iBuilder->getContext(),
     
    8275                                                    iBuilder->getSizeTy(),
    8376                                                    iBuilder->getInt1Ty(),
    84                                                     PointerType::get(mStreamSetType.getStreamSetBlockType(iBuilder), AddressSpace)}));
     77                                                    PointerType::get(type, AddressSpace)}));
    8578    }
    86    
    87     const BufferKind       mBufferKind;
    88     IDISA::IDISA_Builder * iBuilder;
    89     StreamSetType mStreamSetType;
    90     size_t mBufferBlocks;
    91     unsigned mAddrSpace;
    92     llvm::Value * mStreamSetBufferPtr;
    93     llvm::Value * mStreamSetStructPtr;
    94     llvm::Type * mStreamSetStructType;
     79protected:
     80    const BufferKind        mBufferKind;
     81    IDISA::IDISA_Builder *  iBuilder;
     82    llvm::Type *            mStreamSetType;
     83    size_t                  mBufferBlocks;
     84    int                    mAddrSpace;
     85    llvm::Value *           mStreamSetBufferPtr;
     86    llvm::Value *           mStreamSetStructPtr;
     87    llvm::Type *            mStreamSetStructType;
    9588};   
    96    
    9789
    9890class SingleBlockBuffer : public StreamSetBuffer {
    9991public:
    100     static inline bool classof(const StreamSetBuffer * b) {return b->getBufferKind() == BufferKind::BlockBuffer;}
    101    
    102     SingleBlockBuffer(IDISA::IDISA_Builder * b, StreamSetType ss_type) :
    103     StreamSetBuffer(BufferKind::BlockBuffer, b, ss_type, 1, 0) {}
    104     llvm::Value * getStreamSetBlockPointer(llvm::Value * bufferStructPtr, llvm::Value * blockNo) override;
     92    static inline bool classof(const StreamSetBuffer * b) {
     93        return b->getBufferKind() == BufferKind::BlockBuffer;
     94    }   
     95    SingleBlockBuffer(IDISA::IDISA_Builder * b, llvm::Type * type)
     96    : StreamSetBuffer(BufferKind::BlockBuffer, b, type, 1, 0) {
     97
     98    }
     99    llvm::Value * getStreamSetBlockPointer(llvm::Value * bufferBasePtr, llvm::Value * blockNo) override;
    105100};
    106    
     101
    107102class ExternalFileBuffer : public StreamSetBuffer {
    108103public:
    109     static inline bool classof(const StreamSetBuffer * b) {return b->getBufferKind() == BufferKind::ExternalFileBuffer;}
     104    static inline bool classof(const StreamSetBuffer * b) {
     105        return b->getBufferKind() == BufferKind::ExternalFileBuffer;
     106    }
    110107   
    111     ExternalFileBuffer(IDISA::IDISA_Builder * b, StreamSetType ss_type, unsigned AddressSpace = 0) :
    112         StreamSetBuffer(BufferKind::ExternalFileBuffer, b, ss_type, 0, AddressSpace) {}
     108    ExternalFileBuffer(IDISA::IDISA_Builder * b, llvm::Type * type, unsigned AddressSpace = 0)
     109    : StreamSetBuffer(BufferKind::ExternalFileBuffer, b, type, 0, AddressSpace) {
     110
     111    }
    113112
    114113    void setStreamSetBuffer(llvm::Value * ptr, llvm::Value * fileSize);
    115114    void setEmptyBuffer(llvm::Value * buffer_ptr);
    116    
     115
    117116    // Can't allocate - raise an error. */
    118117    llvm::Value * allocateBuffer() override;
     
    123122class CircularBuffer : public StreamSetBuffer {
    124123public:
    125     static inline bool classof(const StreamSetBuffer * b) {return b->getBufferKind() == BufferKind::CircularBuffer;}
     124    static inline bool classof(const StreamSetBuffer * b) {
     125        return b->getBufferKind() == BufferKind::CircularBuffer;
     126    }
    126127 
    127     CircularBuffer(IDISA::IDISA_Builder * b, StreamSetType ss_type, size_t bufferBlocks, unsigned AddressSpace = 0) :
    128         StreamSetBuffer(BufferKind::CircularBuffer, b, ss_type, bufferBlocks, AddressSpace) {
    129             if (((bufferBlocks - 1) & bufferBlocks) != 0) {
    130                 throw std::runtime_error("CircularStreamSetBuffer: number of blocks must be a power of 2!");
    131             }
     128    CircularBuffer(IDISA::IDISA_Builder * b, llvm::Type * type, size_t bufferBlocks, unsigned AddressSpace = 0)
     129    : StreamSetBuffer(BufferKind::CircularBuffer, b, type, bufferBlocks, AddressSpace) {
     130        if (((bufferBlocks - 1) & bufferBlocks) != 0) {
     131            throw std::runtime_error("CircularStreamSetBuffer: number of blocks must be a power of 2!");
    132132        }
    133     llvm::Value * getStreamSetBlockPointer(llvm::Value * bufferStructPtr, llvm::Value * blockNo) override;
     133    }
     134
     135    llvm::Value * getStreamSetBlockPointer(llvm::Value * bufferBasePtr, llvm::Value * blockNo) override;
    134136};
    135137   
     
    141143    static inline bool classof(const StreamSetBuffer * b) {return b->getBufferKind() == BufferKind::LinearCopybackBuffer;}
    142144   
    143     LinearCopybackBuffer(IDISA::IDISA_Builder * b, StreamSetType ss_type, size_t bufferBlocks, unsigned AddressSpace = 0) :
    144         StreamSetBuffer(BufferKind::LinearCopybackBuffer, b, ss_type, bufferBlocks, AddressSpace) {}
     145    LinearCopybackBuffer(IDISA::IDISA_Builder * b, llvm::Type * type, size_t bufferBlocks, unsigned AddressSpace = 0) :
     146        StreamSetBuffer(BufferKind::LinearCopybackBuffer, b, type, bufferBlocks, AddressSpace) {}
    145147   
    146148    llvm::Value * getStreamSetBlockPointer(llvm::Value * bufferStructPtr, llvm::Value * blockNo) override;
     
    150152    void setConsumerPos(Value * bufferStructPtr, Value * new_consumer_pos) override;
    151153};
    152    
    153    
    154154
    155155}
  • icGREP/icgrep-devel/icgrep/pablo/analysis/pabloverifier.cpp

    r5160 r5202  
    1010namespace pablo {
    1111
     12using TypeId = PabloAST::ClassTypeId;
     13
    1214template <typename Type>
    1315using SmallSet = boost::container::flat_set<Type>;
     
    1820 * @brief verifyUseDefInformation
    1921 ** ------------------------------------------------------------------------------------------------------------- */
    20 template<typename VectorType>
    21 inline bool checkVector(const PabloAST * const value, const VectorType & vector, size_t & uses) {
    22     for (auto escapedValue : vector) {
    23         if (escapedValue == value) {
    24             ++uses;
    25             return false;
    26         }
    27     }
    28     return true;
    29 }
    30 
    31 void testUsers(const PabloAST * expr, const ScopeSet & validScopes) {
    32     if (isa<Count>(expr)) { // !! matchedLineCount is not being correctly added to the function !!
    33         return;
    34     }
     22void testUsers(const PabloAST * expr, const ScopeSet & validScopes) {
    3523    size_t uses = 0;
    3624    SmallSet<const PabloAST *> verified;
    3725    for (const PabloAST * use : expr->users()) {
    38         if (LLVM_LIKELY(isa<Statement>(use))) {
    39             if (LLVM_LIKELY(verified.count(use) == 0)) {
    40                 const Statement * const user = cast<Statement>(use);
    41                 // test whether this user is in a block in the program
    42                 if (LLVM_UNLIKELY(validScopes.count(user->getParent()) == 0)) {
    43                     std::string tmp;
    44                     raw_string_ostream str(tmp);
    45                     str << "PabloVerifier: use-def error: ";
    46                     PabloPrinter::print(user, str);
    47                     str << " is a user of ";
    48                     PabloPrinter::print(expr, str);
    49                     if (user->getParent() == nullptr) {
    50                         str << " but is not in any scope.";
    51                     } else {
    52                         str << " but is in a deleted scope.";
    53                     }
    54                     throw std::runtime_error(str.str());
    55                 }
    56                 // expr may be used more than once by the same user.
    57                 bool notFound = true;
    58                 for (unsigned i = 0; i != user->getNumOperands(); ++i) {
    59                     if (user->getOperand(i) == expr) {
     26        if (LLVM_UNLIKELY(verified.count(use) != 0)) {
     27            continue;
     28        }
     29        if (LLVM_UNLIKELY(isa<PabloFunction>(use))) {
     30            const PabloFunction * f = cast<PabloFunction>(use);
     31            bool isParameter = false;
     32            bool isResult = false;
     33            for (unsigned i = 0; i != f->getNumOfParameters(); ++i) {
     34                if (f->getParameter(i) == expr) {
     35                    isParameter = true;
     36                    break;
     37                }
     38            }
     39            for (unsigned i = 0; i != f->getNumOfResults(); ++i) {
     40                if (f->getResult(i) == expr) {
     41                    isResult = true;
     42                    break;
     43                }
     44            }
     45            if (LLVM_UNLIKELY(!(isParameter ^ isResult))) {
     46                std::string tmp;
     47                raw_string_ostream str(tmp);
     48                str << "use-def error: ";
     49                PabloPrinter::print(expr, str);
     50                if (isParameter && isResult) {
     51                    str << " is both a parameter and result of ";
     52                } else {
     53                    str << " is neither a parameter nor result of ";
     54                }
     55                PabloPrinter::print(f, str);
     56                throw std::runtime_error(str.str());
     57            }
     58            ++uses;
     59        } else if (const Statement * const user = dyn_cast<Statement>(use)) {
     60            // test whether this user is in a block in the program
     61            if (LLVM_UNLIKELY(user->getParent() == nullptr || validScopes.count(user->getParent()) == 0)) {
     62                std::string tmp;
     63                raw_string_ostream str(tmp);
     64                str << "use-def error: ";
     65                PabloPrinter::print(user, str);
     66                str << " is a user of ";
     67                PabloPrinter::print(expr, str);
     68                str << " but ";
     69                PabloPrinter::print(use, str);
     70                if (user->getParent() == nullptr) {
     71                    str << " is not defined in any scope.";
     72                } else {
     73                    str << " is in an unreachable scope.";
     74                }
     75                throw std::runtime_error(str.str());
     76            }
     77            // expr may be used more than once by the same user.
     78            bool notFound = true;
     79            for (unsigned i = 0; i != user->getNumOperands(); ++i) {
     80                if (user->getOperand(i) == expr) {
     81                    notFound = false;
     82                    ++uses;
     83                }
     84            }
     85            if (isa<Branch>(user)) {
     86                for (const PabloAST * var : cast<Branch>(user)->getEscaped()) {
     87                    if (var == expr) {
    6088                        notFound = false;
    6189                        ++uses;
    6290                    }
    6391                }
    64                 if (const If * ifNode = dyn_cast<If>(expr)) {
    65                     notFound &= checkVector(user, ifNode->getDefined(), uses);
    66                 } else if (const If * ifNode = dyn_cast<If>(user)) {
    67                     notFound &= checkVector(expr, ifNode->getDefined(), uses);
    68                 } else if (const While * whileNode = dyn_cast<While>(expr)) {
    69                     notFound &= checkVector(user, whileNode->getVariants(), uses);
    70                 } else if (const While * whileNode = dyn_cast<While>(user)) {
    71                     notFound &= checkVector(expr, whileNode->getVariants(), uses);
    72                 } else if (isa<Next>(expr) && isa<Assign>(use)) {
    73                     notFound &= (use != cast<Next>(expr)->getInitial());
    74                 }
    75                 if (LLVM_UNLIKELY(notFound)) {
    76                     std::string tmp;
    77                     raw_string_ostream str(tmp);
    78                     str << "PabloVerifier: use-def error: ";
    79                     PabloPrinter::print(expr, str);
    80                     str << " is not a definition of ";
    81                     PabloPrinter::print(use, str);
    82                     throw std::runtime_error(str.str());
    83                 }
    84                 verified.insert(use);
    85             }
    86         } else if (LLVM_UNLIKELY(isa<PabloFunction>(use))) {
    87             if (LLVM_LIKELY(verified.count(use) == 0)) {
    88                 const PabloFunction * f = cast<PabloFunction>(use);
    89                 bool isParameter = false;
    90                 bool isResult = false;
    91                 for (unsigned i = 0; i != f->getNumOfParameters(); ++i) {
    92                     if (f->getParameter(i) == expr) {
    93                         isParameter = true;
    94                         break;
    95                     }
    96                 }
    97                 for (unsigned i = 0; i != f->getNumOfResults(); ++i) {
    98                     if (f->getResult(i) == expr) {
    99                         isResult = true;
    100                         break;
    101                     }
    102                 }
    103                 if (LLVM_UNLIKELY(!(isParameter ^ isResult))) {
    104                     std::string tmp;
    105                     raw_string_ostream str(tmp);
    106                     str << "PabloVerifier: use-def error: ";
    107                     PabloPrinter::print(expr, str);
    108                     if (isParameter && isResult) {
    109                         str << " is both a parameter and result of ";
    110                     } else {
    111                         str << " is not a parameter or result of ";
    112                     }
    113                     PabloPrinter::print(f, str);
    114                     throw std::runtime_error(str.str());
    115                 }
     92            }
     93            if (LLVM_UNLIKELY(notFound)) {
     94                std::string tmp;
     95                raw_string_ostream str(tmp);
     96                str << "use-def error: ";
     97                PabloPrinter::print(expr, str);
     98                str << " is not a definition of ";
     99                PabloPrinter::print(use, str);
     100                throw std::runtime_error(str.str());
     101            }
     102        } else if (isa<Var>(use)) {
     103            if (LLVM_UNLIKELY(isa<Branch>(expr) || isa<PabloFunction>(expr))) {
    116104                ++uses;
    117                 verified.insert(use);
    118             }
    119         } else {
    120             std::string tmp;
    121             raw_string_ostream str(tmp);
    122             str << "PabloVerifier: use-def error: expression ";
    123             PabloPrinter::print(use, str);
    124             str << " is incorrectly reported as a user of ";
    125             PabloPrinter::print(expr, str);
    126             throw std::runtime_error(str.str());
    127         }
     105            } else {
     106                std::string tmp;
     107                raw_string_ostream str(tmp);
     108                str << "use-def error: var ";
     109                PabloPrinter::print(use, str);
     110                str << " is a user of ";
     111                PabloPrinter::print(expr, str);
     112                str << " but can only be a user of a Branch or Function.";
     113                throw std::runtime_error(str.str());
     114            }
     115        }
     116        verified.insert(use);
    128117    }
    129118    if (LLVM_UNLIKELY(uses != expr->getNumUses())) {
    130119        std::string tmp;
    131120        raw_string_ostream str(tmp);
    132         str << "PabloVerifier: use-def error: ";
     121        str << "use-def error: ";
    133122        PabloPrinter::print(expr, str);
    134123        str << " is reported having " << expr->getNumUses() << " user(s)"
     
    165154        testUsers(stmt, validScopes);
    166155        testDefs(stmt);
    167         if (LLVM_UNLIKELY(isa<If>(stmt) || isa<While>(stmt))) {
    168             verifyUseDefInformation(isa<If>(stmt) ? cast<If>(stmt)->getBody() : cast<While>(stmt)->getBody(), validScopes);
     156        if (LLVM_UNLIKELY(isa<Branch>(stmt))) {
     157            verifyUseDefInformation(cast<Branch>(stmt)->getBody(), validScopes);
    169158        }
    170159    }
     
    174163    validScopes.insert(block);
    175164    for (const Statement * stmt : *block) {
    176         if (LLVM_UNLIKELY(isa<If>(stmt) || isa<While>(stmt))) {
    177             gatherValidScopes(isa<If>(stmt) ? cast<If>(stmt)->getBody() : cast<While>(stmt)->getBody(), validScopes);
     165        if (LLVM_UNLIKELY(isa<Branch>(stmt))) {
     166            gatherValidScopes(cast<Branch>(stmt)->getBody(), validScopes);
    178167        }
    179168    }
     
    184173    gatherValidScopes(function.getEntryBlock(), validScopes);
    185174    for (unsigned i = 0; i < function.getNumOfParameters(); ++i) {
     175        if (LLVM_UNLIKELY(function.getParameter(i) == nullptr)) {
     176            throw std::runtime_error("parameter " + std::to_string(i) + " is Null!");
     177        }
    186178        testUsers(function.getParameter(i), validScopes);
    187179    }
    188180    for (unsigned i = 0; i < function.getNumOfResults(); ++i) {
    189         testDefs(function.getResult(i));
     181        if (LLVM_UNLIKELY(function.getResult(i) == nullptr)) {
     182            throw std::runtime_error("result " + std::to_string(i) + " is Null!");
     183        }
     184        testUsers(function.getResult(i), validScopes);
    190185    }
    191186    verifyUseDefInformation(function.getEntryBlock(), validScopes);
     
    201196            return false;
    202197        }
    203         parent = parent->getPredecessor ();
     198        parent = parent->getPredecessor();
    204199    }
    205200    return true;
    206 }
    207 
    208 /** ------------------------------------------------------------------------------------------------------------- *
    209  * @brief throwUncontainedEscapedValueError
    210  ** ------------------------------------------------------------------------------------------------------------- */
    211 static void throwUncontainedEscapedValueError(const Statement * const stmt, const PabloAST * const value) {
    212     std::string tmp;
    213     raw_string_ostream str(tmp);
    214     str << "PabloVerifier: structure error: escaped value \"";
    215     PabloPrinter::print(value, str);
    216     str << "\" is not contained within the body of ";
    217     PabloPrinter::print(stmt, str);
    218     throw std::runtime_error(str.str());
    219 }
    220 
    221 /** ------------------------------------------------------------------------------------------------------------- *
    222  * @brief throwEscapedValueUsageError
    223  ** ------------------------------------------------------------------------------------------------------------- */
    224 static void throwEscapedValueUsageError(const Statement * const stmt, const PabloAST * const value, const PabloAST * const def, const PabloAST * const user, const unsigned count) {
    225     std::string tmp;
    226     raw_string_ostream str(tmp);
    227     str << "PabloVerifier: structure error: ";
    228     PabloPrinter::print(value, str);
    229     str << " is an escaped value of ";
    230     PabloPrinter::print(stmt, str);
    231     str << " but ";
    232     PabloPrinter::print(user, str);
    233     if (count == 0) {
    234         str << " is not considered a user of ";
    235     } else if (count > 0) {
    236         str << " was recorded too many times (" << count << ") in the user list of ";
    237     }
    238     PabloPrinter::print(def, str);
    239     throw std::runtime_error(str.str());
    240201}
    241202
     
    246207    std::string tmp;
    247208    raw_string_ostream str(tmp);
    248     str << "PabloVerifier: structure error: ";
     209    str << "structure error: ";
    249210    PabloPrinter::print(stmt, str);
    250211    str << " is not contained in its reported scope block";
     
    258219    std::string tmp;
    259220    raw_string_ostream str(tmp);
    260     str << "PabloVerifier: structure error: ";
     221    str << "structure error: ";
    261222    PabloPrinter::print(stmt, str);
    262223    str << " branches into a scope block that reports ";
     
    267228
    268229/** ------------------------------------------------------------------------------------------------------------- *
    269  * @brief throwReflexiveIfConditionError
    270  ** ------------------------------------------------------------------------------------------------------------- */
    271 static void throwReflexiveIfConditionError(const PabloAST * const ifNode) {
    272     std::string tmp;
    273     raw_string_ostream str(tmp);
    274     str << "PabloVerifier: structure error: the condition of ";
    275     PabloPrinter::print(ifNode, str);
    276     str << " cannot be defined by the If node itself.";
    277     throw std::runtime_error(str.str());
     230 * @brief illegalOperandType
     231 ** ------------------------------------------------------------------------------------------------------------- */
     232static inline bool illegalOperandType(const PabloAST * const op) {
     233    switch (op->getClassTypeId()) {
     234        case TypeId::Block:
     235        case TypeId::Function:
     236        case TypeId::Prototype:
     237        case TypeId::Assign:
     238        case TypeId::Call:
     239        case TypeId::SetIthBit:
     240        case TypeId::If:
     241        case TypeId::While:
     242            return true;
     243        default:
     244            return false;
     245    }
    278246}
    279247
     
    287255            std::string tmp;
    288256            raw_string_ostream str(tmp);
    289             str << "PabloVerifier: structure error: ";
    290257            PabloPrinter::print(stmt, str);
    291258            str << " succeeds ";
    292259            PabloPrinter::print(prev, str);
    293             str << " but expects to preceed ";
     260            str << " but ";
     261            PabloPrinter::print(cast<PabloAST>(stmt), str);
     262            str << " expects to succeed ";
    294263            PabloPrinter::print(stmt->getPrevNode(), str);
    295264            throw std::runtime_error(str.str());
     
    299268            std::string tmp;
    300269            raw_string_ostream str(tmp);
    301             str << "PabloVerifier: structure error: ";
    302270            PabloPrinter::print(stmt, str);
    303271            str << " is not contained in its reported scope block";
    304272            throw std::runtime_error(str.str());
    305273        }
    306         if (LLVM_UNLIKELY(isa<If>(stmt) || isa<While>(stmt))) {
    307             const PabloBlock * nested = isa<If>(stmt) ? cast<If>(stmt)->getBody() : cast<While>(stmt)->getBody();
     274
     275        for (unsigned i = 0; i < stmt->getNumOperands(); ++i) {
     276            PabloAST * op = stmt->getOperand(i);
     277            if (LLVM_UNLIKELY(illegalOperandType(op))) {
     278                std::string tmp;
     279                raw_string_ostream str(tmp);
     280                PabloPrinter::print(op, str);
     281                str << " cannot be an operand of ";
     282                PabloPrinter::print(stmt, str);
     283                throw std::runtime_error(str.str());
     284            }
     285        }
     286
     287        if (LLVM_UNLIKELY(isa<Assign>(stmt))) {
     288
     289            PabloAST * const variable = cast<Assign>(stmt)->getVariable();
     290            if (LLVM_UNLIKELY(!isa<Var>(variable) && !isa<Extract>(variable))) {
     291                std::string tmp;
     292                raw_string_ostream out(tmp);
     293                out << "invalid assignment: ";
     294                PabloPrinter::print(stmt, out);
     295                out << "  --- ";
     296                PabloPrinter::print(variable, out);
     297                out << " must be a Var or Extract";
     298                throw std::runtime_error(out.str());
     299            }
     300
     301            PabloAST * const value = cast<Assign>(stmt)->getValue();
     302            if (LLVM_UNLIKELY(variable->getType() != value->getType())) {
     303                std::string tmp;
     304                raw_string_ostream out(tmp);
     305                out << "invalid assignment: ";
     306                PabloPrinter::print(stmt, out);
     307                out << "  --- type of ";
     308                PabloPrinter::print(variable, out);
     309                out << " differs from ";
     310                PabloPrinter::print(value, out);
     311                throw std::runtime_error(out.str());
     312            }
     313
     314        } else if (LLVM_UNLIKELY(isa<Branch>(stmt))) {
     315            const PabloBlock * nested = cast<Branch>(stmt)->getBody();
    308316            if (LLVM_UNLIKELY(nested->getBranch() != stmt)) {
    309317                throwMisreportedBranchError(stmt, nested->getBranch());
    310             } else if (LLVM_UNLIKELY(nested->getPredecessor () != block)) {
     318            } else if (LLVM_UNLIKELY(nested->getPredecessor() != block)) {
    311319                throwReportedScopeError(stmt);
    312             }
    313             if (isa<If>(stmt)) {
    314                 for (const Assign * def : cast<If>(stmt)->getDefined()) {
    315                     if (LLVM_UNLIKELY(def == cast<If>(stmt)->getCondition())) {
    316                         throwReflexiveIfConditionError(stmt);
    317                     } else if (LLVM_UNLIKELY(unreachable(def, nested))) {
    318                         throwUncontainedEscapedValueError(stmt, def);
    319                     }
    320                     unsigned count = std::count(stmt->user_begin(), stmt->user_end(), def);
    321                     if (LLVM_UNLIKELY(count != 1)) {
    322                         throwEscapedValueUsageError(stmt, def, stmt, def, count);
    323                     }
    324                     count = std::count(def->user_begin(), def->user_end(), stmt);
    325                     if (LLVM_UNLIKELY(count != 1)) {
    326                         throwEscapedValueUsageError(stmt, def, def, stmt, count);
    327                     }
    328                 }
    329             } else {
    330                 for (const Next * var : cast<While>(stmt)->getVariants()) {
    331                     if (LLVM_UNLIKELY(unreachable(var, nested))) {
    332                         throwUncontainedEscapedValueError(stmt, var);
    333                     }
    334                     unsigned count = std::count(stmt->user_begin(), stmt->user_end(), var);
    335                     if (LLVM_UNLIKELY(count != 1)) {
    336                         throwEscapedValueUsageError(stmt, var, stmt, var, count);
    337                     }
    338                     count = std::count(var->user_begin(), var->user_end(), stmt);
    339                     if (LLVM_UNLIKELY(count != ((cast<While>(stmt)->getCondition() == var) ? 2 : 1))) {
    340                         throwEscapedValueUsageError(stmt, var, var, stmt, count);
    341                     }
    342                 }
    343320            }
    344321            ++nestingDepth;
     
    381358};
    382359
    383 bool recursivelyDefined(const Statement * const stmt) {
    384     std::queue<const Statement *> Q;
    385     SmallSet<const PabloAST *> V;
    386     V.insert(stmt);
    387     for (const Statement * ancestor = stmt;;) {
    388         for (unsigned i = 0; i != ancestor->getNumOperands(); ++i) {
    389             const PabloAST * op = ancestor->getOperand(i);
    390             if (isa<Statement>(op) && V.count(op) == 0) {
    391                 if (op == stmt) {
    392                     return true;
    393                 }
    394                 Q.push(cast<Statement>(op));
    395                 V.insert(op);
    396             }
    397         }
    398         if (LLVM_UNLIKELY(Q.empty())) {
    399             break;
    400         }
    401         ancestor = Q.front();
    402         Q.pop();
    403     }
    404     return false;
    405 }
    406 
    407360void isTopologicallyOrdered(const PabloBlock * block, const OrderingVerifier & parent) {
    408361    OrderingVerifier ov(parent);
     
    410363        if (LLVM_UNLIKELY(isa<While>(stmt))) {
    411364            isTopologicallyOrdered(cast<While>(stmt)->getBody(), ov);
    412             for (const Next * var : cast<While>(stmt)->getVariants()) {
     365            for (const Var * var : cast<While>(stmt)->getEscaped()) {
    413366                ov.insert(var);
    414367            }
     368        } else if (LLVM_UNLIKELY(isa<Assign>(stmt))) {
     369            ov.insert(cast<Assign>(stmt)->getVariable());
    415370        }
    416371        for (unsigned i = 0; i != stmt->getNumOperands(); ++i) {
     
    418373            if (LLVM_UNLIKELY((isa<Statement>(op) || isa<Var>(op)) && ov.count(op) == 0)) {
    419374                std::string tmp;
    420                 raw_string_ostream str(tmp);
    421                 str << "PabloVerifier: ordering volation: ";
    422                 if (LLVM_UNLIKELY(recursivelyDefined(stmt))) {
    423                     PabloPrinter::print(stmt, str);
    424                     str << " is defined by a recursive function!";
    425                     throw std::runtime_error(str.str());
    426                 }
    427                 // TODO: make this actually test whether the operand is ever defined,
    428                 // or if it was defined in a scope that cannot be reached?
    429 
    430                 str << "function is not topologically ordered! ";
    431                 PabloAST * op = stmt->getOperand(i);
    432                 PabloPrinter::print(op, str);
    433                 if (LLVM_UNLIKELY(isa<Statement>(op) && unreachable(stmt, cast<Statement>(op)->getParent()))) {
    434                     str << " was defined in a scope that is unreachable by ";
     375                raw_string_ostream out(tmp);
     376                if (isa<Var>(op)) {
     377                    PabloPrinter::print(op, out);
     378                    out << " is used by ";
     379                    PabloPrinter::print(stmt, out);
     380                    out << " before being assigned a value.";
    435381                } else {
    436                     str << " was used before definition by ";
    437                 }
    438                 PabloPrinter::print(stmt, str);
    439                 throw std::runtime_error(str.str());
     382                    PabloPrinter::print(op, out);
     383                    if (LLVM_UNLIKELY(isa<Statement>(op) && unreachable(stmt, cast<Statement>(op)->getParent()))) {
     384                        out << " was defined in a scope that is unreachable by ";
     385                    } else {
     386                        out << " was used before definition by ";
     387                    }
     388                    PabloPrinter::print(stmt, out);
     389                }
     390                throw std::runtime_error(out.str());
    440391            }
    441392        }
     
    443394        if (LLVM_UNLIKELY(isa<If>(stmt))) {
    444395            isTopologicallyOrdered(cast<If>(stmt)->getBody(), ov);
    445             for (const Assign * def : cast<If>(stmt)->getDefined()) {
     396            for (const Var * def : cast<If>(stmt)->getEscaped()) {
    446397                ov.insert(def);
    447398            }
     
    454405    for (unsigned i = 0; i != function.getNumOfParameters(); ++i) {
    455406        ov.insert(function.getParameter(i));
     407    }
     408    for (unsigned i = 0; i != function.getNumOfResults(); ++i) {
     409        ov.insert(function.getResult(i));
    456410    }
    457411    isTopologicallyOrdered(function.getEntryBlock(), ov);
     
    468422        out.flush();
    469423        if (location.empty()) {
    470             throw err;
     424            llvm::report_fatal_error(err.what());
    471425        } else {
    472             throw std::runtime_error(std::string(err.what()) + " @ " + location);
    473         }
    474     }
    475 }
    476 
    477 }
     426            llvm::report_fatal_error(std::string(err.what()) + " @ " + location);
     427        }
     428    }
     429}
     430
     431}
  • icGREP/icgrep-devel/icgrep/pablo/builder.cpp

    r5081 r5202  
    11#include <pablo/builder.hpp>
     2// #include <boost/current_function.hpp> // BOOST_CURRENT_FUNCTION
    23
    34namespace pablo {
     
    89        return mPb->NAME(arg); \
    910    } \
    10     inline PabloAST * operator()(PabloAST * arg, const std::string & name) { \
    11         return mPb->NAME(arg, name); \
    12     } \
    1311    inline __##NAME(PabloBlock * pb) : mPb(pb) {} \
    1412private: \
     
    1816PabloAST * result = mExprTable.findUnaryOrCall(std::move(functor), TYPE, ARGS)
    1917
     18#define MAKE_NAMED_UNARY(NAME, TYPE, PREFIX, ARGS...) \
     19struct __##NAME { \
     20    inline PabloAST * operator()(PabloAST * arg) { \
     21        return mPb->NAME(arg, mPrefix); \
     22    } \
     23    inline __##NAME(PabloBlock * pb, const std::string & prefix) : mPb(pb), mPrefix(prefix) {} \
     24private: \
     25    PabloBlock * mPb; \
     26    const std::string & mPrefix; \
     27}; \
     28__##NAME functor(mPb, prefix); \
     29PabloAST * result = mExprTable.findUnaryOrCall(std::move(functor), TYPE, ARGS)
     30
    2031#define MAKE_BINARY(NAME, TYPE, ARGS...) \
    2132struct __##NAME { \
     
    2334        return mPb->NAME(arg1, arg2); \
    2435    } \
    25     inline PabloAST * operator()(PabloAST * arg1, PabloAST * arg2, const std::string & name) { \
    26         return mPb->NAME(arg1, arg2, name); \
    27     } \
    2836    inline __##NAME(PabloBlock * pb) : mPb(pb) {} \
    2937private: \
     
    3341PabloAST * result = mExprTable.findBinaryOrCall(std::move(functor), TYPE, ARGS)
    3442
     43#define MAKE_NAMED_BINARY(NAME, TYPE, PREFIX, ARGS...) \
     44struct __##NAME { \
     45    inline PabloAST * operator()(PabloAST * arg1, PabloAST * arg2) { \
     46        return mPb->NAME(arg1, arg2, mPrefix); \
     47    } \
     48    inline __##NAME(PabloBlock * pb, const std::string & prefix) : mPb(pb), mPrefix(prefix) {} \
     49private: \
     50    PabloBlock * mPb; \
     51    const std::string & mPrefix; \
     52}; \
     53__##NAME functor(mPb, PREFIX); \
     54PabloAST * result = mExprTable.findBinaryOrCall(std::move(functor), TYPE, ARGS)
    3555
    3656#define MAKE_TERNARY(NAME, TYPE, ARGS...) \
     
    3959        return mPb->NAME(arg1, arg2, arg3); \
    4060    } \
    41     inline PabloAST * operator()(PabloAST * arg1, PabloAST * arg2, PabloAST * arg3, const std::string & name) { \
    42         return mPb->NAME(arg1, arg2, arg3, name); \
    43     } \
    4461    inline __##NAME(PabloBlock * pb) : mPb(pb) {} \
    4562private: \
     
    4966PabloAST * result = mExprTable.findTernaryOrCall(std::move(functor), TYPE, ARGS)
    5067
     68#define MAKE_NAMED_TERNARY(NAME, TYPE, PREFIX, ARGS...) \
     69struct __##NAME { \
     70    inline PabloAST * operator()(PabloAST * arg1, PabloAST * arg2, PabloAST * arg3) { \
     71        return mPb->NAME(arg1, arg2, arg3, mPrefix); \
     72    } \
     73    inline __##NAME(PabloBlock * pb, const std::string & prefix) : mPb(pb), mPrefix(prefix) {} \
     74private: \
     75    PabloBlock * mPb; \
     76    const std::string & mPrefix; \
     77}; \
     78__##NAME functor(mPb, PREFIX); \
     79PabloAST * result = mExprTable.findTernaryOrCall(std::move(functor), TYPE, ARGS)
     80
    5181#define MAKE_VARIABLE(NAME, TYPE, ARGS...) \
    5282struct __##NAME { \
     
    5989}; \
    6090__##NAME functor(mPb); \
    61 PabloAST * result = mExprTable.findVariableOrCall(std::move(functor), TYPE, ARGS)
     91PabloAST * result = mExprTable.findVariadicOrCall(std::move(functor), TYPE, ARGS)
     92
     93template<typename Type>
     94static inline Type * isBinary(PabloAST * expr) {
     95    if (isa<Type>(expr) && cast<Type>(expr)->getNumOperands() == 2) {
     96        return cast<Type>(expr);
     97    }
     98    return nullptr;
     99}
     100
     101using TypeId = PabloAST::ClassTypeId;
    62102
    63103Call * PabloBuilder::createCall(Prototype * prototype, const std::vector<PabloAST *> & args) {
     
    68108        throw std::runtime_error("Invalid number of arguments passed into Call object!");
    69109    }
    70     MAKE_VARIABLE(createCall, PabloAST::ClassTypeId::Call, prototype->getName(), args, prototype);
     110    MAKE_VARIABLE(createCall, TypeId::Call, prototype->getName(), args, prototype);
    71111    return cast<Call>(result);
    72112}
    73113
    74114PabloAST * PabloBuilder::createAdvance(PabloAST * expr, PabloAST * shiftAmount) {
    75     MAKE_BINARY(createAdvance, PabloAST::ClassTypeId::Advance, expr, shiftAmount);
    76     return result;
    77 }
    78 
    79 PabloAST * PabloBuilder::createAdvance(PabloAST * expr, PabloAST * shiftAmount, const std::string prefix) {
    80     MAKE_BINARY(createAdvance, PabloAST::ClassTypeId::Advance, expr, shiftAmount, prefix);
    81     return result;
     115    if (isa<Zeroes>(expr) || cast<Integer>(shiftAmount)->value() == 0) {
     116        return expr;
     117    }
     118    MAKE_BINARY(createAdvance, TypeId::Advance, expr, shiftAmount);
     119    return result;
     120}
     121
     122PabloAST * PabloBuilder::createAdvance(PabloAST * expr, PabloAST * shiftAmount, const std::string & prefix) {
     123    if (isa<Zeroes>(expr) || cast<Integer>(shiftAmount)->value() == 0) {
     124        return expr;
     125    }
     126    MAKE_NAMED_BINARY(createAdvance, TypeId::Advance, prefix, expr, shiftAmount);
     127    return result;
     128}
     129
     130Extract * PabloBuilder::createExtract(PabloAST * value, not_null<PabloAST *> index) {
     131    MAKE_BINARY(createExtract, TypeId::Extract, value, index);
     132    return cast<Extract>(result);
     133}
     134
     135Extract * PabloBuilder::createExtract(PabloAST * value, not_null<PabloAST *> index, const std::string & prefix) {
     136    MAKE_NAMED_BINARY(createExtract, TypeId::Extract, prefix, value, index);
     137    return cast<Extract>(result);
    82138}
    83139
    84140PabloAST * PabloBuilder::createLookahead(PabloAST * expr, PabloAST * shiftAmount) {
    85     MAKE_BINARY(createLookahead, PabloAST::ClassTypeId::Lookahead, expr, shiftAmount);
    86     return result;
    87 }
    88 
    89 PabloAST * PabloBuilder::createLookahead(PabloAST * expr, PabloAST * shiftAmount, const std::string prefix) {
    90     MAKE_BINARY(createLookahead, PabloAST::ClassTypeId::Lookahead, expr, shiftAmount, prefix);
     141    if (isa<Zeroes>(expr) || cast<Integer>(shiftAmount)->value() == 0) {
     142        return expr;
     143    }
     144    MAKE_BINARY(createLookahead, TypeId::Lookahead, expr, shiftAmount);
     145    return result;
     146}
     147
     148PabloAST * PabloBuilder::createLookahead(PabloAST * expr, PabloAST * shiftAmount, const std::string & prefix) {
     149    if (isa<Zeroes>(expr) || cast<Integer>(shiftAmount)->value() == 0) {
     150        return expr;
     151    }
     152    MAKE_NAMED_BINARY(createLookahead, TypeId::Lookahead, prefix, expr, shiftAmount);
    91153    return result;
    92154}
    93155
    94156PabloAST * PabloBuilder::createNot(PabloAST * expr) {
    95     MAKE_UNARY(createNot, PabloAST::ClassTypeId::Not, expr);
    96     return result;
    97 }
    98 
    99 PabloAST * PabloBuilder::createNot(PabloAST * expr, const std::string prefix) {
    100     MAKE_UNARY(createNot, PabloAST::ClassTypeId::Not, expr, prefix);
     157    if (isa<Ones>(expr)) {
     158        return createZeroes(expr->getType());
     159    }
     160    else if (isa<Zeroes>(expr)){
     161        return createOnes(expr->getType());
     162    }
     163    else if (Not * not1 = dyn_cast<Not>(expr)) {
     164        return not1->getOperand(0);
     165    }
     166    MAKE_UNARY(createNot, TypeId::Not, expr);
     167    return result;
     168}
     169
     170PabloAST * PabloBuilder::createNot(PabloAST * expr, const std::string & prefix) {
     171    if (isa<Ones>(expr)) {
     172        return createZeroes(expr->getType());
     173    }
     174    else if (isa<Zeroes>(expr)){
     175        return createOnes(expr->getType());
     176    }
     177    else if (Not * not1 = dyn_cast<Not>(expr)) {
     178        return not1->getOperand(0);
     179    }
     180    MAKE_NAMED_UNARY(createNot, TypeId::Not, prefix, expr);
     181    return result;
     182}
     183
     184PabloAST * PabloBuilder::createCount(PabloAST * expr) {
     185    MAKE_UNARY(createCount, TypeId::Count, expr);
     186    return result;
     187}
     188
     189PabloAST * PabloBuilder::createCount(PabloAST * expr, const std::string & prefix) {
     190    MAKE_NAMED_UNARY(createCount, TypeId::Count, prefix, expr);
     191    return result;
     192}
     193
     194PabloAST * PabloBuilder::createAssign(PabloAST * const variable, PabloAST * const value) {
     195    MAKE_BINARY(createAssign, TypeId::Assign, variable, value);
    101196    return result;
    102197}
    103198
    104199PabloAST * PabloBuilder::createAnd(PabloAST * expr1, PabloAST * expr2) {
    105     assert (expr1);
    106     assert (expr2);
    107     if (isa<Not>(expr1) || expr1 > expr2) {
    108         std::swap(expr1, expr2);
    109     }
    110     MAKE_BINARY(createAnd, PabloAST::ClassTypeId::And, expr1, expr2);
    111     return result;
    112 }
    113 
    114 PabloAST * PabloBuilder::createAnd(PabloAST * expr1, PabloAST * expr2, const std::string prefix) {
    115     assert (expr1);
    116     assert (expr2);
    117     if (isa<Not>(expr1) || expr1 > expr2) {
    118         std::swap(expr1, expr2);
    119     }
    120     MAKE_BINARY(createAnd, PabloAST::ClassTypeId::And, expr1, expr2, prefix);
    121     return result;
    122 }
    123 
    124 PabloAST * PabloBuilder::createOr(PabloAST * expr1, PabloAST * expr2) {
    125     assert (expr1);
    126     assert (expr2);
     200    if (isa<Zeroes>(expr2) || isa<Ones>(expr1)) {
     201        return expr2;
     202    } else if (isa<Zeroes>(expr1) || isa<Ones>(expr2) || equals(expr1, expr2)){
     203        return expr1;
     204    } else if (Not * not1 = dyn_cast<Not>(expr1)) {
     205        if (Not * not2 = dyn_cast<Not>(expr2)) {
     206            return createNot(createOr(not1->getOperand(0), not2->getOperand(0)));
     207        } else if (equals(not1->getOperand(0), expr2)) {
     208            return createZeroes(expr1->getType());
     209        }
     210    } else if (Not * not2 = dyn_cast<Not>(expr2)) {
     211        if (equals(expr1, not2->getOperand(0))) {
     212            return createZeroes(expr1->getType());
     213        }
     214    } else if (Or * or1 = isBinary<Or>(expr1)) {
     215        if (equals(or1->getOperand(0), expr2) || equals(or1->getOperand(1), expr2)) {
     216            return expr2;
     217        }
     218    } else if (Or * or2 = isBinary<Or>(expr2)) {
     219        if (equals(or2->getOperand(0), expr1) || equals(or2->getOperand(1), expr1)) {
     220            return expr1;
     221        }
     222    }
    127223    if (expr1 > expr2) {
    128224        std::swap(expr1, expr2);
    129225    }
    130     MAKE_BINARY(createOr, PabloAST::ClassTypeId::Or, expr1, expr2);
    131     return result;
    132 }
    133 
    134 PabloAST * PabloBuilder::createOr(PabloAST * expr1, PabloAST * expr2, const std::string prefix) {
    135     assert (expr1);
    136     assert (expr2);
     226    MAKE_BINARY(createAnd, TypeId::And, expr1, expr2);
     227    return result;
     228}
     229
     230PabloAST * PabloBuilder::createAnd(PabloAST * expr1, PabloAST * expr2, const std::string & prefix) {
     231    if (isa<Zeroes>(expr2) || isa<Ones>(expr1)) {
     232        return expr2;
     233    } else if (isa<Zeroes>(expr1) || isa<Ones>(expr2) || equals(expr1, expr2)){
     234        return expr1;
     235    } else if (Not * not1 = dyn_cast<Not>(expr1)) {
     236        if (Not * not2 = dyn_cast<Not>(expr2)) {
     237            return createNot(createOr(not1->getOperand(0), not2->getOperand(0)), prefix);
     238        } else if (equals(not1->getOperand(0), expr2)) {
     239            return createZeroes(expr1->getType());
     240        }
     241    } else if (Not * not2 = dyn_cast<Not>(expr2)) {
     242        if (equals(expr1, not2->getOperand(0))) {
     243            return createZeroes(expr1->getType());
     244        }
     245    } else if (Or * or1 = isBinary<Or>(expr1)) {
     246        if (equals(or1->getOperand(0), expr2) || equals(or1->getOperand(1), expr2)) {
     247            return expr2;
     248        }
     249    } else if (Or * or2 = isBinary<Or>(expr2)) {
     250        if (equals(or2->getOperand(0), expr1) || equals(or2->getOperand(1), expr1)) {
     251            return expr1;
     252        }
     253    }
    137254    if (expr1 > expr2) {
    138255        std::swap(expr1, expr2);
    139256    }
    140     MAKE_BINARY(createOr, PabloAST::ClassTypeId::Or, expr1, expr2, prefix);
    141     return result;
    142 }
    143 
    144 PabloAST * PabloBuilder::createXor(PabloAST * expr1, PabloAST * expr2) {
    145     assert (expr1);
    146     assert (expr2);
     257    MAKE_NAMED_BINARY(createAnd, TypeId::And, prefix, expr1, expr2);
     258    return result;
     259}
     260
     261PabloAST * PabloBuilder::createOr(PabloAST * expr1, PabloAST * expr2) {
     262    if (isa<Zeroes>(expr1) || isa<Ones>(expr2)){
     263        return expr2;
     264    }
     265    if (isa<Zeroes>(expr2) || isa<Ones>(expr1) || equals(expr1, expr2)) {
     266        return expr1;
     267    } else if (Not * not1 = dyn_cast<Not>(expr1)) {
     268        // ¬a√b = ¬¬(¬a √ b) = ¬(a ∧ ¬b)
     269        return createNot(createAnd(not1->getOperand(0), createNot(expr2)));
     270    } else if (Not * not2 = dyn_cast<Not>(expr2)) {
     271        // a√¬b = ¬¬(¬b √ a) = ¬(b ∧ ¬a)
     272        return createNot(createAnd(not2->getOperand(0), createNot(expr1)));
     273    } else if (equals(expr1, expr2)) {
     274        return expr1;
     275    } else if (And * and1 = isBinary<And>(expr1)) {
     276        PabloAST * const expr1a = and1->getOperand(0);
     277        PabloAST * const expr1b = and1->getOperand(1);
     278        if (And * and2 = isBinary<And>(expr2)) {
     279            PabloAST * const expr2a = and2->getOperand(0);
     280            PabloAST * const expr2b = and2->getOperand(1);
     281            //These optimizations factor out common components that can occur when sets are formed by union
     282            //(e.g., union of [a-z] and [A-Z].
     283            if (equals(expr1a, expr2a)) {
     284                return createAnd(expr1a, createOr(expr1b, expr2b));
     285            } else if (equals(expr1b, expr2b)) {
     286                return createAnd(expr1b, createOr(expr1a, expr2a));
     287            } else if (equals(expr1a, expr2b)) {
     288                return createAnd(expr1a, createOr(expr1b, expr2a));
     289            } else if (equals(expr1b, expr2a)) {
     290                return createAnd(expr1b, createOr(expr1a, expr2b));
     291            }
     292        } else if (equals(expr1a, expr2) || equals(expr1b, expr2)) {
     293            // (a ∧ b) √ a = a
     294            return expr2;
     295        }
     296    } else if (And * and2 = isBinary<And>(expr2)) {
     297        if (equals(and2->getOperand(0), expr1) || equals(and2->getOperand(1), expr1)) {
     298            return expr1;
     299        }
     300    }
    147301    if (expr1 > expr2) {
    148302        std::swap(expr1, expr2);
    149303    }
    150     MAKE_BINARY(createXor, PabloAST::ClassTypeId::Xor, expr1, expr2);
    151     return result;
    152 }
    153 
    154 PabloAST * PabloBuilder::createXor(PabloAST * expr1, PabloAST * expr2, const std::string prefix) {
    155     assert (expr1);
    156     assert (expr2);
     304    MAKE_BINARY(createOr, TypeId::Or, expr1, expr2);
     305    return result;
     306}
     307
     308PabloAST * PabloBuilder::createOr(PabloAST * expr1, PabloAST * expr2, const std::string & prefix) {
     309    if (isa<Zeroes>(expr1) || isa<Ones>(expr2)){
     310        return expr2;
     311    }
     312    if (isa<Zeroes>(expr2) || isa<Ones>(expr1) || equals(expr1, expr2)) {
     313        return expr1;
     314    } else if (Not * not1 = dyn_cast<Not>(expr1)) {
     315        // ¬a√b = ¬¬(¬a √ b) = ¬(a ∧ ¬b)
     316        return createNot(createAnd(not1->getOperand(0), createNot(expr2)), prefix);
     317    } else if (Not * not2 = dyn_cast<Not>(expr2)) {
     318        // a√¬b = ¬¬(¬b √ a) = ¬(b ∧ ¬a)
     319        return createNot(createAnd(not2->getOperand(0), createNot(expr1)), prefix);
     320    } else if (equals(expr1, expr2)) {
     321        return expr1;
     322    } else if (And * and1 = isBinary<And>(expr1)) {
     323        PabloAST * const expr1a = and1->getOperand(0);
     324        PabloAST * const expr1b = and1->getOperand(1);
     325        if (And * and2 = isBinary<And>(expr2)) {
     326            PabloAST * const expr2a = and2->getOperand(0);
     327            PabloAST * const expr2b = and2->getOperand(1);
     328            //These optimizations factor out common components that can occur when sets are formed by union
     329            //(e.g., union of [a-z] and [A-Z].
     330            if (equals(expr1a, expr2a)) {
     331                return createAnd(expr1a, createOr(expr1b, expr2b), prefix);
     332            } else if (equals(expr1b, expr2b)) {
     333                return createAnd(expr1b, createOr(expr1a, expr2a), prefix);
     334            } else if (equals(expr1a, expr2b)) {
     335                return createAnd(expr1a, createOr(expr1b, expr2a), prefix);
     336            } else if (equals(expr1b, expr2a)) {
     337                return createAnd(expr1b, createOr(expr1a, expr2b), prefix);
     338            }
     339        } else if (equals(expr1a, expr2) || equals(expr1b, expr2)) {
     340            // (a ∧ b) √ a = a
     341            return expr2;
     342        }
     343    } else if (And * and2 = isBinary<And>(expr2)) {
     344        if (equals(and2->getOperand(0), expr1) || equals(and2->getOperand(1), expr1)) {
     345            return expr1;
     346        }
     347    }
    157348    if (expr1 > expr2) {
    158349        std::swap(expr1, expr2);
    159350    }
    160     MAKE_BINARY(createXor, PabloAST::ClassTypeId::Xor, expr1, expr2, prefix);
     351    MAKE_NAMED_BINARY(createOr, TypeId::Or, prefix, expr1, expr2);
     352    return result;
     353}
     354
     355PabloAST * PabloBuilder::createXor(PabloAST * expr1, PabloAST * expr2) {
     356    if (expr1 == expr2) {
     357        return createZeroes(expr1->getType());
     358    } else if (isa<Ones>(expr1)) {
     359        return createNot(expr2);
     360    } else if (isa<Zeroes>(expr1)){
     361        return expr2;
     362    } else if (isa<Ones>(expr2)) {
     363        return createNot(expr1);
     364    } else if (isa<Zeroes>(expr2)){
     365        return expr1;
     366    } else if (Not * not1 = dyn_cast<Not>(expr1)) {
     367        if (Not * not2 = dyn_cast<Not>(expr2)) {
     368            return createXor(not1->getOperand(0), not2->getOperand(0));
     369        }
     370    }
     371    if (expr1 > expr2) {
     372        std::swap(expr1, expr2);
     373    }
     374    MAKE_BINARY(createXor, TypeId::Xor, expr1, expr2);
     375    return result;
     376}
     377
     378PabloAST * PabloBuilder::createXor(PabloAST * expr1, PabloAST * expr2, const std::string & prefix) {
     379    if (expr1 == expr2) {
     380        return createZeroes(expr1->getType());
     381    } else if (isa<Ones>(expr1)) {
     382        return createNot(expr2);
     383    } else if (isa<Zeroes>(expr1)){
     384        return expr2;
     385    } else if (isa<Ones>(expr2)) {
     386        return createNot(expr1);
     387    } else if (isa<Zeroes>(expr2)){
     388        return expr1;
     389    } else if (Not * not1 = dyn_cast<Not>(expr1)) {
     390        if (Not * not2 = dyn_cast<Not>(expr2)) {
     391            return createXor(not1->getOperand(0), not2->getOperand(0), prefix);
     392        }
     393    }
     394    if (expr1 > expr2) {
     395        std::swap(expr1, expr2);
     396    }
     397    MAKE_NAMED_BINARY(createXor, TypeId::Xor, prefix, expr1, expr2);
    161398    return result;
    162399}
    163400
    164401PabloAST * PabloBuilder::createInFile(PabloAST * expr) {
    165     MAKE_UNARY(createInFile, PabloAST::ClassTypeId::InFile, expr);
    166     return result;
    167 }
    168 
    169 PabloAST * PabloBuilder::createInFile(PabloAST * expr, const std::string prefix) {
    170     MAKE_UNARY(createInFile, PabloAST::ClassTypeId::InFile, expr, prefix);
     402    MAKE_UNARY(createInFile, TypeId::InFile, expr);
     403    return result;
     404}
     405
     406PabloAST * PabloBuilder::createInFile(PabloAST * expr, const std::string & prefix) {
     407    MAKE_NAMED_UNARY(createInFile, TypeId::InFile, prefix, expr);
    171408    return result;
    172409}
    173410
    174411PabloAST * PabloBuilder::createAtEOF(PabloAST * expr) {
    175     MAKE_UNARY(createAtEOF, PabloAST::ClassTypeId::AtEOF, expr);
    176     return result;
    177 }
    178 
    179 PabloAST * PabloBuilder::createAtEOF(PabloAST * expr, const std::string prefix) {
    180     MAKE_UNARY(createAtEOF, PabloAST::ClassTypeId::AtEOF, expr, prefix);
     412    MAKE_UNARY(createAtEOF, TypeId::AtEOF, expr);
     413    return result;
     414}
     415
     416PabloAST * PabloBuilder::createAtEOF(PabloAST * expr, const std::string & prefix) {
     417    MAKE_NAMED_UNARY(createAtEOF, TypeId::AtEOF, prefix, expr);
    181418    return result;
    182419}
    183420
    184421PabloAST * PabloBuilder::createMatchStar(PabloAST * marker, PabloAST * charclass) {
    185 MAKE_BINARY(createMatchStar, PabloAST::ClassTypeId::MatchStar, marker, charclass);
    186 return result;
    187 }
    188 
    189 PabloAST * PabloBuilder::createMatchStar(PabloAST * marker, PabloAST * charclass, const std::string prefix) {
    190     MAKE_BINARY(createMatchStar, PabloAST::ClassTypeId::MatchStar, marker, charclass, prefix);
     422    if (isa<Zeroes>(marker) || isa<Zeroes>(charclass)) {
     423        return marker;
     424    }
     425    MAKE_BINARY(createMatchStar, TypeId::MatchStar, marker, charclass);
     426    return result;
     427}
     428
     429PabloAST * PabloBuilder::createMatchStar(PabloAST * marker, PabloAST * charclass, const std::string & prefix) {
     430    if (isa<Zeroes>(marker) || isa<Zeroes>(charclass)) {
     431        return marker;
     432    }
     433    MAKE_NAMED_BINARY(createMatchStar, TypeId::MatchStar, prefix, marker, charclass);
    191434    return result;
    192435}
    193436
    194437PabloAST * PabloBuilder::createScanThru(PabloAST * from, PabloAST * thru) {
    195     MAKE_BINARY(createScanThru, PabloAST::ClassTypeId::ScanThru, from, thru);
    196     return result;
    197 }
    198 
    199 PabloAST * PabloBuilder::createScanThru(PabloAST * from, PabloAST * thru, const std::string prefix) {
    200     MAKE_BINARY(createScanThru, PabloAST::ClassTypeId::ScanThru, from, thru, prefix);
     438    if (isa<Zeroes>(from) || isa<Zeroes>(thru)) {
     439        return from;
     440    }
     441    MAKE_BINARY(createScanThru, TypeId::ScanThru, from, thru);
     442    return result;
     443}
     444
     445PabloAST * PabloBuilder::createScanThru(PabloAST * from, PabloAST * thru, const std::string & prefix) {
     446    if (isa<Zeroes>(from) || isa<Zeroes>(thru)) {
     447        return from;
     448    }
     449    MAKE_NAMED_BINARY(createScanThru, TypeId::ScanThru, prefix, from, thru);
    201450    return result;
    202451}
     
    204453
    205454PabloAST * PabloBuilder::createSel(PabloAST * condition, PabloAST * trueExpr, PabloAST * falseExpr) {
    206     MAKE_TERNARY(createSel, PabloAST::ClassTypeId::Sel, condition, trueExpr, falseExpr);
    207     return result;
    208 }
    209 
    210 PabloAST * PabloBuilder::createSel(PabloAST * condition, PabloAST * trueExpr, PabloAST * falseExpr, const std::string prefix) {
    211     MAKE_TERNARY(createSel, PabloAST::ClassTypeId::Sel, condition, trueExpr, falseExpr, prefix);
    212     return result;
    213 }
    214 
    215 }
     455    if (isa<Ones>(condition)) {
     456        return trueExpr;
     457    } else if (isa<Zeroes>(condition)){
     458        return falseExpr;
     459    } else if (isa<Ones>(trueExpr)) {
     460        return createOr(condition, falseExpr);
     461    } else if (isa<Zeroes>(trueExpr)){
     462        return createAnd(createNot(condition), falseExpr);
     463    } else if (isa<Ones>(falseExpr)) {
     464        return createOr(createNot(condition), trueExpr);
     465    } else if (isa<Zeroes>(falseExpr)){
     466        return createAnd(condition, trueExpr);
     467    } else if (equals(trueExpr, falseExpr)) {
     468        return trueExpr;
     469    } else if (isa<Not>(trueExpr) && equals(cast<Not>(trueExpr)->getOperand(0), falseExpr)) {
     470        return createXor(condition, falseExpr);
     471    } else if (isa<Not>(falseExpr) && equals(trueExpr, cast<Not>(falseExpr)->getOperand(0))){
     472        return createXor(condition, trueExpr);
     473    }
     474    MAKE_TERNARY(createSel, TypeId::Sel, condition, trueExpr, falseExpr);
     475    return result;
     476}
     477
     478PabloAST * PabloBuilder::createSel(PabloAST * condition, PabloAST * trueExpr, PabloAST * falseExpr, const std::string & prefix) {
     479    if (isa<Ones>(condition)) {
     480        return trueExpr;
     481    } else if (isa<Zeroes>(condition)){
     482        return falseExpr;
     483    } else if (isa<Ones>(trueExpr)) {
     484        return createOr(condition, falseExpr);
     485    } else if (isa<Zeroes>(trueExpr)){
     486        return createAnd(createNot(condition), falseExpr);
     487    } else if (isa<Ones>(falseExpr)) {
     488        return createOr(createNot(condition), trueExpr);
     489    } else if (isa<Zeroes>(falseExpr)){
     490        return createAnd(condition, trueExpr);
     491    } else if (equals(trueExpr, falseExpr)) {
     492        return trueExpr;
     493    } else if (isa<Not>(trueExpr) && equals(cast<Not>(trueExpr)->getOperand(0), falseExpr)) {
     494        return createXor(condition, falseExpr);
     495    } else if (isa<Not>(falseExpr) && equals(trueExpr, cast<Not>(falseExpr)->getOperand(0))){
     496        return createXor(condition, trueExpr);
     497    }
     498    MAKE_NAMED_TERNARY(createSel, TypeId::Sel, prefix, condition, trueExpr, falseExpr);
     499    return result;
     500}
     501
     502}
  • icGREP/icgrep-devel/icgrep/pablo/builder.hpp

    r5160 r5202  
    1010public:
    1111
    12     explicit PabloBuilder(PabloBlock * block) : mPb(block), mParent(nullptr), mExprTable(nullptr) {}
    13 
    14     explicit PabloBuilder(PabloBlock * block, PabloBuilder & parent) : mPb(block), mParent(&parent), mExprTable(&(parent.mExprTable)) {}
    15 
    16     PabloBuilder(PabloBuilder && builder) : mPb(builder.mPb), mParent(builder.mParent), mExprTable(std::move(builder.mExprTable)) {}
     12    template<typename T>
     13    struct not_null {
     14        inline not_null(T const value) : _value(value) { assert(_value); }
     15        inline not_null(std::nullptr_t) = delete;
     16        inline not_null(unsigned) = delete;
     17        operator T() const { return _value; }
     18        T operator-> () const { return _value; }
     19        T get() const { return _value; }
     20    private:
     21        T const  _value;
     22    };
     23
     24    explicit PabloBuilder(PabloBlock * block)
     25    : mPb(block), mParent(nullptr), mExprTable(nullptr) {
     26
     27    }
    1728
    1829    PabloBuilder & operator=(PabloBuilder) = delete;
    1930
    2031    PabloBuilder & operator=(PabloBuilder &) = delete;
     32
     33    PabloBuilder(PabloBuilder && builder)
     34    : mPb(builder.mPb)
     35    , mParent(builder.mParent)
     36    , mExprTable(std::move(builder.mExprTable)) {
     37
     38    }
    2139
    2240    PabloBuilder & operator=(PabloBuilder && builder) {
     
    3957    }
    4058
    41     inline Zeroes * createZeroes(const PabloType * const type = nullptr) {
     59    inline Zeroes * createZeroes(Type * const type = nullptr) {
    4260        return mPb->createZeroes(type);
    4361    }
    4462
    45     inline Ones * createOnes(const PabloType * const type = nullptr) {
     63    inline Ones * createOnes(Type * const type = nullptr) {
    4664        return mPb->createOnes(type);
    4765    }
    4866
    49     inline Var * createVar(const std::string name, const PabloType * const type) {
     67    inline Var * createVar(const std::string name, Type * const type = nullptr) {
     68        return createVar(makeName(name), type);
     69    }
     70
     71    inline Var * createVar(const std::string name, PabloAST * value) {
     72        Var * var = createVar(name, value->getType());
     73        createAssign(var, value);
     74        return var;
     75    }
     76
     77    inline Var * createVar(String * const name, Type * const type = nullptr) {
    5078        return mPb->createVar(name, type);
    5179    }
    5280
    53     inline Var * createVar(String * const name, const PabloType * const type) {
    54         return mPb->createVar(name, type);
    55     }
    56 
    57     inline Var * createVar(PabloAST * const name, const PabloType * const type) {
    58         return mPb->createVar(name, type);
     81    Extract * createExtract(PabloAST * value, not_null<PabloAST *> index);
     82
     83    inline Extract * createExtract(PabloAST * value, const Integer::Type index) {
     84        return createExtract(value, getInteger(index));
     85    }
     86
     87    Extract * createExtract(PabloAST * value, not_null<PabloAST *> index, const std::string & prefix);
     88
     89    inline Extract * createExtract(PabloAST * value, const Integer::Type index, const std::string & prefix) {
     90        return createExtract(value, getInteger(index), prefix);
    5991    }
    6092
     
    6597    Call * createCall(Prototype * prototype, const std::vector<PabloAST *> &vars);
    6698
    67     Assign * createAssign(const std::string && prefix, PabloAST * expr) {
    68         return mPb->createAssign(std::move(prefix), expr);
    69     }
    70 
    7199    inline PabloAST * createAdvance(PabloAST * expr, const Integer::Type shiftAmount) {
    72         if (shiftAmount == 0) {
    73             return expr;
    74         }
    75100        return createAdvance(expr, mPb->getInteger(shiftAmount));
    76101    }
     
    78103    PabloAST * createAdvance(PabloAST * expr, PabloAST * shiftAmount);
    79104
    80     inline PabloAST * createAdvance(PabloAST * expr, const Integer::Type shiftAmount, const std::string prefix) {
    81         if (shiftAmount == 0) {
    82             return expr;
    83         }
     105    inline PabloAST * createAdvance(PabloAST * expr, const Integer::Type shiftAmount, const std::string & prefix) {
    84106        return createAdvance(expr, mPb->getInteger(shiftAmount), prefix);
    85107    }
    86108
    87     PabloAST * createAdvance(PabloAST * expr, PabloAST * shiftAmount, const std::string prefix);
     109    PabloAST * createAdvance(PabloAST * expr, PabloAST * shiftAmount, const std::string & prefix);
    88110
    89111    inline PabloAST * createLookahead(PabloAST * expr, const Integer::Type shiftAmount) {
     
    96118    PabloAST * createLookahead(PabloAST * expr, PabloAST * shiftAmount);
    97119
    98     inline PabloAST * createLookahead(PabloAST * expr, const Integer::Type shiftAmount, const std::string prefix) {
     120    inline PabloAST * createLookahead(PabloAST * expr, const Integer::Type shiftAmount, const std::string & prefix) {
    99121        if (shiftAmount == 0) {
    100122            return expr;
     
    103125    }
    104126
    105     PabloAST * createLookahead(PabloAST * expr, PabloAST * shiftAmount, const std::string prefix);
    106 
    107     inline Next * createNext(Assign * assign, PabloAST * expr) {
    108         return mPb->createNext(assign, expr);
    109     }
     127    PabloAST * createLookahead(PabloAST * expr, PabloAST * shiftAmount, const std::string & prefix);
     128
     129    PabloAST * createAssign(PabloAST * const variable, PabloAST * const value);
    110130
    111131    PabloAST * createAnd(PabloAST * expr1, PabloAST * expr2);
    112132
    113     PabloAST * createAnd(PabloAST * expr1, PabloAST * expr2, const std::string prefix);
     133    PabloAST * createAnd(PabloAST * expr1, PabloAST * expr2, const std::string & prefix);
    114134
    115135    PabloAST * createNot(PabloAST * expr);
    116136
    117     PabloAST * createNot(PabloAST * expr, const std::string prefix);
     137    PabloAST * createNot(PabloAST * expr, const std::string & prefix);
    118138
    119139    PabloAST * createOr(PabloAST * expr1, PabloAST * expr2);
    120140
    121     PabloAST * createOr(PabloAST * expr1, PabloAST * expr2, const std::string prefix);
     141    PabloAST * createOr(PabloAST * expr1, PabloAST * expr2, const std::string & prefix);
    122142
    123143    PabloAST * createXor(PabloAST * expr1, PabloAST * expr2);
    124144
    125     PabloAST * createXor(PabloAST * expr1, PabloAST * expr2, const std::string prefix);
     145    PabloAST * createXor(PabloAST * expr1, PabloAST * expr2, const std::string & prefix);
    126146
    127147    PabloAST * createMatchStar(PabloAST * marker, PabloAST * charclass);
    128148
    129     PabloAST * createMatchStar(PabloAST * marker, PabloAST * charclass, const std::string prefix);
     149    PabloAST * createMatchStar(PabloAST * marker, PabloAST * charclass, const std::string & prefix);
    130150
    131151    PabloAST * createScanThru(PabloAST * from, PabloAST * thru);
    132152
    133     PabloAST * createScanThru(PabloAST * from, PabloAST * thru, const std::string prefix);
     153    PabloAST * createScanThru(PabloAST * from, PabloAST * thru, const std::string & prefix);
    134154
    135155    PabloAST * createSel(PabloAST * condition, PabloAST * trueExpr, PabloAST * falseExpr);
    136156
    137     PabloAST * createSel(PabloAST * condition, PabloAST * trueExpr, PabloAST * falseExpr, const std::string prefix);
    138    
    139     Count * createCount(const std::string counter, PabloAST * expr) {
    140         return mPb->createCount(counter, expr);
    141     }
    142    
     157    PabloAST * createSel(PabloAST * condition, PabloAST * trueExpr, PabloAST * falseExpr, const std::string & prefix);
     158
     159    PabloAST * createCount(PabloAST * expr);
     160   
     161    PabloAST * createCount(PabloAST * expr, const std::string & prefix);
     162
    143163    PabloAST * createInFile(PabloAST * expr);
    144164   
    145     PabloAST * createInFile(PabloAST * expr, const std::string prefix);
     165    PabloAST * createInFile(PabloAST * expr, const std::string & prefix);
    146166   
    147167    PabloAST * createAtEOF(PabloAST * expr);
    148168   
    149     PabloAST * createAtEOF(PabloAST * expr, const std::string prefix);
    150    
    151     /// CreateIf Wrappers
    152 
    153     inline If * createIf(PabloAST * condition, std::initializer_list<Assign *> definedVars, PabloBlock * body) {
    154         return mPb->createIf(condition, std::move(definedVars), body);
    155     }
    156 
    157     inline If * createIf(PabloAST * condition, const std::vector<Assign *> & definedVars, PabloBlock * body) {
    158         return mPb->createIf(condition, definedVars, body);
    159     }
    160 
    161     inline If * createIf(PabloAST * condition, std::vector<Assign *> && definedVars, PabloBlock * body) {
    162         return mPb->createIf(condition, std::move(definedVars), body);
    163     }
    164 
    165     inline If * createIf(PabloAST * condition, std::initializer_list<Assign *> definedVars, PabloBuilder & builder) {
    166         return mPb->createIf(condition, std::move(definedVars), builder.mPb);
    167     }
    168 
    169     inline If * createIf(PabloAST * condition, const std::vector<Assign *> & definedVars, PabloBuilder & builder) {
    170         return mPb->createIf(condition, definedVars, builder.mPb);
    171     }
    172 
    173     inline If * createIf(PabloAST * condition, std::vector<Assign *> && definedVars, PabloBuilder & builder) {
    174         return mPb->createIf(condition, std::move(definedVars), builder.mPb);
    175     }
    176 
    177     /// CreateWhile Wrappers
    178 
    179     inline While * createWhile(PabloAST * condition, const std::initializer_list<Next *> nextVars, PabloBlock * body) {
    180         return mPb->createWhile(condition, nextVars, body);
    181     }
    182 
    183     inline While * createWhile(PabloAST * condition, const std::vector<Next *> & nextVars, PabloBlock * body) {
    184         return mPb->createWhile(condition, nextVars, body);
    185     }
    186 
    187     inline While * createWhile(PabloAST * condition, std::vector<Next *> && nextVars, PabloBlock * body) {
    188         return mPb->createWhile(condition, std::move(nextVars), body);
    189     }
    190 
    191     inline While * createWhile(PabloAST * condition, const std::initializer_list<Next *> nextVars, PabloBuilder & builder) {
    192         return mPb->createWhile(condition, std::move(nextVars), builder.mPb);
    193     }
    194 
    195     inline While * createWhile(PabloAST * condition, const std::vector<Next *> & nextVars, PabloBuilder & builder) {
    196         return mPb->createWhile(condition, nextVars, builder.mPb);
    197     }
    198 
    199     inline While * createWhile(PabloAST * condition, std::vector<Next *> && nextVars, PabloBuilder & builder) {
    200         return mPb->createWhile(condition, std::move(nextVars), builder.mPb);
     169    PabloAST * createAtEOF(PabloAST * expr, const std::string & prefix);
     170   
     171    inline If * createIf(PabloAST * condition, PabloBlock * body) {
     172        return mPb->createIf(condition, body);
     173    }
     174
     175    inline If * createIf(PabloAST * condition, PabloBuilder & builder) {
     176        return mPb->createIf(condition, builder.mPb);
     177    }
     178
     179    inline While * createWhile(PabloAST * condition, PabloBlock * body) {
     180        return mPb->createWhile(condition, body);
     181    }
     182
     183    inline While * createWhile(PabloAST * condition, PabloBuilder & builder) {
     184        return mPb->createWhile(condition, builder.mPb);
    201185    }
    202186
     
    235219    }
    236220
    237     inline String * getName(const std::string name, const bool generated = true) const {
    238         return mPb->getName(std::move(name), generated);
    239     }
    240 
    241     inline String * makeName(const std::string prefix, const bool generated = true) const {
    242         return mPb->makeName(std::move(prefix), generated);
    243     }
    244 
    245     inline Integer * getInteger(Integer::Type value) {
    246         return mPb->getInteger(value);
    247     }
    248 
    249 
    250221    inline Statement * getInsertPoint() const {
    251222        return mPb->getInsertPoint();
    252223    }
    253224
    254     inline PabloBlock * getPabloBlock() {
     225    inline PabloBlock * getPabloBlock() const {
    255226        return mPb;
    256227    }
    257228
    258     inline PabloBuilder * getParent() {
     229    inline PabloBuilder * getParent() const {
    259230        return mParent;
    260231    }
    261232
    262     inline void record(Statement * stmt) {
    263         mExprTable.findOrAdd(stmt);
     233    inline String * getName(const std::string name) const {
     234        return mPb->getName(name);
     235    }
     236
     237    inline String * makeName(const std::string & prefix) const {
     238        return mPb->makeName(prefix);
     239    }
     240
     241    inline Integer * getInteger(Integer::Type value) const {
     242        return mPb->getInteger(value);
     243    }
     244
     245    inline SymbolGenerator * getSymbolTable() const {
     246        return mPb->getSymbolTable();
     247    }
     248
     249protected:
     250
     251    explicit PabloBuilder(PabloBlock * block, PabloBuilder & parent)
     252    : mPb(block), mParent(&parent), mExprTable(&(parent.mExprTable)) {
     253
    264254    }
    265255
  • icGREP/icgrep-devel/icgrep/pablo/carry_manager.cpp

    r5160 r5202  
    8181    assert (mCurrentScope != mRootScope);
    8282    mCurrentFrameIndex -= mCarryInfo->getFrameIndex();
    83     mCurrentScope = mCurrentScope->getPredecessor ();
     83    mCurrentScope = mCurrentScope->getPredecessor();
    8484    mCarryInfo = mCarryInfoVector[mCurrentScope->getScopeIndex()];
    8585    assert(summaryPack() < mCarryOutPack.size());
  • icGREP/icgrep-devel/icgrep/pablo/codegenstate.cpp

    r5160 r5202  
    66
    77#include <pablo/codegenstate.h>
    8 #include <iostream>
    98#include <pablo/printer_pablos.h>
    109
    1110namespace pablo {
    1211
    13 inline PabloAST * PabloBlock::renameNonNamedNode(PabloAST * expr, const std::string && prefix) {
    14     if (Statement * stmt = dyn_cast<Statement>(expr)) {
    15         if (stmt->getName()->isGenerated()) {
    16             stmt->setName(makeName(prefix, false));
    17         }
    18     }
    19     return expr;
    20 }
    21 
     12/// UNARY CREATE FUNCTIONS
     13///
     14
     15Call * PabloBlock::createCall(PabloAST * prototype, const std::vector<PabloAST *> &) {
     16    assert (prototype);
     17    return insertAtInsertionPoint(new Call(prototype));
     18}
     19
     20Count * PabloBlock::createCount(PabloAST * expr) {
     21    return insertAtInsertionPoint(new Count(expr, makeName("count")));
     22}
     23
     24Count * PabloBlock::createCount(PabloAST * const expr, const std::string & prefix)  {
     25    return insertAtInsertionPoint(new Count(expr, makeName(prefix)));
     26}
     27
     28Not * PabloBlock::createNot(PabloAST * expr, String * name) {
     29    assert (expr);
     30    if (name == nullptr) {
     31        name = makeName("not");
     32    }
     33    return insertAtInsertionPoint(new Not(expr, name));
     34}
     35
     36Var * PabloBlock::createVar(PabloAST * name, Type * type) {
     37    if (type == nullptr) {
     38        type = getStreamTy();
     39    }
     40    if (LLVM_UNLIKELY(name == nullptr || !isa<String>(name))) {
     41        throw std::runtime_error("Var objects must have a String name");
     42    }
     43    return mParent->makeVariable(name, type);
     44}
     45
     46InFile * PabloBlock::createInFile(PabloAST * expr, String * name) {
     47    assert (expr);
     48    if (name == nullptr) {
     49        name = makeName("inFile");
     50    }
     51    return insertAtInsertionPoint(new InFile(expr, name));
     52}
     53
     54AtEOF * PabloBlock::createAtEOF(PabloAST * expr, String * name) {
     55    assert (expr);
     56    if (name == nullptr) {
     57        name = makeName("atEOF");
     58    }
     59    return insertAtInsertionPoint(new AtEOF(expr, name));
     60}
     61   
     62   
     63/// BINARY CREATE FUNCTIONS
     64
     65Advance * PabloBlock::createAdvance(PabloAST * expr, PabloAST * shiftAmount, String * name) {
     66    if (name == nullptr) {
     67        name = makeName("advance");
     68    }
     69    return insertAtInsertionPoint(new Advance(expr, shiftAmount, name));
     70}
     71
     72Lookahead * PabloBlock::createLookahead(PabloAST * expr, PabloAST * shiftAmount, String * name) {
     73    if (name == nullptr) {
     74        name = makeName("lookahead");
     75    }
     76    return insertAtInsertionPoint(new Lookahead(expr, shiftAmount, name));
     77}
     78
     79Extract * PabloBlock::createExtract(PabloAST * array, PabloAST * index, String * name) {
     80    assert (array && index);
     81    if (LLVM_LIKELY(isa<ArrayType>(array->getType()))) {
     82        if (name == nullptr) {
     83            std::string tmp;
     84            raw_string_ostream out(tmp);
     85            PabloPrinter::print(array, out);
     86            PabloPrinter::print(index, out);
     87            name = makeName(out.str());
     88        }
     89        return insertAtInsertionPoint(new Extract(array, index, name));
     90    }
     91    std::string tmp;
     92    raw_string_ostream out(tmp);
     93    out << "cannot extract element from ";
     94    array->print(out);
     95    out << ": type is not a valid ArrayType";
     96    throw std::runtime_error(out.str());
     97}
     98
     99And * PabloBlock::createAnd(PabloAST * expr1, PabloAST * expr2, String * name) {
     100    if (name == nullptr) {
     101        name = makeName("and");
     102    }
     103    return insertAtInsertionPoint(new And(expr1->getType(), expr1, expr2, name));
     104}
     105
     106And * PabloBlock::createAnd(Type * const type, const unsigned reserved, String * name) {
     107    if (name == nullptr) {
     108        name = makeName("and");
     109    }
     110    return insertAtInsertionPoint(new And(type, reserved, name));
     111}
     112
     113Or * PabloBlock::createOr(PabloAST * expr1, PabloAST * expr2, String * name) {
     114    if (name == nullptr) {
     115        name = makeName("or");
     116    }
     117    return insertAtInsertionPoint(new Or(expr1->getType(), expr1, expr2, name));
     118}
     119
     120Or * PabloBlock::createOr(Type * const type, const unsigned reserved, String * name) {
     121    if (name == nullptr) {
     122        name = makeName("or");
     123    }
     124    return insertAtInsertionPoint(new Or(type, reserved, name));
     125}
     126
     127Xor * PabloBlock::createXor(PabloAST * expr1, PabloAST * expr2, String * name) {
     128    if (name == nullptr) {
     129        name = makeName("xor");
     130    }
     131    return insertAtInsertionPoint(new Xor(expr1->getType(), expr1, expr2, name));
     132}
     133
     134Xor * PabloBlock::createXor(Type * const type, const unsigned reserved, String * name) {
     135    if (name == nullptr) {
     136        name = makeName("xor");
     137    }
     138    return insertAtInsertionPoint(new Xor(type, reserved, name));
     139}
     140
     141Assign * PabloBlock::createAssign(PabloAST * const var, PabloAST * const value) {
     142    return insertAtInsertionPoint(new Assign(var, value));
     143}
     144
     145MatchStar * PabloBlock::createMatchStar(PabloAST * marker, PabloAST * charclass, String * name) {
     146    if (name == nullptr) {
     147        name = makeName("matchstar");
     148    }
     149    return insertAtInsertionPoint(new MatchStar(marker, charclass, name));
     150}
     151