Ignore:
Timestamp:
Oct 25, 2017, 4:57:58 PM (20 months ago)
Author:
nmedfort
Message:

First stage of MultiBlockKernel? and pipeline restructuring

Location:
icGREP/icgrep-devel/icgrep/re
Files:
3 edited

Legend:

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

    r5646 r5706  
    3030#include "cc/cc_compiler.h"         // for CC_Compiler
    3131#include "pablo/builder.hpp"        // for PabloBuilder
     32#include <llvm/Support/ErrorHandling.h>
    3233
    3334namespace pablo { class PabloAST; }
  • icGREP/icgrep-devel/icgrep/re/re_local.cpp

    r5649 r5706  
    159159}
    160160
    161 bool RE_Local::isLocalLanguage_helper(const RE * re, UCD::UnicodeSet & codepoints_seen) {
     161bool RE_Local::isLocalLanguage_helper(const RE * re, UCD::UnicodeSet & seen) {
    162162    assert ("RE object cannot be null!" && re);
    163163    if (isa<Any>(re)) {
    164         bool no_intersect = codepoints_seen.empty();
    165         codepoints_seen = UCD::UnicodeSet(0x00, 0x10FFFF);
     164        const bool no_intersect = seen.empty();
     165        seen = UCD::UnicodeSet(0x00, 0x10FFFF);
    166166        return no_intersect;
    167167    } else if (const CC * cc = dyn_cast<CC>(re)) {
    168         bool has_intersect = cast<UCD::UnicodeSet>(cc)->intersects(codepoints_seen);
    169         codepoints_seen = codepoints_seen + *cast<UCD::UnicodeSet>(cc);
     168        const bool has_intersect = cast<CC>(cc)->intersects(seen);
     169        seen = seen + *cast<CC>(cc);
    170170        return !has_intersect;
    171171    } else if (const Name * n = dyn_cast<Name>(re)) {
    172         return isLocalLanguage_helper(n->getDefinition(), codepoints_seen);
     172        return isLocalLanguage_helper(n->getDefinition(), seen);
    173173    } else if (const Seq * re_seq = dyn_cast<const Seq>(re)) {
    174174        for (const RE * item : *re_seq) {
    175             if (!isLocalLanguage_helper(item, codepoints_seen)) return false;
     175            if (!isLocalLanguage_helper(item, seen)) return false;
    176176        }
    177177        return true;
    178178    } else if (const Alt * re_alt = dyn_cast<const Alt>(re)) {
    179179        for (RE * item : *re_alt) {
    180             if (!isLocalLanguage_helper(item, codepoints_seen)) return false;
     180            if (!isLocalLanguage_helper(item, seen)) return false;
    181181        }
    182182        return true;
    183183    } else if (const Rep* re_rep = dyn_cast<const Rep>(re)) {
    184184        if (re_rep->getUB() > 1) return false;
    185         return isLocalLanguage_helper(re_rep->getRE(), codepoints_seen);
     185        return isLocalLanguage_helper(re_rep->getRE(), seen);
    186186    } else {
    187187        // A local language cannot contain Intersects, Differences, Assertions, Start, End.
  • icGREP/icgrep-devel/icgrep/re/re_memoizer.cpp

    r5630 r5706  
    1818    assert (lh->getClassTypeId() == rh->getClassTypeId());
    1919    assert (lh->getClassTypeId() == RE::ClassTypeId::Alt || lh->getClassTypeId() == RE::ClassTypeId::Seq);
    20     if (lh->size() != rh->size()) {
     20    if (LLVM_LIKELY(lh->size() != rh->size())) {
    2121        return lh->size() < rh->size();
    2222    }
Note: See TracChangeset for help on using the changeset viewer.