Lines Matching defs:block

50    std::vector<Operand> outputs; /* the output per block */
71 Block& block = program->blocks[block_idx];
72 size_t pred = block.linear_preds.size();
74 if (block.loop_nest_depth < state->loop_nest_depth) {
77 } else if (block.loop_nest_depth > state->loop_nest_depth || pred == 1 ||
78 block.kind & block_kind_loop_exit) {
79 op = get_ssa(program, block.linear_preds[0], state, false);
84 if (block.kind & block_kind_loop_header) {
94 ops[i] = get_ssa(program, block.linear_preds[i], state, false);
104 if (block.kind & block_kind_loop_header)
115 block.instructions.emplace(block.instructions.begin(), std::move(phi));
123 insert_before_logical_end(Block* block, aco_ptr<Instruction> instr)
127 auto it = std::find_if(block->instructions.crbegin(), block->instructions.crend(), IsLogicalEnd);
129 if (it == block->instructions.crend()) {
130 assert(block->instructions.back()->isBranch());
131 block->instructions.insert(std::prev(block->instructions.end()), std::move(instr));
133 block->instructions.insert(std::prev(it.base()), std::move(instr));
138 build_merge_code(Program* program, ssa_state* state, Block* block, Operand cur)
140 unsigned block_idx = block->index;
149 auto it = std::find_if(block->instructions.rbegin(), block->instructions.rend(), IsLogicalEnd);
150 assert(it != block->instructions.rend());
151 bld.reset(&block->instructions, std::prev(it.base()));
196 init_any_pred_defined(Program* program, ssa_state* state, Block* block, aco_ptr<Instruction>& phi)
199 for (unsigned i = 0; i < block->logical_preds.size(); i++) {
205 for (unsigned succ : program->blocks[block->logical_preds[i]].linear_succs)
209 unsigned start = block->logical_preds[0];
210 unsigned end = block->index;
213 if (block->kind & block_kind_loop_exit) {
222 if (block->kind & block_kind_loop_header) {
226 state->any_pred_defined[block->index] = pred_defined::undef;
232 if (block->kind & block_kind_loop_exit) {
248 state->any_pred_defined[block->index] = pred_defined::undef;
252 lower_divergent_bool_phi(Program* program, ssa_state* state, Block* block,
258 state->all_preds_uniform = !(block->kind & block_kind_merge) &&
259 block->linear_preds.size() == block->logical_preds.size();
260 for (unsigned pred : block->logical_preds)
275 state->loop_nest_depth = block->loop_nest_depth;
276 if (block->kind & block_kind_loop_exit)
279 init_any_pred_defined(program, state, block, phi);
282 unsigned pred = block->logical_preds[i];
292 build_merge_code(program, state, &program->blocks[block->logical_preds[i]], phi->operands[i]);
294 unsigned num_preds = block->linear_preds.size();
306 phi->operands[i] = get_ssa(program, block->linear_preds[i], state, false);
312 lower_subdword_phis(Program* program, Block* block, aco_ptr<Instruction>& phi)
322 Block* pred = &program->blocks[block->logical_preds[i]];
343 for (Block& block : program->blocks) {
345 for (aco_ptr<Instruction>& phi : block.instructions) {
350 lower_divergent_bool_phi(program, &state, &block, phi);
352 lower_subdword_phis(program, &block, phi);