static
u32 getEffectiveAccelStates(const build_info &args,
+ const unordered_map<NFAVertex, NFAVertex> &dom_map,
u32 active_accel_mask,
const vector<AccelBuild> &accelStates) {
/* accelStates is indexed by the acceleration bit index and contains a
* so we may still require on earlier states to be accurately modelled.
*/
const NGHolder &h = args.h;
- auto dom_map = findDominators(h);
/* map from accel_id to mask of accel_ids that it is dominated by */
vector<u32> dominated_by(accelStates.size());
u32 accel_id = findAndClearLSB_32(&local_accel_mask);
assert(accel_id < accelStates.size());
NFAVertex v = accelStates[accel_id].v;
- while (dom_map[v]) {
- v = dom_map[v];
+ while (contains(dom_map, v) && dom_map.at(v)) {
+ v = dom_map.at(v);
if (contains(accel_id_map, v)) {
dominated_by[accel_id] |= 1U << accel_id_map[v];
}
return;
}
+ const auto dom_map = findDominators(args.h);
+
// We have 2^n different accel entries, one for each possible
// combination of accelerable states.
assert(accelStates.size() < 32);
effective_accel_set.push_back(0); /* empty is effectively empty */
for (u32 i = 1; i < accelCount; i++) {
- u32 effective_i = getEffectiveAccelStates(args, i, accelStates);
+ u32 effective_i = getEffectiveAccelStates(args, dom_map, i,
+ accelStates);
effective_accel_set.push_back(effective_i);
if (effective_i == IMPOSSIBLE_ACCEL_MASK) {