intel/compiler: Set divergence analysis options

Although we don't use divergence analysis yet, we've had several
work-in-progress series that make use of it.  We may as well set
our options so that those series can assume they're in place.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15484>
This commit is contained in:
Kenneth Graunke 2020-10-16 16:05:52 -07:00 committed by Marge Bot
parent 6fa66ac228
commit b3942beecf
1 changed files with 11 additions and 1 deletions

View File

@ -70,7 +70,11 @@
.avoid_ternary_with_two_constants = true, \
.has_pack_32_4x8 = true, \
.max_unroll_iterations = 32, \
.force_indirect_unrolling = nir_var_function_temp
.force_indirect_unrolling = nir_var_function_temp, \
.divergence_analysis_options = \
(nir_divergence_single_prim_per_subgroup | \
nir_divergence_single_patch_per_tcs_subgroup | \
nir_divergence_single_patch_per_tes_subgroup)
static const struct nir_shader_compiler_options scalar_nir_options = {
COMMON_OPTIONS,
@ -190,6 +194,12 @@ brw_compiler_create(void *mem_ctx, const struct intel_device_info *devinfo)
nir_options->force_indirect_unrolling |=
brw_nir_no_indirect_mask(compiler, i);
if (compiler->use_tcs_8_patch) {
/* TCS 8_PATCH mode has multiple patches per subgroup */
nir_options->divergence_analysis_options &=
~nir_divergence_single_patch_per_tcs_subgroup;
}
compiler->nir_options[i] = nir_options;
}