[Mesa-dev] [PATCH] i965/fs: Allocate single register at a time for constants.

Francisco Jerez currojerez at riseup.net
Mon Feb 1 21:55:23 UTC 2016


Matt Turner <mattst88 at gmail.com> writes:

> No instruction counts changed, but:
>
>   total cycles in shared programs: 64834502 -> 64781530 (-0.08%)
>   cycles in affected programs: 16331544 -> 16278572 (-0.32%)
>   helped: 4757
>   HURT: 4288
>
>   GAINED: 66
>   LOST:   20
>
> I remember trying this when I first wrote the pass, but it wasn't
> helpful at the time.

Seems reasonable to me,
Reviewed-by: Francisco Jerez <currojerez at riseup.net>

> ---
>  src/mesa/drivers/dri/i965/brw_fs_combine_constants.cpp | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs_combine_constants.cpp b/src/mesa/drivers/dri/i965/brw_fs_combine_constants.cpp
> index 994c699..d7a1456 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs_combine_constants.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs_combine_constants.cpp
> @@ -268,7 +268,7 @@ fs_visitor::opt_combine_constants()
>        qsort(table.imm, table.len, sizeof(struct imm), compare);
>  
>     /* Insert MOVs to load the constant values into GRFs. */
> -   fs_reg reg(VGRF, alloc.allocate(dispatch_width / 8));
> +   fs_reg reg(VGRF, alloc.allocate(1));
>     reg.stride = 0;
>     for (int i = 0; i < table.len; i++) {
>        struct imm *imm = &table.imm[i];
> @@ -284,8 +284,8 @@ fs_visitor::opt_combine_constants()
>        imm->subreg_offset = reg.subreg_offset;
>  
>        reg.subreg_offset += sizeof(float);
> -      if ((unsigned)reg.subreg_offset == dispatch_width * sizeof(float)) {
> -         reg.nr = alloc.allocate(dispatch_width / 8);
> +      if ((unsigned)reg.subreg_offset == 8 * sizeof(float)) {
> +         reg.nr = alloc.allocate(1);
>           reg.subreg_offset = 0;
>        }
>     }
> -- 
> 2.4.10
>
> _______________________________________________
> 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/20160201/1fddfe81/attachment.sig>


More information about the mesa-dev mailing list