From be9e46d794f7267412a14c11c6ffb980308e3def Mon Sep 17 00:00:00 2001 From: Mary Guillemard Date: Tue, 8 Jul 2025 13:07:08 +0200 Subject: [PATCH] pan/bi: Do not allow passthrough for instructions disallowing temps Previously we were allowing passthrough to temps without using bi_reads_temps. This was causing instructions like CLPER to create undefined encodings. We now check if the instruction support temps. Fixes: 4252fb84f4f ("pan/bi: Add passthrough register rewriting helper") Signed-off-by: Mary Guillemard Reviewed-by: Eric R. Smith Part-of: (cherry picked from commit 48d716a05f34f6d6ba1331f1aab81fa33cd4b69f) --- .pick_status.json | 2 +- src/panfrost/compiler/bifrost/bi_schedule.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index aa4a9575733..6faf023672e 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -4434,7 +4434,7 @@ "description": "pan/bi: Do not allow passthrough for instructions disallowing temps", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "4252fb84f4f0ad5ec6f3d966fec308a3b42ffd7a", "notes": null diff --git a/src/panfrost/compiler/bifrost/bi_schedule.c b/src/panfrost/compiler/bifrost/bi_schedule.c index 835cd73169c..e014bfdbcf6 100644 --- a/src/panfrost/compiler/bifrost/bi_schedule.c +++ b/src/panfrost/compiler/bifrost/bi_schedule.c @@ -1366,6 +1366,10 @@ bi_use_passthrough(bi_instr *ins, bi_index old, enum bifrost_packed_src new, if ((i == 0 || i == 4) && except_sr) continue; + if ((new == BIFROST_SRC_PASS_FMA || new == BIFROST_SRC_PASS_ADD) && + !bi_reads_temps(ins, i)) + continue; + if (bi_is_word_equiv(ins->src[i], old)) { ins->src[i].type = BI_INDEX_PASS; ins->src[i].value = new;