return nir_after_block(nir_cf_node_as_block(node));
nir_block *block = nir_cf_node_as_block(nir_cf_node_next(node));
- assert(block->cf_node.type == nir_cf_node_block);
return nir_after_phis(block);
}
* 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);
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);
}
nir_deref *tail = &instr->variables[0]->deref;
while (tail->child != NULL) {
- assert(tail->child->deref_type == nir_deref_type_array);
nir_deref_array *deref_array = nir_deref_as_array(tail->child);
tail = tail->child;
int start, int end,
nir_ssa_def **dest, nir_ssa_def *src)
{
- assert(arr_parent->child &&
- arr_parent->child->deref_type == nir_deref_type_array);
nir_deref_array *arr = nir_deref_as_array(arr_parent->child);
assert(arr->deref_array_type == nir_deref_array_type_indirect);
assert(arr->indirect.is_ssa);
*/
if (vertex_index != NULL) {
tail = tail->child;
- assert(tail->deref_type == nir_deref_type_array);
nir_deref_array *deref_array = nir_deref_as_array(tail);
nir_ssa_def *vtx = nir_imm_int(b, deref_array->base_offset);
list_for_each_entry(nir_src, use_src, ®->if_uses, use_link) {
nir_cf_node *prev_node = nir_cf_node_prev(&use_src->parent_if->cf_node);
- assert(prev_node->type == nir_cf_node_block);
lca = nir_dominance_lca(lca, nir_cf_node_as_block(prev_node));
}
nir_foreach_use(child_src, &alu->dest.dest.ssa) {
assert(child_src->is_ssa);
- nir_instr *child = child_src->parent_instr;
- assert(child->type == nir_instr_type_alu);
- nir_alu_instr *child_alu = nir_instr_as_alu(child);
+ nir_alu_instr *child_alu = nir_instr_as_alu(child_src->parent_instr);
child_alu->op = nir_op_fmov;
child_alu->dest.saturate = false;
*/
nir_block *prev_block = nir_cf_node_as_block(nir_cf_node_prev(prev_node));
- assert(prev_block->cf_node.type == nir_cf_node_block);
/* First, we move the remaining instructions from the blocks to the
* block before. We have already guaranteed that this is safe by