mesa: better function inlining in the presence of 'return' statements
mesa: better function inlining in the presence of 'return' statements

Before, the presence of a 'return' statement always prevented inlining
a function.  This was because we didn't want to accidentally return from
the _calling_ function.  We still need the semantic of 'return' when inlining
but we can't always use unconditional branches/jumps (GPUs don't always
support arbitrary branching).

Now, we allow inlining functions w/ return if the return is the last
statement in the function.  This fixes the common case of a function
that returns a value, such as:

vec4 square(const in vec4 x)
{
   return x * x;
}

which effectively compiles into:

vec4 square(const in vec4 x)
{
   __retVal = x * x;
   return;
}

The 'return' can be no-op'd now and we can inline the function.

cherry-picked from master

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