[Mesa-dev] Mesa (master): i965/fs: Remove broken optimization for live intervals in loops.

Ian Romanick idr at freedesktop.org
Fri Apr 8 17:37:32 PDT 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 04/08/2011 11:05 AM, Eric Anholt wrote:
> Module: Mesa
> Branch: master
> Commit: 963431829055f63ec94d88c97a5d07d30e49833a
> URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=963431829055f63ec94d88c97a5d07d30e49833a
> 
> Author: Eric Anholt <eric at anholt.net>
> Date:   Sat Apr  2 18:11:32 2011 -1000
> 
> i965/fs: Remove broken optimization for live intervals in loops.
> 
> The theory here was to detect a temporary variable used within a loop,
> and avoid considering it live across the entire loop.  However, it was
> overeager and failed when the first definition of the variable
> appeared within the loop but was only conditionally defined.
> 
> Fixes glsl-fs-loop-redundant-condition.

Some aspect of this change has broken glsl-fs-convolution-2 on my
Ironlake system.  I get an assertion failure:

shader_runner: brw_fs.cpp:3762: GLboolean brw_wm_fs_emit(brw_context*,
brw_wm_compile*): Assertion `!v.failed' failed.

I haven't tracked it any further than bisecting.

> ---
> 
>  src/mesa/drivers/dri/i965/brw_fs.cpp |    6 ++----
>  1 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
> index cada140..99cd8f8 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
> @@ -2812,8 +2812,7 @@ fs_visitor::calculate_live_intervals()
>  	    if (inst->src[i].file == GRF && inst->src[i].reg != 0) {
>  	       int reg = inst->src[i].reg;
>  
> -	       if (!loop_depth || (this->virtual_grf_sizes[reg] == 1 &&
> -				   def[reg] >= bb_header_ip)) {
> +	       if (!loop_depth) {
>  		  use[reg] = ip;
>  	       } else {
>  		  def[reg] = MIN2(loop_start, def[reg]);
> @@ -2829,8 +2828,7 @@ fs_visitor::calculate_live_intervals()
>  	 if (inst->dst.file == GRF && inst->dst.reg != 0) {
>  	    int reg = inst->dst.reg;
>  
> -	    if (!loop_depth || (this->virtual_grf_sizes[reg] == 1 &&
> -				!inst->predicated)) {
> +	    if (!loop_depth) {
>  	       def[reg] = MIN2(def[reg], ip);
>  	    } else {
>  	       def[reg] = MIN2(def[reg], loop_start);
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk2fqksACgkQX1gOwKyEAw8TYQCfQQbbVwch3g3fdF32Uqy6gXvM
lQUAnA8va9E9OVkdu5/Yn1G1TiJrKBTf
=qDTU
-----END PGP SIGNATURE-----


More information about the mesa-dev mailing list