[Mesa-dev] [PATCH 1/9] i965/fs: Remove the RCP+RSQ peephole

Matt Turner mattst88 at gmail.com
Thu Mar 17 17:45:58 UTC 2016


On Thu, Mar 17, 2016 at 10:21 AM, Jason Ekstrand <jason at jlekstrand.net> wrote:
> NIR already has this optimization and it can do much better than the little
> peephole in the backend.
>
> No shader-db change on Broadwell.
> ---
>  src/mesa/drivers/dri/i965/brw_fs.cpp | 11 -----------
>  1 file changed, 11 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
> index 86d2bd9..ba6ae59 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
> @@ -2274,17 +2274,6 @@ fs_visitor::opt_algebraic()
>              progress = true;
>           }
>           break;
> -      case SHADER_OPCODE_RCP: {
> -         fs_inst *prev = (fs_inst *)inst->prev;
> -         if (prev->opcode == SHADER_OPCODE_SQRT) {
> -            if (inst->src[0].equals(prev->dst)) {
> -               inst->opcode = SHADER_OPCODE_RSQ;
> -               inst->src[0] = prev->src[0];
> -               progress = true;
> -            }
> -         }
> -         break;
> -      }

Do this in the vec4 backend as well, and with no shader-db regressions on HSW:

Reviewed-by: Matt Turner <mattst88 at gmail.com>


More information about the mesa-dev mailing list