summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_nir.c
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2016-02-24 21:40:37 -0800
committerKenneth Graunke <kenneth@whitecape.org>2016-02-26 15:55:59 -0800
commit51f87979934100af8c40cfa17f670bc38417ddc0 (patch)
treec78590a446b1bbb0d9bb394c69ccf6beda7f1793 /src/mesa/drivers/dri/i965/brw_nir.c
parentdcd4a841e9096b988ea3ca2779e7c8b1ca5e5747 (diff)
downloadexternal_mesa3d-51f87979934100af8c40cfa17f670bc38417ddc0.zip
external_mesa3d-51f87979934100af8c40cfa17f670bc38417ddc0.tar.gz
external_mesa3d-51f87979934100af8c40cfa17f670bc38417ddc0.tar.bz2
i965: Move optimizations from brw_nir_lower_io to brw_postprocess_nir.
This simplifies things. Every caller of brw_nir_lower_io() immediately calls brw_postprocess_nir(). The only real change this will have is that we get an extra brw_nir_optimize() call when compiling compute shaders, but that seems fine. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_nir.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_nir.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_nir.c b/src/mesa/drivers/dri/i965/brw_nir.c
index efa4c48..6996630 100644
--- a/src/mesa/drivers/dri/i965/brw_nir.c
+++ b/src/mesa/drivers/dri/i965/brw_nir.c
@@ -518,7 +518,7 @@ brw_nir_lower_io(nir_shader *nir,
OPT_V(brw_nir_lower_outputs, devinfo, is_scalar);
OPT_V(nir_lower_io, nir_var_all, is_scalar ? type_size_scalar : type_size_vec4);
- return nir_optimize(nir, is_scalar);
+ return nir;
}
/* Prepare the given shader for codegen
@@ -539,6 +539,8 @@ brw_postprocess_nir(nir_shader *nir,
bool progress; /* Written by OPT and OPT_V */
(void)progress;
+ nir = nir_optimize(nir, is_scalar);
+
if (devinfo->gen >= 6) {
/* Try and fuse multiply-adds */
OPT(brw_nir_opt_peephole_ffma);