Changeset 5847 for icGREP


Ignore:
Timestamp:
Jan 29, 2018, 1:08:42 PM (15 months ago)
Author:
cameron
Message:

Unify Parabix CC compiler and Direct CC compiler with a common superclass

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

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/UCD/ucd_compiler.cpp

    r5842 r5847  
    148148    CC *  suffix = makeByte(0x80, 0xBF);
    149149    assert (!suffix->empty());
    150     mSuffixVar = mCharacterClassCompiler.compileCC(suffix, entry);
     150    mSuffixVar = mCodeUnitCompiler.compileCC(suffix, entry);
    151151    generateRange(ifRanges, 0, UNICODE_MAX, entry);
    152152}
     
    257257            // We have a single byte remaining to match for all code points in this CC.
    258258            // Use the byte class compiler to generate matches for these codepoints.
    259             PabloAST * var = mCharacterClassCompiler.compileCC(makeCC(byteDefinitions(ranges, byte_no, isUTF_16), &Byte), builder);
     259            PabloAST * var = mCodeUnitCompiler.compileCC(makeCC(byteDefinitions(ranges, byte_no, isUTF_16), &Byte), builder);
    260260            if (byte_no > 1) {
    261261                var = builder.createAnd(var, builder.createAdvance(makePrefix(lo, byte_no, builder, prefix), 1));
     
    279279                        target = sequenceGenerator(mid, hi, byte_no, builder, target, prefix);
    280280                    } else { // we have a prefix group of type (a)
    281                         PabloAST * var = mCharacterClassCompiler.compileCC(makeByte(lo_byte, hi_byte), builder);
     281                        PabloAST * var = mCodeUnitCompiler.compileCC(makeByte(lo_byte, hi_byte), builder);
    282282                        if (byte_no > 1) {
    283283                            var = builder.createAnd(builder.createAdvance(prefix, 1), var);
     
    289289                    }
    290290                } else { // lbyte == hbyte
    291                     PabloAST * var = mCharacterClassCompiler.compileCC(makeByte(lo_byte, hi_byte), builder);
     291                    PabloAST * var = mCodeUnitCompiler.compileCC(makeByte(lo_byte, hi_byte), builder);
    292292                    if (byte_no > 1) {
    293293                        var = builder.createAnd(builder.createAdvance(prefix ? prefix : var, 1), var);
     
    335335            }
    336336        }
    337         PabloAST * cc = mCharacterClassCompiler.compileCC(makeByte(lo_byte, hi_byte), builder);
     337        PabloAST * cc = mCodeUnitCompiler.compileCC(makeByte(lo_byte, hi_byte), builder);
    338338        target = builder.createAnd(cc, target);
    339339    } else if (lo_byte == hi_byte) {
    340         PabloAST * cc = mCharacterClassCompiler.compileCC(makeByte(lo_byte, hi_byte), builder);
     340        PabloAST * cc = mCodeUnitCompiler.compileCC(makeByte(lo_byte, hi_byte), builder);
    341341        target = builder.createAnd(cc, target);
    342342        target = builder.createAdvance(target, 1);
     
    369369    for (unsigned i = 1; i != byte_no; ++i) {
    370370        const CC * const cc = makeByte(encodingByte(cp, i, isUTF_16));
    371         PabloAST * var = mCharacterClassCompiler.compileCC(cc, builder);
     371        PabloAST * var = mCodeUnitCompiler.compileCC(cc, builder);
    372372        if (i > 1) {
    373373            var = builder.createAnd(var, builder.createAdvance(prefix, 1));
     
    537537 ** ------------------------------------------------------------------------------------------------------------- */
    538538UCDCompiler::UCDCompiler(cc::CC_Compiler & ccCompiler)
    539 : mCharacterClassCompiler(ccCompiler)
     539: mCodeUnitCompiler(ccCompiler)
    540540, mSuffixVar(nullptr) { }
    541541
  • icGREP/icgrep-devel/icgrep/UCD/ucd_compiler.hpp

    r5748 r5847  
    8181
    8282private:
    83     cc::CC_Compiler &       mCharacterClassCompiler;
     83    cc::CC_Compiler &       mCodeUnitCompiler;
    8484    PabloAST *              mSuffixVar;
    8585    TargetMap               mTarget;
  • icGREP/icgrep-devel/icgrep/cc/cc_compiler.cpp

    r5843 r5847  
    2121
    2222namespace cc {
    23 
    24 CC_Compiler::CC_Compiler(pablo::PabloKernel * kernel, std::vector<pablo::PabloAST *> basisBitSet)
    25 : mBuilder(kernel->getEntryScope())
     23    CC_Compiler::CC_Compiler(pablo::PabloKernel * kernel)
     24    : mBuilder(kernel->getEntryScope()) {
     25    }
     26   
     27
     28Parabix_CC_Compiler::Parabix_CC_Compiler(pablo::PabloKernel * kernel, std::vector<pablo::PabloAST *> basisBitSet)
     29: CC_Compiler(kernel)
    2630, mEncodingBits(basisBitSet.size())
    2731, mBasisBit(basisBitSet) {
     
    2933}
    3034
    31 PabloAST * CC_Compiler::compileCC(const std::string & canonicalName, const CC *cc, PabloBlock & block) {
     35PabloAST * Parabix_CC_Compiler::compileCC(const std::string & canonicalName, const CC *cc, PabloBlock & block) {
    3236    PabloAST * const var = charset_expr(cc, block);
    3337    if (LLVM_LIKELY(isa<Statement>(var))) {
     
    3741}
    3842
    39 PabloAST * CC_Compiler::compileCC(const std::string & canonicalName, const CC *cc, PabloBuilder & builder) {
     43PabloAST * Parabix_CC_Compiler::compileCC(const std::string & canonicalName, const CC *cc, PabloBuilder & builder) {
    4044    PabloAST * const var = charset_expr(cc, builder);
    4145    if (LLVM_LIKELY(isa<Statement>(var))) {
     
    4650   
    4751template<typename PabloBlockOrBuilder>
    48 PabloAST * CC_Compiler::charset_expr(const CC * cc, PabloBlockOrBuilder & pb) {
     52PabloAST * Parabix_CC_Compiler::charset_expr(const CC * cc, PabloBlockOrBuilder & pb) {
    4953    if (cc->empty()) {
    5054        return pb.createZeroes();
     
    9094
    9195template<typename PabloBlockOrBuilder>
    92 PabloAST * CC_Compiler::bit_pattern_expr(const unsigned pattern, unsigned selected_bits, PabloBlockOrBuilder & pb) {
     96PabloAST * Parabix_CC_Compiler::bit_pattern_expr(const unsigned pattern, unsigned selected_bits, PabloBlockOrBuilder & pb) {
    9397    if (LLVM_UNLIKELY(selected_bits == 0)) {
    9498        return pb.createOnes();
     
    129133
    130134template<typename PabloBlockOrBuilder>
    131 inline PabloAST * CC_Compiler::char_test_expr(const codepoint_t ch, PabloBlockOrBuilder &pb) {
     135inline PabloAST * Parabix_CC_Compiler::char_test_expr(const codepoint_t ch, PabloBlockOrBuilder &pb) {
    132136    return bit_pattern_expr(ch, mEncodingMask, pb);
    133137}
    134138
    135139template<typename PabloBlockOrBuilder>
    136 PabloAST * CC_Compiler::make_range(const codepoint_t n1, const codepoint_t n2, PabloBlockOrBuilder & pb) {
     140PabloAST * Parabix_CC_Compiler::make_range(const codepoint_t n1, const codepoint_t n2, PabloBlockOrBuilder & pb) {
    137141    codepoint_t diff_count = 0;
    138142
     
    160164
    161165template<typename PabloBlockOrBuilder>
    162 PabloAST * CC_Compiler::GE_Range(const unsigned N, const unsigned n, PabloBlockOrBuilder &pb) {
     166PabloAST * Parabix_CC_Compiler::GE_Range(const unsigned N, const unsigned n, PabloBlockOrBuilder &pb) {
    163167    if (N == 0) {
    164168        return pb.createOnes(); //Return a true literal.
     
    197201
    198202template<typename PabloBlockOrBuilder>
    199 PabloAST * CC_Compiler::LE_Range(const unsigned N, const unsigned n, PabloBlockOrBuilder & pb) {
     203PabloAST * Parabix_CC_Compiler::LE_Range(const unsigned N, const unsigned n, PabloBlockOrBuilder & pb) {
    200204    /*
    201205      If an N-bit pattern is all ones, then it is always true that any n-bit value is LE this pattern.
     
    210214
    211215template<typename PabloBlockOrBuilder>
    212 inline PabloAST * CC_Compiler::char_or_range_expr(const codepoint_t lo, const codepoint_t hi, PabloBlockOrBuilder &pb) {
     216inline PabloAST * Parabix_CC_Compiler::char_or_range_expr(const codepoint_t lo, const codepoint_t hi, PabloBlockOrBuilder &pb) {
    213217    if (lo == hi) {
    214218        return char_test_expr(lo, pb);
     
    219223}
    220224
    221 inline PabloAST * CC_Compiler::getBasisVar(const unsigned i) const {
     225inline PabloAST * Parabix_CC_Compiler::getBasisVar(const unsigned i) const {
    222226    assert (i < mEncodingBits);
    223227    const unsigned index = mEncodingBits - i - 1; assert (index < mEncodingBits);
     
    262266    return ccStrm;
    263267}
     268   
     269Direct_CC_Compiler::Direct_CC_Compiler(pablo::PabloKernel * kernel, pablo::PabloAST * codeUnitStream)
     270: CC_Compiler(kernel)
     271, mCodeUnitStream(codeUnitStream) {
     272}
     273
     274pablo::PabloAST * Direct_CC_Compiler::compileCC(const std::string & name, const re::CC *cc, pablo::PabloBlock & block) {
     275    PabloBuilder pb(&block);
     276    return compileCC(name, cc, pb);
     277}
     278
     279pablo::PabloAST * Direct_CC_Compiler::compileCC(const std::string & name, const re::CC *cc, pablo::PabloBuilder & b) {
     280    return compileCCfromCodeUnitStream(cc, mCodeUnitStream, b);
     281}
     282
    264283} // end of namespace cc
  • icGREP/icgrep-devel/icgrep/cc/cc_compiler.h

    r5843 r5847  
    1616namespace cc {
    1717
    18 class CC_Compiler{
    19     friend class ParabixCharacterClassKernelBuilder;
     18class CC_Compiler {
    2019public:
    2120   
    22     CC_Compiler(pablo::PabloKernel * kernel, std::vector<pablo::PabloAST *> basisBitSet);
     21    virtual pablo::PabloAST * compileCC(const re::CC *cc) = 0;
    2322   
    24     pablo::PabloAST * compileCC(const re::CC *cc);
     23    virtual pablo::PabloAST * compileCC(const re::CC *cc, pablo::PabloBlock & block) = 0;
     24   
     25    virtual pablo::PabloAST * compileCC(const re::CC *cc, pablo::PabloBuilder & builder) = 0;
     26   
     27    virtual pablo::PabloAST * compileCC(const std::string & canonicalName, const re::CC *cc, pablo::PabloBlock & block) = 0;
     28   
     29    virtual pablo::PabloAST * compileCC(const std::string & canonicalName, const re::CC *cc, pablo::PabloBuilder & builder) = 0;
    2530
    26     pablo::PabloAST * compileCC(const re::CC *cc, pablo::PabloBlock & block);
     31protected:
     32    CC_Compiler(pablo::PabloKernel * kernel);
     33    pablo::PabloBuilder             mBuilder;
     34};
     35   
     36   
     37class Parabix_CC_Compiler : public CC_Compiler {
     38public:
     39   
     40    Parabix_CC_Compiler(pablo::PabloKernel * kernel, std::vector<pablo::PabloAST *> basisBitSet);
     41   
     42    pablo::PabloAST * compileCC(const re::CC *cc) override;
     43   
     44    pablo::PabloAST * compileCC(const re::CC *cc, pablo::PabloBlock & block) override;
     45   
     46    pablo::PabloAST * compileCC(const re::CC *cc, pablo::PabloBuilder & builder) override;
     47   
     48    pablo::PabloAST * compileCC(const std::string & name, const re::CC *cc, pablo::PabloBlock & block) override;
    2749
    28     pablo::PabloAST * compileCC(const re::CC *cc, pablo::PabloBuilder & builder);
    29 
    30     pablo::PabloAST * compileCC(const std::string & canonicalName, const re::CC *cc, pablo::PabloBlock & block);
    31 
    32     pablo::PabloAST * compileCC(const std::string & canonicalName, const re::CC *cc, pablo::PabloBuilder & builder);
     50    pablo::PabloAST * compileCC(const std::string & name, const re::CC *cc, pablo::PabloBuilder & builder) override;
    3351
    3452private:
     
    4967    pablo::PabloAST * charset_expr(const re::CC *cc, PabloBlockOrBuilder & pb);
    5068private:   
    51     pablo::PabloBuilder             mBuilder;
    5269    const unsigned                  mEncodingBits;
    5370    std::vector<pablo::PabloAST *>  mBasisBit;
     
    5572};
    5673
    57 inline pablo::PabloAST *CC_Compiler::compileCC(const re::CC *cc) {
     74    inline pablo::PabloAST * Parabix_CC_Compiler::compileCC(const re::CC *cc) {
     75        return compileCC(cc, mBuilder);
     76    }
     77   
     78    inline pablo::PabloAST * Parabix_CC_Compiler::compileCC(const re::CC *cc, pablo::PabloBlock & block) {
     79        return compileCC(cc->canonicalName(), cc, block);
     80    }
     81   
     82    inline pablo::PabloAST * Parabix_CC_Compiler::compileCC(const re::CC *cc, pablo::PabloBuilder & builder) {
     83        return compileCC(cc->canonicalName(), cc, builder);
     84    }
     85   
     86   
     87
     88class Direct_CC_Compiler : public CC_Compiler {
     89public:
     90   
     91    Direct_CC_Compiler(pablo::PabloKernel * kernel, pablo::PabloAST * codeUnitStream);
     92   
     93    pablo::PabloAST * compileCC(const re::CC *cc) override;
     94   
     95    pablo::PabloAST * compileCC(const re::CC *cc, pablo::PabloBlock & block) override;
     96   
     97    pablo::PabloAST * compileCC(const re::CC *cc, pablo::PabloBuilder & builder) override;
     98   
     99    pablo::PabloAST * compileCC(const std::string & name, const re::CC *cc, pablo::PabloBlock & block) override;
     100   
     101    pablo::PabloAST * compileCC(const std::string & name, const re::CC *cc, pablo::PabloBuilder & builder) override;
     102       
     103private:
     104    pablo::PabloAST *               mCodeUnitStream;
     105};
     106
     107   
     108inline pablo::PabloAST * Direct_CC_Compiler::compileCC(const re::CC *cc) {
    58109    return compileCC(cc, mBuilder);
    59110}
    60111
    61 inline pablo::PabloAST * CC_Compiler::compileCC(const re::CC *cc, pablo::PabloBlock & block) {
    62     return compileCC(cc->canonicalName(re::CC_type::ByteClass), cc, block);
     112inline pablo::PabloAST * Direct_CC_Compiler::compileCC(const re::CC *cc, pablo::PabloBlock & block) {
     113    return compileCC(cc->canonicalName(), cc, block);
    63114}
    64115
    65 inline pablo::PabloAST *CC_Compiler::compileCC(const re::CC *cc, pablo::PabloBuilder & builder) {
    66     return compileCC(cc->canonicalName(re::CC_type::ByteClass), cc, builder);
     116inline pablo::PabloAST * Direct_CC_Compiler::compileCC(const re::CC *cc, pablo::PabloBuilder & builder) {
     117    return compileCC(cc->canonicalName(), cc, builder);
    67118}
     119
     120
    68121
    69122pablo::PabloAST * compileCCfromCodeUnitStream(const re::CC *cc, pablo::PabloAST * codeUnitStream, pablo::PabloBuilder & pb);
  • icGREP/icgrep-devel/icgrep/editd/editd.cpp

    r5843 r5847  
    292292void PreprocessKernel::generatePabloMethod() {
    293293    PabloBuilder pb(getEntryScope());
    294     cc::CC_Compiler ccc(this, getInputStreamSet("basis"));
     294    cc::Parabix_CC_Compiler ccc(this, getInputStreamSet("basis"));
    295295    PabloAST * A = ccc.compileCC(re::makeCC(re::makeCC(0x41), re::makeCC(0x61)), pb);
    296296    PabloAST * C = ccc.compileCC(re::makeCC(re::makeCC(0x43), re::makeCC(0x63)), pb);
  • icGREP/icgrep-devel/icgrep/kernels/cc_kernel.cpp

    r5844 r5847  
    103103void ParabixCharacterClassKernelBuilder::generatePabloMethod() {
    104104    PabloBuilder pb(getEntryScope());
    105     cc::CC_Compiler ccc(this, getInputStreamSet("basis"));
     105    cc::Parabix_CC_Compiler ccc(this, getInputStreamSet("basis"));
    106106    Var * outputVar = getOutputStreamVar("outputStream");
    107107    for (unsigned i = 0; i < mCharClasses.size(); ++i) {
  • icGREP/icgrep-devel/icgrep/kernels/charclasses.cpp

    r5843 r5847  
    7575    PabloBuilder pb(getEntryScope());
    7676
    77     CC_Compiler ccc(this, getInputStreamSet("basis"));
     77    Parabix_CC_Compiler ccc(this, getInputStreamSet("basis"));
    7878    unsigned n = mCCs.size();
    7979
  • icGREP/icgrep-devel/icgrep/kernels/delmask_kernel.cpp

    r5843 r5847  
    2525    //  output: delmask stream + error stream
    2626   
    27     cc::CC_Compiler ccc(this, u8_bits);
     27    cc::Parabix_CC_Compiler ccc(this, u8_bits);
    2828   
    2929    Zeroes * zeroes = main.createZeroes();
  • icGREP/icgrep-devel/icgrep/kernels/grep_kernel.cpp

    r5843 r5847  
    4242void RequiredStreams_UTF8::generatePabloMethod() {
    4343    PabloBuilder pb(getEntryScope());
    44     cc::CC_Compiler ccc(this, getInputStreamSet("basis"));
     44    cc::Parabix_CC_Compiler ccc(this, getInputStreamSet("basis"));
    4545    Zeroes * const ZEROES = pb.createZeroes();
    4646    PabloAST * const u8pfx = ccc.compileCC(makeByte(0xC0, 0xFF));
     
    135135void RequiredStreams_UTF16::generatePabloMethod() {
    136136    PabloBuilder pb(getEntryScope());
    137     cc::CC_Compiler ccc(this, getInputStreamSet("basis"));
     137    cc::Parabix_CC_Compiler ccc(this, getInputStreamSet("basis"));
    138138   
    139139    PabloAST * u16hi_hi_surrogate = ccc.compileCC(makeCC(0xD800, 0xDBFF, &cc::UTF16));    //u16hi_hi_surrogate = [\xD8-\xDB]
     
    208208void ICGrepKernel::generatePabloMethod() {
    209209    PabloBuilder pb(getEntryScope());
    210     cc::CC_Compiler cc_compiler(this, getInputStreamSet("basis"));
    211     RE_Compiler re_compiler(this, cc_compiler);
     210    cc::Parabix_CC_Compiler ccc(this, getInputStreamSet("basis"));
     211    RE_Compiler re_compiler(this, ccc);
    212212    for (auto a : mAlphabets) {
    213213        auto mpx_basis = getInputStreamSet(a->getName() + "_basis");
  • icGREP/icgrep-devel/icgrep/kernels/linebreak_kernel.cpp

    r5843 r5847  
    3838    PabloBuilder pb(getEntryScope());
    3939    #ifdef USE_DIRECT_LF_BUILDER
    40     PabloAST * LF = compileCCfromCodeUnitStream(makeByte(0x0A), getInput(0), pb);
     40    cc::Direct_CC_Compiler ccc(this, pb.createExtract(getInputStreamVar("byteStream"), pb.getInteger(0)));
    4141    #else
    42     cc::CC_Compiler ccc(this, getInputStreamSet("basis"));
     42    cc::Parabix_CC_Compiler ccc(this, getInputStreamSet("basis"));
     43    #endif
    4344    PabloAST * LF = ccc.compileCC("LF", makeByte(0x0A), pb);
    44     #endif
    4545    pb.createAssign(pb.createExtract(getOutput(0), 0), LF);
    4646}
     
    5959void LineBreakKernelBuilder::generatePabloMethod() {
    6060    PabloBuilder pb(getEntryScope());
    61     cc::CC_Compiler ccc(this, getInputStreamSet("basis"));
     61    cc::Parabix_CC_Compiler ccc(this, getInputStreamSet("basis"));
    6262
    6363    Integer * const ZERO = pb.getInteger(0);
  • icGREP/icgrep-devel/icgrep/kernels/u8u32_kernel.cpp

    r5843 r5847  
    2525    //  output: 32 u8-indexed streams, + delmask stream + error stream
    2626   
    27     cc::CC_Compiler ccc(this, u8_bits);
     27    cc::Parabix_CC_Compiler ccc(this, u8_bits);
    2828   
    2929    Zeroes * zeroes = main.createZeroes();
  • icGREP/icgrep-devel/icgrep/pablo/pablo_compiler.cpp

    r5837 r5847  
    681681                if (isa<Var>(rh)) {
    682682                    rhvStreamIndex = b->getInt32(0);
    683                 } else if (isa<Extract>(lh)) {
     683                } else if (isa<Extract>(rh)) {
    684684                    rhvStreamIndex = compileExpression(b, cast<Extract>(rh)->getIndex());
    685685                } else {
  • icGREP/icgrep-devel/icgrep/re/exclude_CC.cpp

    r5809 r5847  
    6666                    if (!intersects(cc0, cc)) return re;
    6767                }
    68                 std::string cc_name = n->getName() + "--" + cc->canonicalName(CC_type::UnicodeClass);
     68                std::string cc_name = n->getName() + "--" + cc->canonicalName();
    6969                return makeName(cc_name, n->getType(), exclude_CC(defn, cc));
    7070                /*
  • icGREP/icgrep-devel/icgrep/re/printer_re.cpp

    r5816 r5847  
    4545    } else if (const CC* re_cc = dyn_cast<const CC>(re)) {
    4646        retVal = "CC \"";
    47         retVal += re_cc->canonicalName(CC_type::UnicodeClass);
     47        retVal += re_cc->canonicalName();
    4848        retVal += "\" ";
    4949
  • icGREP/icgrep-devel/icgrep/re/re_cc.cpp

    r5795 r5847  
    11/*
    2  *  Copyright (c) 2014 International Characters.
     2 *  Copyright (c) 2018 International Characters.
    33 *  This software is licensed to the public under the Open Software License 3.0.
    44 *  icgrep is a trademark of International Characters.
     
    1111namespace re {
    1212
    13 std::string CC::canonicalName(const CC_type type) const {
     13std::string CC::canonicalName() const {
    1414    std::stringstream name;
     15    name << mAlphabet->getName();
    1516    name << std::hex;
    16     if ((type == CC_type::ByteClass) && (max_codepoint() >= 0x80)) {
    17         name << "BC";
    18     } else {
    19         name << "CC";
    20     }
    2117    char separator = '_';
    2218    for (const interval_t i : *this) {
  • icGREP/icgrep-devel/icgrep/re/re_cc.h

    r5809 r5847  
    11/*
    2  *  Copyright (c) 2014 International Characters.
     2 *  Copyright (c) 2018 International Characters.
    33 *  This software is licensed to the public under the Open Software License 3.0.
    44 *  icgrep is a trademark of International Characters.
     
    3131    const cc::Alphabet * getAlphabet() const { return mAlphabet;}
    3232
    33     std::string canonicalName(const CC_type type) const;
     33    std::string canonicalName() const;
    3434
    3535    inline codepoint_t min_codepoint() const {
  • icGREP/icgrep-devel/icgrep/re/re_compiler.cpp

    r5843 r5847  
    5353void RE_Compiler::addAlphabet(cc::Alphabet * a, std::vector<pablo::PabloAST *> basis_set) {
    5454    mAlphabets.push_back(a);
    55     mAlphabetCompilers.push_back(make_unique<cc::CC_Compiler>(mKernel, basis_set));
     55    mAlphabetCompilers.push_back(make_unique<cc::Parabix_CC_Compiler>(mKernel, basis_set));
    5656}
    5757
     
    6565
    6666inline MarkerType RE_Compiler::compile(RE * const re, PabloAST * const cursors, PabloBuilder & pb) {
    67     return process(re, makeMarker(FinalMatchUnit, cursors), pb);
     67    //  An important use case for an initial set of cursors to be passed in
     68    //  is that the initial cursors are computed from a prefix of an RE such
     69    //  that there is a high probability of all cursors remaining in a block
     70    //  are zeroed.   We therefore embed processing logic in an if-test,
     71    //  dependent on the initial cursors.
     72    Var * m = pb.createVar("m", pb.createZeroes());
     73    NameMap nestedMap(mCompiledName);
     74    mCompiledName = &nestedMap;
     75    auto nested = pb.createScope();
     76    MarkerType m1 = process(re, makeMarker(FinalPostPositionUnit, cursors), nested);
     77    nested.createAssign(m, markerVar(m1));
     78    pb.createIf(cursors, nested);
     79    mCompiledName = nestedMap.getParent();
     80    return makeMarker(m1.pos, m);
    6881}
    6982
  • icGREP/icgrep-devel/icgrep/re/re_multiplex.cpp

    r5801 r5847  
    1515#include <UCD/resolve_properties.h>
    1616#include <boost/container/flat_set.hpp>
     17#include <cc/alphabet.h>
    1718#include <cc/multiplex_CCs.h>
    1819#include <sstream>
     
    3435    std::function<RE *(RE *)> multiplex = [&](RE * const re) -> RE * {
    3536        if (CC * cc = dyn_cast<CC>(re)) {
     37            if (cc->getAlphabet() != &cc::Unicode) return cc;
    3638            const auto index = find(UnicodeSets.begin(), UnicodeSets.end(), cc) - UnicodeSets.begin();
    3739            const auto exclusive_IDs = exclusiveSetIDs[index];
     
    4648                if (LLVM_LIKELY(name->getDefinition() != nullptr)) {
    4749                    if (CC * cc = dyn_cast<CC>(name->getDefinition())) {
     50                        if (cc->getAlphabet() != &cc::Unicode) return cc;
    4851                        const auto index = find(UnicodeSets.begin(), UnicodeSets.end(), cc) - UnicodeSets.begin();
    4952                        const auto exclusive_IDs = exclusiveSetIDs[index];
  • icGREP/icgrep-devel/icgrep/re/re_name.h

    r5809 r5847  
    160160
    161161inline Name * makeName(CC * const cc) {
    162     const std::string name = cc->canonicalName(CC_type::UnicodeClass);
     162    const std::string name = cc->canonicalName();
    163163    return new Name(nullptr, 0, name.c_str(), name.length(), Name::Type::Unicode, cc);
    164164}
  • icGREP/icgrep-devel/icgrep/u8u16.cpp

    r5843 r5847  
    8484    Var * error_mask = main.createVar("error_mask", zeroes);
    8585
    86     cc::CC_Compiler ccc(this, u8_bits);
     86    cc::Parabix_CC_Compiler ccc(this, u8_bits);
    8787
    8888    // The logic for processing non-ASCII bytes will be embedded within an if-hierarchy.
  • icGREP/icgrep-devel/icgrep/wc.cpp

    r5843 r5847  
    105105    //  output: 3 counters
    106106
    107     cc::CC_Compiler ccc(this, u8_bits);
     107    cc::Parabix_CC_Compiler ccc(this, u8_bits);
    108108
    109109    Var * lc = getOutputScalarVar("lineCount");
Note: See TracChangeset for help on using the changeset viewer.