From e0682b4317a8b195c363002647d295867d9f2d91 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/bifrost/valhall/va_optimize.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 8069d9adbe6..c1fd1311b9e 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -924,7 +924,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/bifrost/valhall/va_optimize.c b/src/panfrost/compiler/bifrost/valhall/va_optimize.c index 2f3aaa85a25..81976380f4c 100644 --- a/src/panfrost/compiler/bifrost/valhall/va_optimize.c +++ b/src/panfrost/compiler/bifrost/valhall/va_optimize.c @@ -240,6 +240,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;