glsl: Make opt_copy_propagation_elements actually propagate into loops.
authorKenneth Graunke <kenneth@whitecape.org>
Sat, 30 Apr 2016 05:06:37 +0000 (22:06 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 6 Jun 2016 21:14:31 +0000 (14:14 -0700)
commit13b859de044d0f970fcafd4bbb643a307c6ab4eb
treebbd3a3addaa4700e67b05b46bbbc90b1fa78228a
parent0756e3a25ce5e81773a54942d737ba4643e2f7dc
glsl: Make opt_copy_propagation_elements actually propagate into loops.

We've had a FINISHME here since Eric originally wrote the code in 2011.
This patch implements his suggested approach, which makes us actually
able to copy propagate into the loops, at the unfortunate cost of making
this pass even more expensive.

The shader-db statistics are basically a wash:

   No change in instruction counts.

   total cycles in shared programs: 78685980 -> 78680730 (-0.01%)
   cycles in affected programs: 2102646 -> 2097396 (-0.25%)
   helped: 48
   HURT: 83

I figured if we're going to do this for one copy propagation pass,
we may as well do it in both.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/compiler/glsl/opt_copy_propagation_elements.cpp