diff options
author | Jason Ekstrand <[email protected]> | 2018-03-14 21:45:38 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2018-06-22 20:15:53 -0700 |
commit | 19a4662a540a8c940310a75f19bc8cd75be651e0 (patch) | |
tree | be24fd16f6a4b55529b015442f709971938d44a8 /src/compiler/nir/nir_opt_dce.c | |
parent | 5fbbbda37a09e6d253532fd83097b21cd289c16b (diff) |
nir: Add a deref instruction type
This commit adds a new instruction type to NIR for handling derefs.
Nothing uses it yet but this adds the data structure as well as all of
the code to validate, print, clone, and [de]serialize them.
Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
Acked-by: Rob Clark <[email protected]>
Acked-by: Bas Nieuwenhuizen <[email protected]>
Acked-by: Dave Airlie <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_opt_dce.c')
-rw-r--r-- | src/compiler/nir/nir_opt_dce.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_opt_dce.c b/src/compiler/nir/nir_opt_dce.c index 570e43000c0..c9b338862e6 100644 --- a/src/compiler/nir/nir_opt_dce.c +++ b/src/compiler/nir/nir_opt_dce.c @@ -52,6 +52,7 @@ static void init_instr(nir_instr *instr, nir_instr_worklist *worklist) { nir_alu_instr *alu_instr; + nir_deref_instr *deref_instr; nir_intrinsic_instr *intrin_instr; nir_tex_instr *tex_instr; @@ -73,6 +74,12 @@ init_instr(nir_instr *instr, nir_instr_worklist *worklist) mark_and_push(worklist, instr); break; + case nir_instr_type_deref: + deref_instr = nir_instr_as_deref(instr); + if (!deref_instr->dest.is_ssa) + mark_and_push(worklist, instr); + break; + case nir_instr_type_intrinsic: intrin_instr = nir_instr_as_intrinsic(instr); if (nir_intrinsic_infos[intrin_instr->intrinsic].flags & |