i965/fs: Allow copy propagation on ATTR file registers.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 10 Mar 2015 11:18:06 +0000 (04:18 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 6 May 2015 17:29:30 +0000 (10:29 -0700)
commit0c0ca557117edd3a57443f4f454c3a8da1d4e0b5
tree2090210c8ecceebc3dfd9a3fb6fa60194191ccfa
parent7a75b55a01d355090d186357896e3cb141b9775e
i965/fs: Allow copy propagation on ATTR file registers.

This especially helps with NIR because we currently emit MOVs at the top
of the shader to copy from various ATTR registers to a giant VGRF array
of all inputs.  (This could potentially be done better, but since
there's only ever one write to each register, it should be trivial to
copy propagate away...)

With NIR - only vertex shaders:
total instructions in shared programs: 3129373 -> 2889581 (-7.66%)
instructions in affected programs:     3119717 -> 2879925 (-7.69%)
helped:                                20833

Without NIR - only vertex shaders:
total instructions in shared programs: 2745901 -> 2724483 (-0.78%)
instructions in affected programs:     693426 -> 672008 (-3.09%)
helped:                                3516

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp