mesa/st: Only call nir_lower_io_to_scalar_early on scalar ISAs
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Sun, 21 Oct 2018 18:29:37 +0000 (11:29 -0700)
committerChristian Gmeiner <christian.gmeiner@gmail.com>
Mon, 22 Oct 2018 18:37:07 +0000 (20:37 +0200)
commite0c267c7521acfa7923bf13b2ac769eac6e13230
treea3a88f4817c5286f9d69691df24e943803cb29e9
parent4e785fb383eaa80e7def0d639eddefb781ec3f4f
mesa/st: Only call nir_lower_io_to_scalar_early on scalar ISAs

On scalar ISAs, nir_lower_io_to_scalar_early enables significant
optimizations. However, on vector ISAs, it is counterproductive and
impedes optimal codegen. This patch only calls
nir_lower_io_to_scalar_early for scalar ISAs. It appears that at present
there are no upstreamed drivers using Gallium, NIR, and a vector ISA, so
for existing code, this should be a no-op. However, this patch is
necessary for the upcoming Panfrost (Midgard) and Lima (Utgard)
compilers, which are vector.

With this patch, Panfrost is able to consume NIR directly, rather than
TGSI with the TGSI->NIR conversion.

For how this affects Lima, see
https://www.mail-archive.com/mesa-dev@lists.freedesktop.org/msg189216.html

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
src/mesa/state_tracker/st_glsl_to_nir.cpp