diff --git a/src/rose/rose_build_bytecode.cpp b/src/rose/rose_build_bytecode.cpp index b8301dbd..37e6ae13 100644 --- a/src/rose/rose_build_bytecode.cpp +++ b/src/rose/rose_build_bytecode.cpp @@ -1274,9 +1274,6 @@ bool checkSuitableForEager(bool is_prefix, const left_id &left, if (proper_out_degree(g.startDs, g)) { return false; /* not purely anchored */ } - if (is_match_vertex(g.start, g)) { - return false; /* vacuous (todo: handle?) */ - } ei.new_graph = cloneHolder(*left.graph()); auto gg = ei.new_graph; @@ -1284,6 +1281,10 @@ bool checkSuitableForEager(bool is_prefix, const left_id &left, ei.lag_adjust = decreaseLag(build, *gg, succs); + if (is_match_vertex(gg->start, *gg)) { + return false; /* should not still be vacuous as lag decreased */ + } + if (!can_die_early(*gg, EAGER_DIE_BEFORE_LIMIT)) { DEBUG_PRINTF("not eager as stuck alive\n"); return false; diff --git a/src/rose/rose_build_misc.cpp b/src/rose/rose_build_misc.cpp index 186f4d16..f7d49cbe 100644 --- a/src/rose/rose_build_misc.cpp +++ b/src/rose/rose_build_misc.cpp @@ -1234,6 +1234,11 @@ u32 roseQuality(const RoseEngine *t) { always_run++; } + if (t->eagerIterOffset) { + /* eager prefixes are always run */ + always_run++; + } + const HWLM *ftable = getFLiteralMatcher(t); if (ftable) { /* TODO: ignore conditional ftables, or ftables beyond smwr region */