nir/peephole_select: allow some invocation broadcast intrinsics
authorRhys Perry <pendingchaos02@gmail.com>
Tue, 13 Jun 2023 11:35:34 +0000 (12:35 +0100)
committerMarge Bot <emma+marge@anholt.net>
Tue, 27 Jun 2023 18:53:49 +0000 (18:53 +0000)
fossil-db (navi21):
Totals from 3 (0.00% of 133428) affected shaders:
Instrs: 2074 -> 2083 (+0.43%)
CodeSize: 10596 -> 10692 (+0.91%)
Latency: 75754 -> 75946 (+0.25%)
InvThroughput: 16900 -> 16975 (+0.44%)
Copies: 312 -> 309 (-0.96%)
Branches: 150 -> 132 (-12.00%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23621>

src/compiler/nir/nir_opt_peephole_select.c

index 9e64f02..b6acee4 100644 (file)
@@ -143,6 +143,14 @@ block_check_for_allowed_instrs(nir_block *block, unsigned *count,
          case nir_intrinsic_load_frag_shading_rate:
          case nir_intrinsic_is_sparse_texels_resident:
          case nir_intrinsic_sparse_residency_code_and:
+         case nir_intrinsic_read_invocation:
+         case nir_intrinsic_quad_broadcast:
+         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;
             break;