Lines Matching defs:block
49 /* Number of loops this block is inside */
52 /* Number of ifs this block is inside */
57 /* The loop the block is nested inside or NULL */
60 /* The last instruction inserted into this block. This is used as we
106 nir_block *block = nir_cf_node_as_block(node);
107 nir_foreach_instr(instr, block) {
140 nir_block *block = nir_cf_node_as_block(node);
141 state->blocks[block->index].if_depth = if_depth;
142 state->blocks[block->index].loop_depth = loop_depth;
143 state->blocks[block->index].loop_instr_count = loop_instr_count;
144 state->blocks[block->index].loop = loop;
311 nir_foreach_block(block, impl) {
312 nir_foreach_instr_safe(instr, block) {
424 * scheduled and then update this instruction's block if the source
476 /* Pinned/placed instructions always get scheduled in their original block so
482 state->instr_infos[instr->index].early_block = instr->block;
497 nir_block *block)
502 nir_loop *loop = state->blocks[instr->block->index].loop;
506 if (nir_block_dominates(instr->block, block))
531 if (state->blocks[instr->block->index].loop_instr_count < MAX_LOOP_INSTRUCTIONS)
543 nir_block *block)
563 /* First see if we can push the instruction down into an if-statements block */
565 for (nir_block *block = late_block; block != NULL; block = block->imm_dom) {
566 if (state->blocks[block->index].loop_depth >
567 state->blocks[instr->block->index].loop_depth)
570 if (state->blocks[block->index].if_depth >=
572 set_block_to_if_block(state, instr, block)) {
574 * in the earliest block not the latest to avoid creating register
576 * block the instruction was originally in.
578 best = block;
580 if (block == instr->block)
582 } else if (block == instr->block) {
587 best = block;
591 if (block == early_block)
596 for (nir_block *block = late_block; block != NULL; block = block->imm_dom) {
597 if (state->blocks[block->index].loop_depth <
599 if (set_block_for_loop_instr(state, instr, block)) {
600 best = block;
601 } else if (block == instr->block) {
603 best = block;
608 if (block == early_block)
639 * have to dominate the predecessor block corresponding to the phi
652 lca = nir_dominance_lca(lca, use_instr->block);
659 /* For if statements, we consider the block to be the one immediately
675 def->parent_instr->block = NULL;
680 lca != def->parent_instr->block &&
681 nir_block_dominates(def->parent_instr->block, lca)) {
682 lca = def->parent_instr->block;
686 * this is dominated by the block that we chose when scheduling early.
687 * We now walk up the dominance tree and pick the lowest block that is
693 if (def->parent_instr->block != best_block)
696 def->parent_instr->block = best_block;
706 * are "scheduled" by updating their instr->block field.
758 * onto the end of their new block and instructions that were scheduled later to
759 * the start of their new block.
769 if (instr->block == NULL) {
775 struct gcm_block_info *block_info = &state->blocks[instr->block->index];
782 /* Schedule it at the end of the block */
783 nir_instr *jump_instr = nir_block_last_instr(instr->block);
787 exec_list_push_tail(&instr->block->instr_list, &instr->node);
804 nir_foreach_block(block, impl)
805 nir_foreach_instr(instr, block)