[Mesa-dev] [PATCH 1/2] radeonsi/nir: make use of nir_lower_load_const_to_scalar()

Marek Olšák maraeo at gmail.com
Wed Jul 18 17:32:17 UTC 2018


Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Mon, Jul 16, 2018 at 12:01 AM, Timothy Arceri <tarceri at itsqueeze.com> wrote:
> This allows NIR to CSE more operations. LLVM does this also so the
> impact is limited, however doing this in NIR allows other opts to
> make progress. For example some loops in Civilization Beyond Earth
> shaders are unrolled.
> ---
>  src/gallium/drivers/radeonsi/si_shader_nir.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c
> index 6eb114ad5c0..4ae5b006593 100644
> --- a/src/gallium/drivers/radeonsi/si_shader_nir.c
> +++ b/src/gallium/drivers/radeonsi/si_shader_nir.c
> @@ -802,6 +802,8 @@ si_lower_nir(struct si_shader_selector* sel)
>
>         ac_lower_indirect_derefs(sel->nir, sel->screen->info.chip_class);
>
> +       NIR_PASS_V(sel->nir, nir_lower_load_const_to_scalar);
> +
>         bool progress;
>         do {
>                 progress = false;
> --
> 2.17.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list