[Mesa-dev] [PATCH 2/3] i965/fs: Clear variable from live-set if it's completely overwritten.

Eric Anholt eric at anholt.net
Mon Apr 14 17:50:37 PDT 2014


Matt Turner <mattst88 at gmail.com> writes:

> One program affected:
>
> instructions in affected programs:     246 -> 244 (-0.81%)
> ---
>  src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp b/src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp
> index 6addbb3..1ae7606 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp
> @@ -80,6 +80,13 @@ fs_visitor::dead_code_eliminate()
>              }
>           }
>  
> +         if (inst->dst.file == GRF) {
> +            if (!inst->is_partial_write()) {
> +               int var = live_intervals->var_from_reg(&inst->dst);
> +               BITSET_CLEAR(live, var);
> +            }
> +         }

Any more effect if you:

 +               int var = live_intervals->var_from_vgrf[inst->dst.reg];
 +               for (int i = 0; i < inst->regs_written; i++)
 +                  BITSET_CLEAR(live, var + i);

instead?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140414/ac84e98a/attachment.sig>


More information about the mesa-dev mailing list