From fbaa1b19d7accc5de95d6804525aad5b95abba72 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Sat, 19 Sep 2015 04:40:07 -0700 Subject: nir/cf: Fix dominance metadata in the dead control flow pass. The NIR control flow modification API churns the block structure, splitting blocks, stitching them back together, and so on. Preserving information about block dominance is hard (and probably not worthwhile). This patch makes nir_cf_extract() throw away all metadata, like we do when adding/removing jumps. We then make the dead control flow pass compute dominance information right before it uses it. This is necessary because earlier work by the pass may have invalidated it. Signed-off-by: Kenneth Graunke Reviewed-by: Connor Abbott Reviewed-by: Jason Ekstrand --- src/glsl/nir/nir_control_flow.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/glsl/nir/nir_control_flow.c') diff --git a/src/glsl/nir/nir_control_flow.c b/src/glsl/nir/nir_control_flow.c index 55d0689c45e..7f51c4faf49 100644 --- a/src/glsl/nir/nir_control_flow.c +++ b/src/glsl/nir/nir_control_flow.c @@ -756,6 +756,9 @@ nir_cf_extract(nir_cf_list *extracted, nir_cursor begin, nir_cursor end) extracted->impl = nir_cf_node_get_function(&block_begin->cf_node); exec_list_make_empty(&extracted->list); + /* Dominance and other block-related information is toast. */ + nir_metadata_preserve(extracted->impl, nir_metadata_none); + nir_cf_node *cf_node = &block_begin->cf_node; nir_cf_node *cf_node_end = &block_end->cf_node; while (true) { -- cgit v1.2.3