nir/cf: Fix dominance metadata in the dead control flow pass.
authorKenneth Graunke <kenneth@whitecape.org>
Sat, 19 Sep 2015 11:40:07 +0000 (04:40 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 23 Sep 2015 18:00:00 +0000 (11:00 -0700)
commitfbaa1b19d7accc5de95d6804525aad5b95abba72
tree721f69fb7c82f57c7588baa7f860f20ac17e7d4d
parent6560838703431f89c47d68822758bc76fd34c355
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 <kenneth@whitecape.org>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
src/glsl/nir/nir_control_flow.c
src/glsl/nir/nir_opt_dead_cf.c