[Mesa-dev] [PATCH v2.1 6/11] nir: Add an array splitting pass

Caio Marcelo de Oliveira Filho caio.oliveira at intel.com
Tue Aug 21 00:45:48 UTC 2018


On Mon, Jul 30, 2018 at 09:16:42AM -0700, Jason Ekstrand wrote:
> This pass looks for array variables where at least one level of the
> array is never indirected and splits it into multiple smaller variables.
> 
> This pass doesn't really do much now because nir_lower_vars_to_ssa can
> already see through arrays of arrays and can detect indirects on just
> one level or even see that arr[i][0][5] does not alias arr[i][1][j].
> This pass exists to help other passes more easily see through arrays of
> arrays.  If a back-end does implement arrays using scratch or indirects
> on registers, having more smaller arrays is likely to have better memory
> efficiency.
> 
> v2 (Jason Ekstrand):
>  - Better comments and naming (some from Caio)
>  - Rework to use one hash map instead of two

The rework reads better.  Thanks.


> v2.1 (Jason Ekstrand):
>  - Fix a couple of bugs that were added in the rework including one
>    which basically prevented it from running
> ---
>  src/compiler/nir/nir.h            |   1 +
>  src/compiler/nir/nir_split_vars.c | 583 ++++++++++++++++++++++++++++++
>  2 files changed, 584 insertions(+)


This patch is

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira at intel.com>



More information about the mesa-dev mailing list