From 6ba7a162b6fb38e588784fa14426a61deca1143c Mon Sep 17 00:00:00 2001 From: Vadim Girlin Date: Tue, 30 Apr 2013 20:50:24 +0400 Subject: [PATCH] r600g/sb: don't propagate dead values in GVN pass 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 --- src/gallium/drivers/r600/sb/sb_dce_cleanup.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gallium/drivers/r600/sb/sb_dce_cleanup.cpp b/src/gallium/drivers/r600/sb/sb_dce_cleanup.cpp index acd6613166f..f879395f67c 100644 --- a/src/gallium/drivers/r600/sb/sb_dce_cleanup.cpp +++ b/src/gallium/drivers/r600/sb/sb_dce_cleanup.cpp @@ -125,6 +125,9 @@ void dce_cleanup::cleanup_dst_vec(vvec& vv) { if (!v) continue; + if (v->gvn_source && v->gvn_source->is_dead()) + v->gvn_source = NULL; + if (v->is_dead()) v = NULL; } -- 2.30.2