#include "irpass.h"
#include "tv_t.h"
#include "irtools.h"
+#include "firmstat_t.h"
#include "irprintf.h"
#include "irdump.h"
static void dump_split_list(const partition_t *list)
{
const partition_t *p;
+ char split = ' ';
DB((dbg, LEVEL_2, "Split by %s produced = {\n", what_reason));
- for (p = list; p != NULL; p = p->split_next)
- DB((dbg, LEVEL_2, "part%u, ", p->nr));
+ for (p = list; p != NULL; p = p->split_next) {
+ DB((dbg, LEVEL_2, "%c part%u", split, p->nr));
+ split = ',';
+ }
DB((dbg, LEVEL_2, "\n}\n"));
} /* dump_split_list */
/* for now, copy the type info tag, it will be adjusted in split_by(). */
Z_prime->type_is_T_or_C = Z->type_is_T_or_C;
- update_worklist(Z, Z_prime, env);
-
dump_partition("Now ", Z);
dump_partition("Created new ", Z_prime);
+
+ update_worklist(Z, Z_prime, env);
+
return Z_prime;
} /* split_no_followers */
check_partition(X);
check_partition(X_prime);
+ dump_partition("Now ", X);
+ dump_partition("Created new ", X_prime);
+
/* X' is the smaller part */
add_to_worklist(X_prime, env);
}
}
- dump_partition("Now ", X);
- dump_partition("Created new ", X_prime);
-
/* we have to ensure that the partition containing g is returned */
if (winner != 0) {
*pX = X_prime;
int i;
ir_node *block = node->node;
- if (block == get_irg_start_block(current_ir_graph) || get_Block_entity(block) != NULL) {
+ ir_graph *const irg = get_Block_irg(block);
+ if (block == get_irg_start_block(irg) || get_Block_entity(block) != NULL) {
/* start block and labelled blocks are always reachable */
node->type.tv = tarval_reachable;
return;
/* x will make the follower -> leader transition */
follower_to_leader(x);
+
+ /* In case of a follower -> leader transition of a Phi node
+ * we have to ensure that the current partition will be split
+ * by lambda n.(n[i].partition).
+ *
+ * This split may already happened before when some predecessors
+ * of the Phi's Block are unreachable. Thus, we have to put the
+ * current partition in the worklist to repeat the check.
+ */
+ if (is_Phi(x->node) && ! x->part->on_worklist)
+ add_to_worklist(x->part, env);
}
/* compute a new type for x */
}
}
- if (block == get_irg_end_block(current_ir_graph)) {
+ ir_graph *const irg = get_Block_irg(block);
+ if (block == get_irg_end_block(irg)) {
/* Analysis found out that the end block is unreachable,
* hence we remove all its control flow predecessors. */
set_irn_in(block, 0, NULL);