From b70a7c97bb030f52e73ab93261b4ff09d517db44 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 23 Mar 2022 09:22:40 -0400 Subject: [PATCH] pan/bi: Gate late DCE/CSE on "optimize" Otherwise we can end up with unlowered ATOM.i32 on Valhall. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bifrost_compile.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index 6b98657dba1..b7f1f8ad8e7 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -4125,8 +4125,10 @@ bi_compile_variant_nir(nir_shader *nir, bi_lower_fau(ctx); /* Lowering FAU can create redundant moves. Run CSE+DCE to clean up. */ - bi_opt_cse(ctx); - bi_opt_dead_code_eliminate(ctx); + if (likely(optimize)) { + bi_opt_cse(ctx); + bi_opt_dead_code_eliminate(ctx); + } /* Analyze before register allocation to avoid false dependencies. The * skip bit is a function of only the data flow graph and is invariant