- end_pressure = 0;
- for (idx = workset_get_length(bes->end_state) - 1; idx >= 0; --idx)
- if (bes->end_state->vals[idx].version >= ges->version)
- end_pressure += 1;
-
- /*
- * if the variable is live through the block,
- * update the pressure indicator.
- */
- DBG((dbg, DBG_GLOBAL, "\t\told pressure %d, ", bi->pressure));
-
- bi->pressure = MAX(bi->pressure + bes->live_through, end_pressure);
-
- DBG((dbg, DBG_GLOBAL, "new pressure: %d, end pressure: %d, end length: %d\n",
- bi->pressure, end_pressure, workset_get_length(bes->end_state)));
-
+ /*
+ * Commit the block end states
+ */
+ for (bs = ges->bs_top; bs != NULL; bs = bs->next) {
+ block_info_t *bi = bs->bi;
+
+ if (!bitset_is_set(ges->committed, bi->id)) {
+ DBG((dbg, DBG_GLOBAL, "\t\tcommiting workset of %+F with version %x\n", bi->bl, ges->version));
+ // bes->bs->end_state->vals[idx].version = ges->version;
+ workset_copy(env, bi->ws_end, bs->end_state);
+ DBG((dbg, DBG_GLOBAL, "\t\told pressure: %d, new pressure: %d, end length: %d\n",
+ bi->pressure, bs->pressure, workset_get_length(bs->end_state)));
+ bi->pressure = bs->pressure;
+ bitset_set(ges->committed, bi->id);
+ }