i965/vs: Add constant propagation to a few opcodes.
authorEric Anholt <eric@anholt.net>
Tue, 30 Aug 2011 20:25:15 +0000 (13:25 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 9 Sep 2011 04:40:39 +0000 (21:40 -0700)
commit42ce13195b94d0d51ca8e7fa5eed07fde8f37988
tree9c4d873aecee3b9a3a3cfb52427aa74d0f64bd30
parent87b51fc4a807616eaab0c4b38e41c328c08875e3
i965/vs: Add constant propagation to a few opcodes.

This differs from the FS in that we track constants in each
destination channel, and we we have to look at all the swizzled source
channels.  Also, the instruction stream walk is done in an O(n) manner
instead of O(n^2).

Across shader-db, this reduces 8.0% of the instructions from 60.0% of
the vertex shaders, leaving us now behind the old backend by 11.1%
overall.
src/mesa/drivers/dri/i965/Makefile.sources
src/mesa/drivers/dri/i965/brw_vec4.cpp
src/mesa/drivers/dri/i965/brw_vec4.h
src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp [new file with mode: 0644]
src/mesa/drivers/dri/i965/brw_vec4_emit.cpp