Ignore:
Timestamp:
Jan 15, 2018, 4:48:02 PM (16 months ago)
Author:
nmedfort
Message:

Revised RE_Minimizer to use alphabets + minor optimizations to RE functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/re/re_compiler.cpp

    r5821 r5835  
    487487    PabloAST * base = markerVar(AdvanceMarker(marker, InitialPostPositionUnit, pb));
    488488    if (isByteLength(repeated) && LLVM_LIKELY(!AlgorithmOptionIsSet(DisableMatchStar))) {
    489         PabloAST * mask = pb.createOr(markerVar(compile(repeated, pb)), mNonFinal);
     489        PabloAST * mask = markerVar(compile(repeated, pb));
    490490        // The post position character may land on the initial byte of a multi-byte character. Combine them with the masked range.
     491        mask = pb.createOr(mask, mNonFinal);
    491492        PabloAST * unbounded = pb.createMatchStar(base, mask, "unbounded");
    492493        return makeMarker(FinalPostPositionUnit, unbounded);
    493494    } else if (isUnicodeUnitLength(repeated) && LLVM_LIKELY(!AlgorithmOptionIsSet(DisableMatchStar) && !AlgorithmOptionIsSet(DisableUnicodeMatchStar))) {
    494         PabloAST * mask = pb.createOr(markerVar(compile(repeated, pb)), mNonFinal);
    495         PabloAST * mstar = pb.createMatchStar(base, mask);
    496         return makeMarker(FinalPostPositionUnit, pb.createAnd(mstar, mFinal, "unbounded"));
     495        PabloAST * mask = markerVar(compile(repeated, pb));
     496        mask = pb.createOr(mask, mNonFinal);
     497        PabloAST * unbounded = pb.createMatchStar(base, mask);
     498        return makeMarker(FinalPostPositionUnit, pb.createAnd(unbounded, mFinal, "unbounded"));
    497499    } else if (mStarDepth > 0){
    498500        PabloBuilder * const outer = pb.getParent();
     
    508510        pb.createAssign(starAccum, pb.createOr(loopComputation, m2));
    509511        mWhileTest = pb.createOr(mWhileTest, starPending);
    510         mStarDepth--;     
     512        mStarDepth--;
    511513        return makeMarker(markerPos(result), pb.createOr(base, starAccum, "unbounded"));
    512514    } else {
     
    583585, mCompiledName(&mBaseMap) {
    584586    Var * const linebreak = mKernel->getInputStreamVar("linebreak");
    585     mLineBreak = mPB.createExtract(linebreak, mPB.getInteger(0));
     587    mLineBreak = mPB.createExtract(linebreak, 0);
    586588    Var * const crlf = mKernel->getInputStreamVar("cr+lf");
    587     mCRLF = mPB.createExtract(crlf, mPB.getInteger(0));
     589    mCRLF = mPB.createExtract(crlf, 0);
    588590    Var * const required = mKernel->getInputStreamVar("required");
    589     mInitial = mPB.createExtract(required, mPB.getInteger(0));
    590     mNonFinal = mPB.createExtract(required, mPB.getInteger(1));
    591     mFinal = mPB.createExtract(required, mPB.getInteger(2));
     591    mInitial = mPB.createExtract(required, 0);
     592    mNonFinal = mPB.createExtract(required, 1);
     593    mFinal = mPB.createExtract(required, 2);
    592594}
    593595
Note: See TracChangeset for help on using the changeset viewer.