[Mesa-dev] [PATCH v2 6/8] i965/fs: Drop offset_reg temporary in ssbo load

Francisco Jerez currojerez at riseup.net
Fri Oct 23 04:40:40 PDT 2015


Kristian Høgsberg Kristensen <krh at bitplanet.net> writes:

> Now that we don't read each component one-by-one, we don't need the
> temoprary vgrf for the offset. More importantly, this register was type
> UD while the nir source was type D. This broke copy propagation and left
> a redundant MOV in the generated code.
>
> Signed-off-by: Kristian Høgsberg Kristensen <krh at bitplanet.net>
> ---
>  src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
> index 00f200a..a82c616 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
> @@ -1521,13 +1521,11 @@ fs_visitor::nir_emit_intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr
>        }
>  
>        /* Get the offset to read from */
> -      fs_reg offset_reg = vgrf(glsl_type::uint_type);
> -      unsigned const_offset_bytes = 0;
> +      fs_reg offset_reg;
>        if (has_indirect) {
> -         bld.MOV(offset_reg, get_nir_src(instr->src[1]));
> +         offset_reg = get_nir_src(instr->src[1]);
>        } else {
> -         const_offset_bytes = instr->const_index[0];
> -         bld.MOV(offset_reg, fs_reg(const_offset_bytes));
> +         offset_reg = fs_reg(instr->const_index[0]);
>        }
>  
Reviewed-by: Francisco Jerez <currojerez at riseup.net>

>        /* Read the vector */
> -- 
> 2.6.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 212 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20151023/fb70309a/attachment.sig>


More information about the mesa-dev mailing list