From b6d3f666abc2a249f8ebc501d32a2eda2e5360da Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Tue, 6 Aug 2024 22:06:27 +0200 Subject: [PATCH] nir/peephole_select: ignore masked/quad swizzle without fetch_inactive Without fetch_inactive, these instructions need to return 0 for inactive lanes and peephole_select changes which instructions are inactive. Reviewed-by: Rhys Perry Part-of: --- src/compiler/nir/nir_opt_peephole_select.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/compiler/nir/nir_opt_peephole_select.c b/src/compiler/nir/nir_opt_peephole_select.c index 24794598f8e..2af44f01385 100644 --- a/src/compiler/nir/nir_opt_peephole_select.c +++ b/src/compiler/nir/nir_opt_peephole_select.c @@ -144,6 +144,11 @@ block_check_for_allowed_instrs(nir_block *block, unsigned *count, return false; break; + case nir_intrinsic_masked_swizzle_amd: + case nir_intrinsic_quad_swizzle_amd: + if (!nir_intrinsic_fetch_inactive(intrin)) + return false; + FALLTHROUGH; case nir_intrinsic_load_uniform: case nir_intrinsic_load_preamble: case nir_intrinsic_load_helper_invocation: @@ -176,8 +181,6 @@ block_check_for_allowed_instrs(nir_block *block, unsigned *count, case nir_intrinsic_quad_swap_horizontal: case nir_intrinsic_quad_swap_vertical: case nir_intrinsic_quad_swap_diagonal: - case nir_intrinsic_quad_swizzle_amd: - case nir_intrinsic_masked_swizzle_amd: case nir_intrinsic_lane_permute_16_amd: if (!alu_ok) return false;