From e44a53f5dce3af2c8e645c76d593cda9229f8ba9 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 19 Dec 2022 22:32:46 -0500 Subject: [PATCH] agx: Run DCE twice Needed to combine fsat with vectors due to nir_lower_blend changes. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/compiler/agx_compile.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/asahi/compiler/agx_compile.c b/src/asahi/compiler/agx_compile.c index 560b1ffa469..64a539e367c 100644 --- a/src/asahi/compiler/agx_compile.c +++ b/src/asahi/compiler/agx_compile.c @@ -1894,8 +1894,12 @@ agx_compile_function_nir(nir_shader *nir, nir_function_impl *impl, agx_print_shader(ctx, stdout); if (likely(!(agx_debug & AGX_DBG_NOOPT))) { + /* Dead code eliminate before instruction combining so use counts are + * right */ + agx_dce(ctx); agx_optimizer(ctx); agx_opt_cse(ctx); + /* Dead code eliminate after instruction combining to get the benefit */ agx_dce(ctx); agx_validate(ctx, "Optimization");