glsl: Use constant_expression_value instead of as_constant
glsl: Use constant_expression_value instead of as_constant

Just a few lines earlier we may have wrapped the index expression with
ir_unop_i2u expression.  Whenever that happens, as_constant will return
NULL, and that almost always happens.

Signed-off-by: Ian Romanick <2b237cafb16dc45038e85df6c85e74e6d899eba9@intel.com>
Reviewed-by: Connor Abbott <71178acffcc112b21e5858656e5751f5e4aa9364@gmail.com>

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