diff options
author | Jason Ekstrand <[email protected]> | 2018-06-25 09:13:04 -0700 |
---|---|---|
committer | Dylan Baker <[email protected]> | 2018-06-26 08:40:14 -0700 |
commit | d96eecbdd7f0f67a45c8a839a6757c4c6f2f507b (patch) | |
tree | e1f97daa6681bc30b8593feb8abd0396004a65fe /src/compiler | |
parent | 915d9166bf4cfdc239cf28b92c988ae1b00caa5c (diff) |
nir: Handle call instructions in foreach_src
Even though they don't have regular sources, they do have derefs and
those may have implied sources that should be handled.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106980
Reviewed-by: Ian Romanick <[email protected]>
(Unique to 18.1)
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/nir/nir.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c index ea28fbd1af5..cfce6ab3dca 100644 --- a/src/compiler/nir/nir.c +++ b/src/compiler/nir/nir.c @@ -1374,6 +1374,20 @@ visit_tex_src(nir_tex_instr *instr, nir_foreach_src_cb cb, void *state) } static bool +visit_call_src(nir_call_instr *instr, nir_foreach_src_cb cb, void *state) +{ + if (instr->return_deref && !visit_deref_src(instr->return_deref, cb, state)) + return false; + + for (unsigned i = 0; i < instr->num_params; i++) { + if (!visit_deref_src(instr->params[i], cb, state)) + return false; + } + + return true; +} + +static bool visit_intrinsic_src(nir_intrinsic_instr *instr, nir_foreach_src_cb cb, void *state) { @@ -1449,7 +1463,8 @@ nir_foreach_src(nir_instr *instr, nir_foreach_src_cb cb, void *state) return false; break; case nir_instr_type_call: - /* Call instructions have no regular sources */ + if (!visit_call_src(nir_instr_as_call(instr), cb, state)) + return false; break; case nir_instr_type_load_const: /* Constant load instructions have no regular sources */ |