nir/dominance: Add a constant-time mechanism for comparing blocks
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 6 Feb 2015 20:45:43 +0000 (12:45 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 20 Feb 2015 01:06:17 +0000 (17:06 -0800)
commitf481a9425cb8d70bc61c6303268a465f5a05896b
tree5045a7422e40089ff9036b774d60b7814a12bd5b
parentb4c5489c8ac12eb2c9881ba2d8bb745203affb7b
nir/dominance: Add a constant-time mechanism for comparing blocks

This is mostly thanks to Connor.  The idea is to do a depth-first search
that computes pre and post indices for all the blocks.  We can then figure
out if one block dominates another in constant time by two simple
comparison operations.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
src/glsl/nir/nir.h
src/glsl/nir/nir_dominance.c