nir: Make nir_ssa_def_rewrite_uses take an SSA value

This commit replaces the new_src parameter of nir_ssa_def_rewrite_uses()
with an SSA def, removes nir_ssa_def_rewrite_uses_ssa(), and rewrites
all the users as needed.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa@collabora.com>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9383>
This commit is contained in:
Jason Ekstrand
2021-03-03 00:13:38 -06:00
committed by Marge Bot
parent 13a0ee8a51
commit 117668b811
110 changed files with 194 additions and 205 deletions

View File

@@ -75,7 +75,7 @@ remap_tess_levels(nir_builder *b, nir_intrinsic_instr *intr,
if (nir_intrinsic_infos[intr->intrinsic].has_dest) {
b->cursor = nir_before_instr(&intr->instr);
nir_ssa_def *undef = nir_ssa_undef(b, 1, 32);
nir_ssa_def_rewrite_uses(&intr->dest.ssa, nir_src_for_ssa(undef));
nir_ssa_def_rewrite_uses(&intr->dest.ssa, undef);
}
nir_instr_remove(&intr->instr);
}
@@ -258,7 +258,7 @@ brw_nir_lower_vs_inputs(nir_shader *nir,
nir_builder_instr_insert(&b, &load->instr);
nir_ssa_def_rewrite_uses(&intrin->dest.ssa,
nir_src_for_ssa(&load->dest.ssa));
&load->dest.ssa);
nir_instr_remove(&intrin->instr);
break;
}