[Mesa-dev] [PATCH 2/6] i965/fs: Recognize nop-MOV instructions early.

Eric Anholt eric at anholt.net
Sun Apr 20 16:31:11 PDT 2014


Matt Turner <mattst88 at gmail.com> writes:

> And avoid rewriting other instructions unnecessarily. Removes a few
> self-moves we weren't able to handle because they were components of a
> large VGRF.
>
> instructions in affected programs:     830 -> 826 (-0.48%)
> ---
>  src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp | 16 +++++++++++++---
>  1 file changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp b/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp
> index f6d9b68..8b37ed0 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp
> @@ -44,6 +44,12 @@
>  #include "brw_fs_live_variables.h"
>  
>  static bool
> +is_nop_mov(const fs_inst *inst)
> +{
> +   return inst->dst.equals(inst->src[0]);
> +}

I don't think it would be a nop mov if:

inst->saturate
inst->conditional_mod != BRW_CONDITIONAL_NONE

Agreed on that this function should only return true if it's actually a
MOV.
-------------- 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/20140420/2ee437ec/attachment.sig>


More information about the mesa-dev mailing list