From c31fadd25e4a5551f6afdab02fe8bfeebb258e08 Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Mon, 17 Feb 2025 22:59:48 +0100 Subject: [PATCH] nir/peephole_select: don't special case nir_opt_collapse_if + limit = ~0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Not sure if this was intentionally left when block_check_for_allowed_instrs's param was changed from bool to int, but it certainly was broken without the previous commit for discards. Now those should work, so the (unintentional?) special case can be removed. Reviewed-by: Daniel Schürmann Reviewed-by: Alyssa Rosenzweig Part-of: --- src/compiler/nir/nir_opt_peephole_select.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/nir/nir_opt_peephole_select.c b/src/compiler/nir/nir_opt_peephole_select.c index 613fa112346..b92178b3372 100644 --- a/src/compiler/nir/nir_opt_peephole_select.c +++ b/src/compiler/nir/nir_opt_peephole_select.c @@ -400,7 +400,7 @@ nir_opt_collapse_if(nir_if *if_stmt, nir_shader *shader, unsigned limit, /* check if the block before the nested if matches the requirements */ nir_block *first = nir_if_first_then_block(parent_if); unsigned count = 0; - if (!block_check_for_allowed_instrs(first, &count, limit != 0, + if (!block_check_for_allowed_instrs(first, &count, limit, indirect_load_ok, expensive_alu_ok)) return false;