Lines Matching defs:phi
320 /* If one of our successors has at least one phi node, we need to
352 /** Isolate phi nodes with parallel copies
355 * destinations of phi nodes, we first isolate them by adding parallel
357 * phi nodes, we add a parallel copy immediately following the last phi
358 * node that copies the destinations of all of the phi nodes to new SSA
360 * a successor with phi nodes that, for each phi node in each successor,
361 * copies the corresponding sorce of the phi node and adjust the phi to
365 * ensure that each value used in a phi also has exactly one use. The
367 * following the phi nodes and. Thanks to the parallel copy at the end of
368 * the predecessor block, the sources of phi nodes are are the only use of
370 * destinations of any given phi node to the same register without worrying
396 /* If we have phi nodes, we need to create a parallel copy at the
397 * start of this block but after the phi nodes.
408 nir_phi_instr *phi = nir_instr_as_phi(instr);
409 assert(phi->dest.is_ssa);
410 nir_foreach_phi_src(src, phi) {
421 phi->dest.ssa.num_components,
422 phi->dest.ssa.bit_size, NULL);
429 nir_instr_rewrite_src(&phi->instr, &src->src,
436 phi->dest.ssa.num_components, phi->dest.ssa.bit_size,
438 entry->dest.ssa.divergent = phi->dest.ssa.divergent;
441 nir_ssa_def_rewrite_uses(&phi->dest.ssa,
445 nir_src_for_ssa(&phi->dest.ssa));
459 nir_phi_instr *phi = nir_instr_as_phi(instr);
461 assert(phi->dest.is_ssa);
462 merge_node *dest_node = get_merge_node(&phi->dest.ssa, state);
464 nir_foreach_phi_src(src, phi) {
561 /* In this case, we're part of a phi web. Use the web's register. */
579 * the backend. If it got coalesced into a phi, that's ok.
614 * remove phi nodes.
839 * two: One at the beginning, right after all the phi noces, and one at
845 /* At this point, we have removed all of the phi nodes. If a parallel
846 * copy existed right after the phi nodes in this block, it is now the
977 /** Lower all of the phi nodes in a block to movs to and from a register
983 * phis after you call regs_to_ssa and do some copy propagation. For each phi
986 * 1. For each phi instruction in the block, create a new nir_register
988 * 2. Insert movs at the top of the destination block for each phi and
989 * rewrite all uses of the phi to use the mov.
991 * 3. For each phi source, insert movs in the predecessor block from the phi
992 * source to the register associated with the phi.
995 * each phi and emit movs on both sides of the control-flow edge. Because all
997 * temporary for each phi, all movs inserted in any particular block have
1001 * the phi sources as high up the predecessor tree as possible instead of in
1019 nir_phi_instr *phi = nir_instr_as_phi(instr);
1020 assert(phi->dest.is_ssa);
1022 nir_register *reg = create_reg_for_ssa_def(&phi->dest.ssa, b.impl);
1024 b.cursor = nir_after_instr(&phi->instr);
1027 nir_ssa_def_rewrite_uses(&phi->dest.ssa, def);
1029 nir_foreach_phi_src(src, phi) {
1037 nir_ssa_for_src(&b, src->src, phi->dest.ssa.num_components);
1042 nir_instr_remove(&phi->instr);
1100 * result in phi nodes with register sources which is technically invalid.