summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-11-11 21:13:26 -0800
committerJason Ekstrand <[email protected]>2015-11-23 11:04:49 -0800
commit384396a69bdfec9971337863ae69266c7fa4a2e8 (patch)
treeadef53e156400f07b506db556c49f8b5f334ea90 /src
parent03c9ad900e4f1feb2a4df8dd0c563937d999ae5d (diff)
nir: Use instr/if_rewrite in nir_ssa_def_rewrite_uses
nir_ssa_def_rewrite_uses is one of the older helpers in NIR and predated both of those. Now it can be substantially simplified. Reviewed-by: Connor Abbott <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/glsl/nir/nir.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c
index 8956b7e56ca..470469429dd 100644
--- a/src/glsl/nir/nir.c
+++ b/src/glsl/nir/nir.c
@@ -1312,19 +1312,11 @@ nir_ssa_def_rewrite_uses(nir_ssa_def *def, nir_src new_src)
{
assert(!new_src.is_ssa || def != new_src.ssa);
- nir_foreach_use_safe(def, use_src) {
- nir_instr *src_parent_instr = use_src->parent_instr;
- list_del(&use_src->use_link);
- nir_src_copy(use_src, &new_src, src_parent_instr);
- src_add_all_uses(use_src, src_parent_instr, NULL);
- }
+ nir_foreach_use_safe(def, use_src)
+ nir_instr_rewrite_src(use_src->parent_instr, use_src, new_src);
- nir_foreach_if_use_safe(def, use_src) {
- nir_if *src_parent_if = use_src->parent_if;
- list_del(&use_src->use_link);
- nir_src_copy(use_src, &new_src, src_parent_if);
- src_add_all_uses(use_src, NULL, src_parent_if);
- }
+ nir_foreach_if_use_safe(def, use_src)
+ nir_if_rewrite_condition(use_src->parent_if, new_src);
}