* any predecessors that need to be unlinked.
*/
- assert(node->type == nir_cf_node_loop);
-
nir_loop *loop = nir_cf_node_as_loop(node);
nir_block *loop_header_block = nir_loop_first_block(loop);
}
/* Any phi nodes must stay part of the new block, or else their
- * sourcse will be messed up. This will reverse the order of the phi's, but
+ * sourcse will be messed up. This will reverse the order of the phis, but
* order shouldn't matter.
*/
nir_foreach_instr_safe(instr, block) {
nir_cf_node *parent = block->cf_node.parent;
if (parent->type == nir_cf_node_if) {
nir_cf_node *next = nir_cf_node_next(parent);
- assert(next->type == nir_cf_node_block);
nir_block *next_block = nir_cf_node_as_block(next);
link_blocks(block, next_block, NULL);
link_blocks(block, head_block, NULL);
insert_phi_undef(head_block, block);
} else {
- assert(parent->type == nir_cf_node_function);
nir_function_impl *impl = nir_cf_node_as_function(parent);
link_blocks(block, impl->end_block, NULL);
}
link_blocks(block, first_then_block, first_else_block);
} else {
- assert(next->type == nir_cf_node_loop);
nir_loop *next_loop = nir_cf_node_as_loop(next);
nir_block *first_block = nir_loop_first_block(next_loop);
link_blocks(block, first_block, NULL);
} else {
nir_cf_node *after = nir_cf_node_next(&loop->cf_node);
- assert(after->type == nir_cf_node_block);
nir_block *after_block = nir_cf_node_as_block(after);
link_blocks(block, after_block, NULL);
}