glsl: Remove unused gl_PerVertex interface blocks.
glsl: Remove unused gl_PerVertex interface blocks.

The GLSL 4.10 rules for redeclaration of built-in interface blocks
(which we've chosen to regard as clarifications of GLSL 1.50) only
require gl_PerVertex blocks to match in shaders that actually use
those blocks.  The easiest way to implement this is to detect
situations where a compiled shader doesn't refer to any elements of
gl_PerVertex, and remove all the associated ir_variables from the
shader at the end of ast-to-ir conversion.

Fixes piglit tests
linker/interstage-{pervertex,pervertex-in,pervertex-out}-redeclaration-unneeded.

Reviewed-by: Ian Romanick <2b237cafb16dc45038e85df6c85e74e6d899eba9@intel.com>
Reviewed-by: Matt Turner <789b315743a28dd066a4ba1459c35951c291d8a6@gmail.com>

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