From c81a14c7541f3c8c0a672d7f9b3d33014b0d0e1b Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sat, 27 May 2023 22:23:11 -0400 Subject: [PATCH] agx: Use nir_opt_shrink_stores This especially helps with image stores, where we otherwise insert a bunch of pointless moves to collect a vector even when we know the format only has a single channel. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/compiler/agx_compile.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/asahi/compiler/agx_compile.c b/src/asahi/compiler/agx_compile.c index 8e2c4390dd6..385188814e0 100644 --- a/src/asahi/compiler/agx_compile.c +++ b/src/asahi/compiler/agx_compile.c @@ -1927,6 +1927,9 @@ agx_optimize_loop_nir(nir_shader *nir) static void agx_optimize_nir(nir_shader *nir, unsigned *preamble_size) { + /* This runs only once up front since other optimizations don't affect it */ + NIR_PASS_V(nir, nir_opt_shrink_stores, true); + agx_optimize_loop_nir(nir); bool progress = false;