From f9e034bf263f9e2fbf6ae575bfb07065572daed8 Mon Sep 17 00:00:00 2001 From: Ludvig Lindau Date: Tue, 26 Aug 2025 11:39:22 +0000 Subject: [PATCH] panfrost: Make instrs_equal check res table/index Add resource table and index check to instruction equality function. This prevents CSE from mistakenly eliminating LEA_BUF_IMM instructions that load from different resources, but with the same buffer offset. Cc: mesa-stable Reviewed-by: Erik Faye-Lund Reviewed-by: Boris Brezillon Part-of: (cherry picked from commit 00b5275fe889ceb92173d09b771af29b1a559c7b) --- .pick_status.json | 2 +- src/panfrost/compiler/bi_opt_cse.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index f703c4f25fb..8802b293b1e 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1134,7 +1134,7 @@ "description": "panfrost: Make instrs_equal check res table/index", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/panfrost/compiler/bi_opt_cse.c b/src/panfrost/compiler/bi_opt_cse.c index 16f27cb802b..2ef5a14d11c 100644 --- a/src/panfrost/compiler/bi_opt_cse.c +++ b/src/panfrost/compiler/bi_opt_cse.c @@ -117,6 +117,12 @@ instrs_equal(const void *_i1, const void *_i2) return false; } + if (i1->table != i2->table) + return false; + + if (i1->index != i2->index) + return false; + return true; }