In some cases we use value::gvn_source field to link values that
are known to be equal before gvn pass (e.g. results of DOT4 in different
slots of the same alu group), but then source value may become dead later
and this confuses further passes.
This patch resets value::gvn_source to NULL in the dce_cleanup pass
if it points to dead value.
Fixes segfault during shader optimization with ETQW.
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
if (!v)
continue;
+ if (v->gvn_source && v->gvn_source->is_dead())
+ v->gvn_source = NULL;
+
if (v->is_dead())
v = NULL;
}