From 91236e8eb897f5c34bc776217a5859e7b373ad56 Mon Sep 17 00:00:00 2001 From: Job Noorman Date: Mon, 17 Jun 2024 11:34:25 +0200 Subject: [PATCH] ir3: fix handling of early clobbers in calc_min_limit_pressure Early clobbers should always add to the register pressure since they cannot overlap with sources. handle_instr in ir3_spill.c handles this properly but calc_min_limit_pressure did not. Fixes: 2ff5826f09d ("ir3/ra: Add IR3_REG_EARLY_CLOBBER") Signed-off-by: Job Noorman Part-of: (cherry picked from commit af6f82b954a1581e448a1af47de32fd057b81a00) --- .pick_status.json | 2 +- src/freedreno/ir3/ir3_ra.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index f5d3b62ce13..4f53e708d06 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -234,7 +234,7 @@ "description": "ir3: fix handling of early clobbers in calc_min_limit_pressure", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "2ff5826f09d39104ddc33e89ffd6c4d8d47584d3", "notes": null diff --git a/src/freedreno/ir3/ir3_ra.c b/src/freedreno/ir3/ir3_ra.c index 38cd10f9ca0..58452070edf 100644 --- a/src/freedreno/ir3/ir3_ra.c +++ b/src/freedreno/ir3/ir3_ra.c @@ -2449,7 +2449,8 @@ calc_min_limit_pressure(struct ir3_shader_variant *v, cur_pressure = (struct ir3_pressure) {0}; ra_foreach_dst (dst, instr) { - if (dst->tied && !(dst->tied->flags & IR3_REG_KILL)) + if ((dst->tied && !(dst->tied->flags & IR3_REG_KILL)) || + (dst->flags & IR3_REG_EARLY_CLOBBER)) add_pressure(&cur_pressure, dst, v->mergedregs); }