From 6ad0cbafe80f1d79a92193b663b18e315d543066 Mon Sep 17 00:00:00 2001 From: Connor Abbott Date: Mon, 13 Feb 2023 12:58:24 +0100 Subject: [PATCH] ir3: Set branchstack earlier We were relying on it in RA to tell us whether we could give more registers to the shader mostly "for free" (because occupancy is bounded by the branchstack), but it turns out it was actually 0 so we weren't taking advantage of it. Part-of: --- src/freedreno/ir3/ir3_compiler_nir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/freedreno/ir3/ir3_compiler_nir.c b/src/freedreno/ir3/ir3_compiler_nir.c index 0da15340814..f22506989b1 100644 --- a/src/freedreno/ir3/ir3_compiler_nir.c +++ b/src/freedreno/ir3/ir3_compiler_nir.c @@ -4687,6 +4687,8 @@ ir3_compile_shader_nir(struct ir3_compiler *compiler, goto out; } + so->branchstack = ctx->max_stack; + ir = so->ir = ctx->ir; if (gl_shader_stage_is_compute(so->type)) { @@ -5055,8 +5057,6 @@ ir3_compile_shader_nir(struct ir3_compiler *compiler, ir3_instr_move_before(unlock, end); } - so->branchstack = ctx->max_stack; - so->pvtmem_size = ALIGN(so->pvtmem_size, compiler->pvtmem_per_fiber_align); /* Note that max_bary counts inputs that are not bary.f'd for FS: */