diff --git a/src/compiler/nir/nir_opt_sink.c b/src/compiler/nir/nir_opt_sink.c index 25ce7aaf1fb..e86ca3c0a5d 100644 --- a/src/compiler/nir/nir_opt_sink.c +++ b/src/compiler/nir/nir_opt_sink.c @@ -166,6 +166,10 @@ get_preferred_block(nir_ssa_def *def, bool sink_out_of_loops) lca = nir_dominance_lca(lca, use_block); } + /* return in case, we didn't find a reachable user */ + if (!lca) + return NULL; + /* We don't sink any instructions into loops to avoid repeated executions * This might occasionally increase register pressure, but seems overall * the better choice.