Lines Matching refs:bcsel
305 nir_alu_instr *const bcsel = nir_instr_as_alu(instr);
306 if (!nir_op_is_selection(bcsel->op))
310 if (!nir_alu_src_is_trivial_ssa(bcsel, i) ||
311 bcsel->src[i].src.ssa->parent_instr->block != instr->block)
314 if (bcsel->src[i].src.ssa->parent_instr->type != nir_instr_type_phi) {
322 nir_foreach_phi_src(src, nir_instr_as_phi(bcsel->src[0].src.ssa->parent_instr)) {
346 * the only ALU user is a trivial bcsel that gets removed by peeling the ALU
494 /* check if the only user is a trivial bcsel */
551 * Simplify a bcsel whose sources are all phi nodes from the loop header block
553 * bcsel instructions in a loop that meet the following criteria can be
559 * - All of the sources of the bcsel are phi nodes in the header block of the
562 * - The phi node representing the condition of the bcsel instruction chooses
570 * the bcsel result are updated to use the phi node result.
618 * source of the bcsel that is selected when entering from outside the loop.
641 /* We can move any bcsel that can guaranteed to execut on every iteration
644 * bcsel that must come before any break.
653 nir_alu_instr *const bcsel = nir_instr_as_alu(instr);
655 nir_instr_as_phi(bcsel->src[0].src.ssa->parent_instr);
674 * the bcsel source that is selected by entry_val and the value for
675 * continue_block from the other bcsel source. Both sources have
681 nir_phi_get_src_from_block(nir_instr_as_phi(bcsel->src[entry_src].src.ssa->parent_instr),
685 nir_phi_get_src_from_block(nir_instr_as_phi(bcsel->src[continue_src].src.ssa->parent_instr),
690 nir_dest_num_components(bcsel->dest.dest),
691 nir_dest_bit_size(bcsel->dest.dest),
697 /* Modify all readers of the bcsel instruction to read the result of
700 nir_ssa_def_rewrite_uses(&bcsel->dest.dest.ssa,
703 /* Since the original bcsel instruction no longer has any readers,
706 nir_instr_remove_v(&bcsel->instr);
707 nir_instr_free(&bcsel->instr);