nir/cse: use the instruction set API
authorConnor Abbott <cwabbott0@gmail.com>
Fri, 22 May 2015 04:41:45 +0000 (00:41 -0400)
committerConnor Abbott <cwabbott0@gmail.com>
Fri, 9 Oct 2015 14:14:42 +0000 (10:14 -0400)
commite8308d0523f7dc78b34099cfe2c3d3daedb27d4c
tree58a08f85e2934498ca18d120ee16a89e59752a6a
parent523a28d3fe0dd371ae01b7353f263a6541480d89
nir/cse: use the instruction set API

This replaces an O(n^2) algorithm with an O(n) one, while allowing us to
import most of the infrastructure required for GVN. The idea is to walk
the dominance tree depth-first, similar when converting to SSA, and
remove the instructions from the set when we're done visiting the
sub-tree of the dominance tree so that the only instructions in the set
are the instructions that dominate the current block.

No piglit regressions. No shader-db changes.

Compilation time for full shader-db:

Difference at 95.0% confidence
        -35.826 +/- 2.16018
        -6.2852% +/- 0.378975%
        (Student's t, pooled s = 3.37504)

v2:
- rebase on start_block removal
- remove useless state struct
- change commit message

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Signed-off-by: Connor Abbott <cwabbott0@gmail.com>
src/glsl/nir/nir_opt_cse.c