summaryrefslogtreecommitdiffstats
path: root/src/glsl/nir/nir_to_ssa.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2014-11-04 11:02:09 -0800
committerJason Ekstrand <[email protected]>2015-01-15 07:19:00 -0800
commit946012f10f93f249444436dc780ae74d477e44a3 (patch)
treeaacbd1abc60650e6d87a2b21f971761a77225802 /src/glsl/nir/nir_to_ssa.c
parentfbc443ad564a46e105e0b1d7a12a6f2b07c56b1d (diff)
nir: Automatically handle SSA uses when an instruction is inserted
Reviewed-by: Connor Abbott <[email protected]>
Diffstat (limited to 'src/glsl/nir/nir_to_ssa.c')
-rw-r--r--src/glsl/nir/nir_to_ssa.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/src/glsl/nir/nir_to_ssa.c b/src/glsl/nir/nir_to_ssa.c
index 26deb355e9c..fb36ff4f649 100644
--- a/src/glsl/nir/nir_to_ssa.c
+++ b/src/glsl/nir/nir_to_ssa.c
@@ -235,13 +235,8 @@ rewrite_def_forwards(nir_dest *dest, void *_state)
csel->dest.dest.reg.reg = dest->reg.reg;
csel->dest.write_mask = (1 << dest->reg.reg->num_components) - 1;
csel->src[0].src = nir_src_copy(*state->predicate, state->mem_ctx);
- if (csel->src[0].src.is_ssa)
- _mesa_set_add(csel->src[0].src.ssa->uses,
- _mesa_hash_pointer(&csel->instr), &csel->instr);
csel->src[2].src.is_ssa = true;
csel->src[2].src.ssa = get_ssa_src(dest->reg.reg, state);
- _mesa_set_add(csel->src[2].src.ssa->uses,
- _mesa_hash_pointer(&csel->instr), &csel->instr);
}
dest->is_ssa = true;
@@ -265,8 +260,6 @@ rewrite_def_forwards(nir_dest *dest, void *_state)
if (state->predicate) {
csel->src[1].src.is_ssa = true;
csel->src[1].src.ssa = &dest->ssa;
- _mesa_set_add(dest->ssa.uses, _mesa_hash_pointer(&csel->instr),
- &csel->instr);
nir_instr *old_parent_instr = state->parent_instr;
nir_src *old_predicate = state->predicate;
@@ -386,18 +379,11 @@ rewrite_alu_instr_forward(nir_alu_instr *instr, rewrite_state *state)
vec->src[i].src.ssa = old_src;
vec->src[i].swizzle[0] = i;
}
-
- _mesa_set_add(vec->src[i].src.ssa->uses,
- _mesa_hash_pointer(&vec->instr), &vec->instr);
}
vec->has_predicate = instr->has_predicate;
- if (instr->has_predicate) {
+ if (instr->has_predicate)
vec->predicate = nir_src_copy(instr->predicate, state->mem_ctx);
- if (vec->predicate.is_ssa)
- _mesa_set_add(vec->predicate.ssa->uses,
- _mesa_hash_pointer(&vec->instr), &vec->instr);
- }
nir_instr_insert_after(&instr->instr, &vec->instr);