+/** The tarval returned by Unknown nodes. */
+static tarval *tarval_UNKNOWN;
+
+/* forward */
+static node_t *identity(node_t *node);
+
+#ifdef CHECK_PARTITIONS
+/**
+ * Check a partition.
+ */
+static void check_partition(const partition_t *T) {
+ node_t *node;
+ unsigned n = 0;
+
+ list_for_each_entry(node_t, node, &T->Leader, node_list) {
+ assert(node->is_follower == 0);
+ assert(node->flagged == 0);
+ assert(node->part == T);
+ ++n;
+ }
+ assert(n == T->n_leader);
+
+ list_for_each_entry(node_t, node, &T->Follower, node_list) {
+ assert(node->is_follower == 1);
+ assert(node->flagged == 0);
+ assert(node->part == T);
+ }
+} /* check_partition */
+
+/**
+ * check that all leader nodes in the partition have the same opcode.
+ */
+static void check_opcode(const partition_t *Z) {
+ node_t *node;
+ opcode_key_t key;
+ int first = 1;
+
+ list_for_each_entry(node_t, node, &Z->Leader, node_list) {
+ ir_node *irn = node->node;
+
+ if (first) {
+ key.code = get_irn_opcode(irn);
+ key.mode = get_irn_mode(irn);
+ key.arity = get_irn_arity(irn);
+ key.u.proj = 0;
+ key.u.ent = NULL;
+
+ switch (get_irn_opcode(irn)) {
+ case iro_Proj:
+ key.u.proj = get_Proj_proj(irn);
+ break;
+ case iro_Sel:
+ key.u.ent = get_Sel_entity(irn);
+ break;
+ default:
+ break;
+ }
+ first = 0;
+ } else {
+ assert(key.code == get_irn_opcode(irn));
+ assert(key.mode == get_irn_mode(irn));
+ assert(key.arity == get_irn_arity(irn));
+
+ switch (get_irn_opcode(irn)) {
+ case iro_Proj:
+ assert(key.u.proj == get_Proj_proj(irn));
+ break;
+ case iro_Sel:
+ assert(key.u.ent == get_Sel_entity(irn));
+ break;
+ default:
+ break;
+ }
+ }
+ }
+} /* check_opcode */
+
+static void check_all_partitions(environment_t *env) {