From 85db960e37098e1edae44749d33a95e0311fd8ca Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 14 Oct 2025 14:22:44 -0700 Subject: [PATCH] brw: Mark src3 of BFN as is_control_source This prevents lower_regioning from doing bad things when the destination and all the other sources are UW. Other solutions considered: - Have the type of src[3] match the destination type. This also required changes in combine_constants to allow the type be UD or UW. - Make a new subclass brw_bfn_inst, and store the Boolean function selector outside the src[] array. This was a lot more code and a lot more churn (+47,-27 vs +4). Fixes: b948e6d503d ("brw: Use BFN to implement nir_opt_bitfield_select") Suggested-by: Curro Suggested-by: Ken Closes: #14095 Reviewed-by: Alyssa Rosenzweig Part-of: --- src/intel/compiler/brw/brw_inst.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/intel/compiler/brw/brw_inst.cpp b/src/intel/compiler/brw/brw_inst.cpp index a6bf9b2083f..488e5b49afd 100644 --- a/src/intel/compiler/brw/brw_inst.cpp +++ b/src/intel/compiler/brw/brw_inst.cpp @@ -284,6 +284,10 @@ brw_inst::is_control_source(unsigned arg) const case SHADER_OPCODE_REDUCE: return arg != 0; + case BRW_OPCODE_BFN: + /* src[3] holds the Boolean function selector. */ + return arg == 3; + default: return false; }