i965/fs: Compact the virtual GRF arrays.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 2 Nov 2012 05:04:50 +0000 (22:04 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Sun, 4 Nov 2012 03:28:57 +0000 (20:28 -0700)
commit05882b0d3b69ac14e9bc93460c77f9dc203c2ff9
tree040688e954a8e679722f518df5e686d87bfa76f7
parente3542ea51be7e25f249b53a421f57c1ab6816cf1
i965/fs: Compact the virtual GRF arrays.

During code generation, we create tons of temporary variables, many of
which get immediately killed and are never used.  Later optimization and
analysis passes, such as compute_live_intervals, loop over all the
virtual GRFs.  By compacting them, we can save a lot of overhead.

Reduces compilation time in L4D2's largest fragment shader from 10.2
seconds to 5.2 seconds (50%).  Drops compute_live_variables() from
10-12% of another game's startup time to 8%.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_fs.h