[Mesa-dev] [PATCH] nir: add nir_instr_type_tex support to nir_lower_phis_to_scalar()

Eric Anholt eric at anholt.net
Fri Feb 22 15:50:55 UTC 2019


Timothy Arceri <tarceri at itsqueeze.com> writes:

> shader-db results i965 (SKL):
>
> total instructions in shared programs: 13219105 -> 13024761 (-1.47%)
> instructions in affected programs: 1169457 -> 975113 (-16.62%)
> helped: 599
> HURT: 154
>
> total cycles in shared programs: 333968972 -> 324822073 (-2.74%)
> cycles in affected programs: 130032440 -> 120885541 (-7.03%)
> helped: 590
> HURT: 216
>
> total spills in shared programs: 57947 -> 29130 (-49.73%)
> spills in affected programs: 53364 -> 24547 (-54.00%)
> helped: 351
> HURT: 0
>
> total fills in shared programs: 51310 -> 25468 (-50.36%)
> fills in affected programs: 44882 -> 19040 (-57.58%)
> helped: 351
> HURT: 0
> ---
>  src/compiler/nir/nir_lower_phis_to_scalar.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/src/compiler/nir/nir_lower_phis_to_scalar.c b/src/compiler/nir/nir_lower_phis_to_scalar.c
> index 16001f73685..f6f702bca15 100644
> --- a/src/compiler/nir/nir_lower_phis_to_scalar.c
> +++ b/src/compiler/nir/nir_lower_phis_to_scalar.c
> @@ -74,6 +74,7 @@ is_phi_src_scalarizable(nir_phi_src *src,
>        /* A phi is scalarizable if we're going to lower it */
>        return should_lower_phi(nir_instr_as_phi(src_instr), state);
>  
> +   case nir_instr_type_tex:
>     case nir_instr_type_load_const:
>     case nir_instr_type_ssa_undef:
>        /* These are trivially scalarizable */

Sounds promising, but I would definitely not describe instr_type_tex as
"trivially scalarizable" -- could you explain what's going on with this
patch?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20190222/a905aa28/attachment.sig>


More information about the mesa-dev mailing list