Lines Matching refs:def
756 nir_ssa_def_init(&instr->instr, &instr->def, num_components, bit_size);
897 * Note that this does not update the def/use relationship for src, assuming
937 nir_ssa_def_init(&instr->instr, &instr->def, num_components, bit_size);
1090 add_ssa_def_cb(nir_ssa_def *def, void *state)
1094 if (instr->block && def->index == UINT_MAX) {
1098 def->index = impl->ssa_alloc++;
1288 static bool nir_instr_free_and_dce_live_cb(nir_ssa_def *def, void *state)
1292 if (!nir_ssa_def_is_unused(def)) {
1421 return cb(&nir_instr_as_load_const(instr)->def, state);
1423 return cb(&nir_instr_as_ssa_undef(instr)->def, state);
1466 return &nir_instr_as_load_const(instr)->def;
1469 return &nir_instr_as_ssa_undef(instr)->def;
1723 /* We can't re-write with an SSA def */
1737 nir_ssa_def_init(nir_instr *instr, nir_ssa_def *def,
1741 def->parent_instr = instr;
1742 list_inithead(&def->uses);
1743 list_inithead(&def->if_uses);
1744 def->num_components = num_components;
1745 def->bit_size = bit_size;
1746 def->divergent = true; /* This is the safer default */
1752 def->index = impl->ssa_alloc++;
1756 def->index = UINT_MAX;
1771 nir_ssa_def_rewrite_uses(nir_ssa_def *def, nir_ssa_def *new_ssa)
1773 assert(def != new_ssa);
1774 nir_foreach_use_safe(use_src, def)
1777 nir_foreach_if_use_safe(use_src, def)
1782 nir_ssa_def_rewrite_uses_src(nir_ssa_def *def, nir_src new_src)
1785 nir_ssa_def_rewrite_uses(def, new_src.ssa);
1787 nir_foreach_use_safe(use_src, def)
1790 nir_foreach_if_use_safe(use_src, def)
1815 /* Replaces all uses of the given SSA def with the given source but only if
1823 * def->parent_instr and that after_me comes after def->parent_instr.
1826 nir_ssa_def_rewrite_uses_after(nir_ssa_def *def, nir_ssa_def *new_ssa,
1829 if (def == new_ssa)
1832 nir_foreach_use_safe(use_src, def) {
1833 assert(use_src->parent_instr != def->parent_instr);
1834 /* Since def already dominates all of its uses, the only way a use can
1835 * not be dominated by after_me is if it is between def and after_me in
1838 if (!is_instr_between(def->parent_instr, after_me, use_src->parent_instr))
1842 nir_foreach_if_use_safe(use_src, def) {
1885 nir_ssa_def_components_read(const nir_ssa_def *def)
1889 if (!list_is_empty(&def->if_uses))
1892 nir_foreach_use(use, def) {
1894 if (read_mask == (1 << def->num_components) - 1)
2150 index_ssa_def_cb(nir_ssa_def *def, void *state)
2153 def->index = (*index)++;
2285 * Save off the uses from instr's SSA def so we know what uses to
2948 nir_alu_instr *alu = nir_instr_as_alu(s.def->parent_instr);
2953 s.def = alu->src[0].src.ssa;
2957 s.def = alu->src[s.comp].src.ssa;