+ /* check if all predecessor blocks are processed yet (though for backedges
+ * we have to make an exception as we can't process them first) */
+ arity = get_Block_n_cfgpreds(block);
+ for(i = 0; i < arity; ++i) {
+ ir_node *pred_block = get_Block_cfgpred_block(block, i);
+ block_info_t *pred_info = get_block_info(pred_block);
+
+ if (pred_info == NULL) {
+ /* process predecessor first (it will be in the queue already) */
+ if (!is_backedge(block, i)) {
+ return;
+ }
+ has_backedges = 1;
+ }
+ }
+ (void) has_backedges;
+ if (arity == 0) {
+ workset_clear(ws);
+ } else if (arity == 1) {
+ ir_node *pred_block = get_Block_cfgpred_block(block, 0);
+ block_info_t *pred_info = get_block_info(pred_block);
+
+ assert(pred_info != NULL);
+ workset_copy(ws, pred_info->end_workset);
+ } else {
+ /* we need 2 heuristics here, for the case when all predecessor blocks
+ * are known and when some are backedges (and therefore can't be known
+ * yet) */
+ decide_start_workset(block);
+ }
+
+ DB((dbg, DBG_DECIDE, "\n"));
+ DB((dbg, DBG_DECIDE, "Decide for %+F\n", block));
+
+ block_info = new_block_info();
+ set_block_info(block, block_info);
+
+ DB((dbg, DBG_WSETS, "Start workset for %+F:\n", block));
+ workset_foreach(ws, irn, iter) {
+ DB((dbg, DBG_WSETS, " %+F (%u)\n", irn,
+ workset_get_time(ws, iter)));
+ }