From 20c08ed3f1ae33245c139ffaaca042eb2b36d3e7 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Thu, 5 Feb 2026 21:52:09 -0500 Subject: [PATCH] pan/bi: Don't attempt to fuse AND(ICMP, ICMP) if the AND is swizzled There might be cases under which we can make this work but they're tricky at best. For now, don't even try. Cc: mesa-stable Reviewed-by: Christoph Pillmayer (cherry picked from commit 918624174bcdce49287e5b6249d455a298a66e44) Part-of: --- .pick_status.json | 2 +- src/panfrost/compiler/valhall/va_optimize.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index aff15c2a801..2d7389b3307 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -834,7 +834,7 @@ "description": "pan/bi: Don't attempt to fuse AND(ICMP, ICMP) if the AND is swizzled", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/panfrost/compiler/valhall/va_optimize.c b/src/panfrost/compiler/valhall/va_optimize.c index c55c99e352f..7dc7559d526 100644 --- a/src/panfrost/compiler/valhall/va_optimize.c +++ b/src/panfrost/compiler/valhall/va_optimize.c @@ -258,6 +258,8 @@ va_fuse_cmp(bi_context *ctx, bi_instr **lut, const BITSET_WORD *multiple, /* Ensure we really have a LSHIFT that we can remap (so without shift) */ if (!va_remap_logical_to_logical_cmp(I->op, cmp_type) || + I->src[0].swizzle != BI_SWIZZLE_H01 || + I->src[1].swizzle != BI_SWIZZLE_H01 || !bi_is_zero(I->src[2])) return false;