#include "irpass.h"
#include "tv_t.h"
#include "irtools.h"
+#include "firmstat_t.h"
#include "irprintf.h"
#include "irdump.h"
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);