diff options
author | Eric Anholt <[email protected]> | 2015-01-20 16:23:51 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2015-01-22 13:52:19 -0800 |
commit | 534a4ec82f09fa37e2134c994082e71c79b7d5ec (patch) | |
tree | 598ab6b45e9a47d997c7d09881a6bad54c805d45 /src/glsl/nir/nir_to_ssa.c | |
parent | c5be9c126d6ca9380cd381a5eb22554e4bb71a64 (diff) |
nir: Make an easier helper for setting up SSA defs.
Almost all instructions we nir_ssa_def_init() for are nir_dests, and you
have to keep from forgetting to set is_ssa when you do. Just provide the
simpler helper, instead.
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/glsl/nir/nir_to_ssa.c')
-rw-r--r-- | src/glsl/nir/nir_to_ssa.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/glsl/nir/nir_to_ssa.c b/src/glsl/nir/nir_to_ssa.c index 548f0c5ac23..9c577fa9924 100644 --- a/src/glsl/nir/nir_to_ssa.c +++ b/src/glsl/nir/nir_to_ssa.c @@ -214,15 +214,12 @@ rewrite_def_forwards(nir_dest *dest, void *_state) if (state->states[index].stack == NULL) return true; - dest->is_ssa = true; - char *name = NULL; if (dest->reg.reg->name) name = ralloc_asprintf(state->mem_ctx, "%s_%u", dest->reg.reg->name, state->states[index].num_defs); - nir_ssa_def_init(state->parent_instr, &dest->ssa, - reg->num_components, name); + nir_ssa_dest_init(state->parent_instr, dest, reg->num_components, name); /* push our SSA destination on the stack */ state->states[index].index++; @@ -270,9 +267,7 @@ rewrite_alu_instr_forward(nir_alu_instr *instr, rewrite_state *state) reg->name, state->states[index].num_defs); instr->dest.write_mask = (1 << num_components) - 1; - instr->dest.dest.is_ssa = true; - nir_ssa_def_init(&instr->instr, &instr->dest.dest.ssa, - num_components, name); + nir_ssa_dest_init(&instr->instr, &instr->dest.dest, num_components, name); if (nir_op_infos[instr->op].output_size == 0) { /* |