glsl: Move all var decls to the front of the IR list in reverse order
glsl: Move all var decls to the front of the IR list in reverse order

This has the (intended!) side effect that vertex shader inputs and
fragment shader outputs will appear in the IR in the same order that
they appeared in the shader code.  This results in the locations being
assigned in the declared order.  Many (arguably buggy) applications
depend on this behavior, and it matches what nearly all other drivers
do.

Fixes the (new) piglit test attrib-assignments.

NOTE: This is a candidate for stable release branches (and requires the
previous commit to prevent a regression in OpenGL ES 2.0 conformance
test stencil_plane_operation).

Signed-off-by: Ian Romanick <2b237cafb16dc45038e85df6c85e74e6d899eba9@intel.com>
Reviewed-by: Chad Versace <a557f7f75bf28dc19ac99107f5cc7cd6b3fbdb1a@linux.intel.com>

dellis1972/glsl-optimizer,zz85/glsl-optimizer,jbarczak/glsl-optimizer,mcanthony/glsl-optimizer,benaadams/glsl-optimizer,dellis1972/glsl-optimizer,zz85/glsl-optimizer,benaadams/glsl-optimizer,bkaradzic/glsl-optimizer,zeux/glsl-optimizer,djreep81/glsl-optimizer,bkaradzic/glsl-optimizer,bkaradzic/glsl-optimizer,zeux/glsl-optimizer,benaadams/glsl-optimizer,benaadams/glsl-optimizer,tokyovigilante/glsl-optimizer,mapbox/glsl-optimizer,zz85/glsl-optimizer,djreep81/glsl-optimizer,mcanthony/glsl-optimizer,djreep81/glsl-optimizer,wolf96/glsl-optimizer,tokyovigilante/glsl-optimizer,tokyovigilante/glsl-optimizer,wolf96/glsl-optimizer,benaadams/glsl-optimizer,mapbox/glsl-optimizer,jbarczak/glsl-optimizer,zeux/glsl-optimizer,bkaradzic/glsl-optimizer,metora/MesaGLSLCompiler,zz85/glsl-optimizer,jbarczak/glsl-optimizer,tokyovigilante/glsl-optimizer,metora/MesaGLSLCompiler,benaadams/glsl-optimizer,mapbox/glsl-optimizer,zeux/glsl-optimizer,djreep81/glsl-optimizer,tokyovigilante/glsl-optimizer,mcanthony/glsl-optimizer,dellis1972/glsl-optimizer,metora/MesaGLSLCompiler,dellis1972/glsl-optimizer,mcanthony/glsl-optimizer,zz85/glsl-optimizer,zz85/glsl-optimizer,wolf96/glsl-optimizer,wolf96/glsl-optimizer,mapbox/glsl-optimizer,djreep81/glsl-optimizer,zeux/glsl-optimizer,dellis1972/glsl-optimizer,mapbox/glsl-optimizer,jbarczak/glsl-optimizer,mcanthony/glsl-optimizer,wolf96/glsl-optimizer,bkaradzic/glsl-optimizer,jbarczak/glsl-optimizer