diff options
author | Jason Ekstrand <[email protected]> | 2019-04-17 17:18:19 -0500 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2019-04-18 17:12:44 +0000 |
commit | c6463f8ac2a9f85874c882fd5307eefb29f86bc1 (patch) | |
tree | 63a286384c4e9ffa41d3001bc1b308b7571cb07e /src/compiler/nir/nir_split_vars.c | |
parent | 85c35885b383477ac4f92a11695fc85c6d45c98c (diff) |
nir: Add a nir_src_as_intrinsic() helper
Reviewed-by: Eric Anholt <[email protected]>
Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_split_vars.c')
-rw-r--r-- | src/compiler/nir/nir_split_vars.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/compiler/nir/nir_split_vars.c b/src/compiler/nir/nir_split_vars.c index c6fe1b59a65..5e799d2dc57 100644 --- a/src/compiler/nir/nir_split_vars.c +++ b/src/compiler/nir/nir_split_vars.c @@ -1030,14 +1030,8 @@ mark_deref_used(nir_deref_instr *deref, static bool src_is_load_deref(nir_src src, nir_src deref_src) { - assert(src.is_ssa); - assert(deref_src.is_ssa); - - if (src.ssa->parent_instr->type != nir_instr_type_intrinsic) - return false; - - nir_intrinsic_instr *load = nir_instr_as_intrinsic(src.ssa->parent_instr); - if (load->intrinsic != nir_intrinsic_load_deref) + nir_intrinsic_instr *load = nir_src_as_intrinsic(src); + if (load == NULL || load->intrinsic != nir_intrinsic_load_deref) return false; assert(load->src[0].is_ssa); |