Ignore:
Timestamp:
Jul 2, 2015, 9:28:21 AM (4 years ago)
Author:
nmedfort
Message:

Couple modifications to the UCD compiler. Splitting Multiplexing from BDD Minimization.

File:
1 edited

Legend:

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

    r4627 r4629  
    4444        codepoint_t lo, hi;
    4545        std::tie(lo, hi) = range;
    46         if (rangeIntersect(set, lo, hi).empty()) {
    47             continue;
    48         }
    49         PabloBuilder inner_block = PabloBuilder::Create(block);
    50         PabloAST * inner_target = generateWithIfHierarchy(inner, set, lo, hi, inner_block);
    51         // If this range is empty, just skip creating the if block
    52         if (LLVM_UNLIKELY(isa<Zeroes>(inner_target))) {
    53             continue;
    54         }
    55         Assign * matches = inner_block.createAssign("m", inner_target);
    56         block.createIf(ifTestCompiler(lo, hi, block), {matches}, inner_block);
    57         target = block.createOr(target, matches);
     46        if (set.intersects(lo, hi)) {
     47            PabloBuilder inner_block = PabloBuilder::Create(block);
     48            PabloAST * inner_target = generateWithIfHierarchy(inner, set, lo, hi, inner_block);
     49            // If this range is empty, just skip creating the if block
     50            if (LLVM_UNLIKELY(isa<Zeroes>(inner_target))) {
     51                continue;
     52            }
     53            Assign * matches = inner_block.createAssign("m", inner_target);
     54            block.createIf(ifTestCompiler(lo, hi, block), {matches}, inner_block);
     55            target = block.createOr(target, matches);
     56        }
    5857    }
    5958
     
    129128                    }
    130129                    else { // we have a prefix group of type (a)
    131                         PabloAST * byteVar = mCharacterClassCompiler.compileCC(makeCC(lo_byte, hi_byte), block);
    132                         PabloAST * infix = byteVar;
     130                        PabloAST * var = mCharacterClassCompiler.compileCC(makeCC(lo_byte, hi_byte), block);
    133131                        if (byte_no > 1) {
    134                             infix = block.createAnd(block.createAdvance(prefix, 1), byteVar);
     132                            var = block.createAnd(block.createAdvance(prefix, 1), var);
    135133                        }
    136134                        PabloAST * suffixVar = mCharacterClassCompiler.compileCC(mSuffix, block);
    137135                        for (auto i = byte_no; i < UTF8_Encoder::length(lo); ++i) {
    138                             infix = block.createAnd(suffixVar, block.createAdvance(infix, 1));
     136                            var = block.createAnd(suffixVar, block.createAdvance(var, 1));
    139137                        }
    140                         target = block.createOr(target, infix);
     138                        target = block.createOr(target, var);
    141139                    }
    142140                }
Note: See TracChangeset for help on using the changeset viewer.