Lines Matching defs:block

585    nir_block *block = rzalloc(shader, nir_block);
587 cf_init(&block->cf_node, nir_cf_node_block);
589 block->successors[0] = block->successors[1] = NULL;
590 block->predecessors = _mesa_pointer_set_create(block);
591 block->imm_dom = NULL;
600 block->dom_frontier = _mesa_pointer_set_create(block);
602 exec_list_make_empty(&block->instr_list);
604 return block;
663 instr->block = NULL;
1024 * go up to block granularity when possible.
1031 if (exec_list_is_empty(&cursor.block->instr_list)) {
1032 /* Empty block. After is as good as before. */
1047 /* No previous instruction. Switch to before block */
1048 cursor.block = cursor.instr->block;
1056 /* This is the last instruction, switch to after block */
1058 cursor.block = cursor.instr->block;
1074 return a.block == b.block && a.option == b.option;
1094 if (instr->block && def->index == UINT_MAX) {
1096 nir_cf_node_get_function(&instr->block->cf_node);
1134 assert(exec_list_is_empty(&cursor.block->instr_list));
1136 instr->block = cursor.block;
1138 exec_list_push_head(&cursor.block->instr_list, &instr->node);
1142 nir_instr *last = nir_block_last_instr(cursor.block);
1146 instr->block = cursor.block;
1148 exec_list_push_tail(&cursor.block->instr_list, &instr->node);
1153 instr->block = cursor.instr->block;
1161 /* Only allow inserting jumps at the end of the block. */
1163 assert(cursor.instr == nir_block_last_instr(cursor.instr->block));
1165 instr->block = cursor.instr->block;
1172 nir_handle_add_jump(instr->block);
1174 nir_function_impl *impl = nir_cf_node_get_function(&instr->block->cf_node);
1236 nir_handle_remove_jump(instr->block, jump_instr->type);
1517 nir_foreach_phi_src_leaving_block(nir_block *block,
1521 for (unsigned i = 0; i < ARRAY_SIZE(block->successors); i++) {
1522 if (block->successors[i] == NULL)
1525 nir_foreach_instr(instr, block->successors[i]) {
1531 if (phi_src->pred == block) {
1615 * "Any member of a push constant block that is declared as an array must
1748 if (instr->block) {
1750 nir_cf_node_get_function(&instr->block->cf_node);
1798 assert(start->block == end->block);
1800 if (between->block != start->block)
1822 * This function assumes that after_me is in the same block as
1902 nir_block_unstructured_next(nir_block *block)
1904 if (block == NULL) {
1906 * NULL block after the last iteration, but it won't use the result so
1912 nir_cf_node *cf_next = nir_cf_node_next(&block->cf_node);
1913 if (cf_next == NULL && block->cf_node.parent->type == nir_cf_node_function)
1919 return nir_block_cf_tree_next(block);
1929 nir_block_cf_tree_next(nir_block *block)
1931 if (block == NULL) {
1932 /* nir_foreach_block_safe() will call this function on a NULL block
1939 assert(nir_cf_node_get_function(&block->cf_node)->structured);
1941 nir_cf_node *cf_next = nir_cf_node_next(&block->cf_node);
1945 nir_cf_node *parent = block->cf_node.parent;
1951 if (block == nir_if_last_then_block(if_stmt))
1954 assert(block == nir_if_last_else_block(if_stmt));
1970 nir_block_cf_tree_prev(nir_block *block)
1972 if (block == NULL) {
1977 assert(nir_cf_node_get_function(&block->cf_node)->structured);
1979 nir_cf_node *cf_prev = nir_cf_node_prev(&block->cf_node);
1983 nir_cf_node *parent = block->cf_node.parent;
1989 if (block == nir_if_first_else_block(if_stmt))
1992 assert(block == nir_if_first_then_block(if_stmt));
2072 nir_block_get_following_if(nir_block *block)
2074 if (exec_node_is_tail_sentinel(&block->cf_node.node))
2077 if (nir_cf_node_is_last(&block->cf_node))
2080 nir_cf_node *next_node = nir_cf_node_next(&block->cf_node);
2089 nir_block_get_following_loop(nir_block *block)
2091 if (exec_node_is_tail_sentinel(&block->cf_node.node))
2094 if (nir_cf_node_is_last(&block->cf_node))
2097 nir_cf_node *next_node = nir_cf_node_next(&block->cf_node);
2115 nir_block_get_predecessors_sorted(const nir_block *block, void *mem_ctx)
2118 ralloc_array(mem_ctx, nir_block *, block->predecessors->entries);
2121 set_foreach(block->predecessors, entry)
2123 assert(i == block->predecessors->entries);
2125 qsort(preds, block->predecessors->entries, sizeof(nir_block *),
2139 nir_foreach_block_unstructured(block, impl) {
2140 block->index = index++;
2169 nir_foreach_block_unstructured(block, impl) {
2170 nir_foreach_instr(instr, block)
2186 nir_foreach_block(block, impl) {
2187 block->start_ip = index++;
2189 nir_foreach_instr(instr, block)
2192 block->end_ip = index++;
2221 for (nir_block *block = cursor.block; block;
2222 block = nir_block_cf_tree_next(block)) {
2223 nir_instr *instr = nir_block_first_instr(block);
2230 cursor.block = nir_block_cf_tree_next(cursor.block);
2231 if (cursor.block == NULL)
2245 cursor.block = cursor.instr->block;
2307 if (new_def->parent_instr->block != instr->block)