From 580d3e2f524f9daf675d8a54635194a8929c27f6 Mon Sep 17 00:00:00 2001 From: Ryan Zhang Date: Thu, 7 May 2026 18:19:21 +0800 Subject: [PATCH] pan/bifrost: do not CSE WMASK WMASK is used to lower subgroup ballot/ballot_relaxed operations. Unlike ordinary ALU instructions, the result of WMASK depends not only on its explicit source, but also on the implicit subgroup execution state, such as the active lane mask. Treating WMASK as a normal CSE-able instruction can collapse subgroup predicate chains incorrectly. This may remove the producer of a predicate SSA value while leaving later predicate-combine instructions still referencing it. The invalid SSA source then reaches the Valhall packer and fails with errors like: Invalid type of source 2: r2 = ICMP_AND.u32.eq.m1 r2^, r0, %23^ Fixed: dEQP-VK.subgroups.vote.graphics.subgroupallequal_ivec2 Signed-of-by: Ryan Zhang --- src/panfrost/compiler/bifrost/bi_opt_cse.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/panfrost/compiler/bifrost/bi_opt_cse.c b/src/panfrost/compiler/bifrost/bi_opt_cse.c index 23984bef4f9..aa082bf1c56 100644 --- a/src/panfrost/compiler/bifrost/bi_opt_cse.c +++ b/src/panfrost/compiler/bifrost/bi_opt_cse.c @@ -116,6 +116,7 @@ instr_can_cse(const bi_instr *I) switch (I->op) { case BI_OPCODE_DTSEL_IMM: case BI_OPCODE_DISCARD_F32: + case BI_OPCODE_WMASK: return false; default: break;