From b5c99e6f570a040872d05b5d9e353388e201e5d2 Mon Sep 17 00:00:00 2001 From: Job Noorman Date: Tue, 7 Jan 2025 11:00:36 +0100 Subject: [PATCH] ir3/cp: swap back correct srcs when swap failed While making the swapping code generic, the swap-back path was left as is causing the wrong sources to be swapped. Signed-off-by: Job Noorman Fixes: 00656526d81 ("ir3/cp: extract common src swapping code") Part-of: --- src/freedreno/ir3/ir3_cp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/freedreno/ir3/ir3_cp.c b/src/freedreno/ir3/ir3_cp.c index a1d423f60a1..a82a749774d 100644 --- a/src/freedreno/ir3/ir3_cp.c +++ b/src/freedreno/ir3/ir3_cp.c @@ -227,7 +227,7 @@ try_swap_two_srcs(struct ir3_instruction *instr, unsigned n, unsigned new_flags, if (!valid_swap) { /* put things back the way they were: */ - swap(instr->srcs[0], instr->srcs[1]); + swap(instr->srcs[swap_n], instr->srcs[n]); } else { /* otherwise leave things swapped */ instr->cat3.swapped = true;