Lines Matching defs:block
35 * blocks so that the destinations of a phi are in the livein of the block
37 * corresponding block. By formulating the liveness information in this
42 * block but not in the live-in of the block containing the phi node.
54 /* Initialize the liveness data to zero and add the given block to the
58 init_liveness_block(nir_block *block,
61 block->live_in = reralloc(block, block->live_in, BITSET_WORD,
63 memset(block->live_in, 0, state->bitset_words * sizeof(BITSET_WORD));
65 block->live_out = reralloc(block, block->live_out, BITSET_WORD,
67 memset(block->live_out, 0, state->bitset_words * sizeof(BITSET_WORD));
69 nir_block_worklist_push_head(&state->worklist, block);
101 * block act "in parallel". When we propagate from the live_in of one
102 * block to the live out of the other, we have to kill any writes from phis
162 nir_foreach_block(block, impl) {
163 init_liveness_block(block, &state);
169 * block in the function implementation has been pushed onto the
178 nir_block *block = nir_block_worklist_pop_head(&state.worklist);
180 memcpy(block->live_in, block->live_out,
183 nir_if *following_if = nir_block_get_following_if(block);
185 set_src_live(&following_if->condition, block->live_in);
187 nir_foreach_instr_reverse(instr, block) {
195 nir_foreach_ssa_def(instr, set_ssa_def_dead, block->live_in);
196 nir_foreach_src(instr, set_src_live, block->live_in);
199 /* Walk over all of the predecessors of the current block updating
204 set_foreach(block->predecessors, entry) {
206 if (propagate_across_edge(pred, block, &state))
217 * Note: The bitset returned may be the live_in or live_out from the block in
224 nir_block *block = nir_cursor_current_block(cursor);
225 nir_function_impl *impl = nir_cf_node_get_function(&block->cf_node);
230 return cursor.block->live_in;
233 return cursor.block->live_out;
236 if (cursor.instr == nir_block_first_instr(cursor.instr->block))
237 return cursor.instr->block->live_in;
241 if (cursor.instr == nir_block_last_instr(cursor.instr->block))
242 return cursor.instr->block->live_out;
246 /* If we got here, we're an instruction cursor mid-block */
249 memcpy(live, block->live_out, bitset_words * sizeof(BITSET_WORD));
251 nir_foreach_instr_reverse(instr, block) {
291 /* If uses are considered to be in the block immediately preceding the if
294 nir_if *following_if = nir_block_get_following_if(start->block);
308 if (BITSET_TEST(instr->block->live_out, def->index)) {
309 /* Since def dominates instr, if def is in the liveout of the block,
314 if (BITSET_TEST(instr->block->live_in, def->index) ||
315 def->parent_instr->block == instr->block) {
316 /* In this case it is either live coming into instr's block or it
317 * is defined in the same block. In this case, we simply need to