From: Rhys Perry Date: Tue, 12 Nov 2019 15:29:45 +0000 (+0000) Subject: nir/divergence: improve DA of shuffle X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c877f4d320b431f64634b8cda057311ea17c9a26;p=mesa.git nir/divergence: improve DA of shuffle If the data is uniform, then it's really a uniform copy. If the index is uniform, then it's really a read_invocation. Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann --- diff --git a/src/compiler/nir/nir_divergence_analysis.c b/src/compiler/nir/nir_divergence_analysis.c index 301d7a4820b..9b8f9cb6349 100644 --- a/src/compiler/nir/nir_divergence_analysis.c +++ b/src/compiler/nir/nir_divergence_analysis.c @@ -200,7 +200,6 @@ visit_intrinsic(bool *divergent, nir_intrinsic_instr *instr, case nir_intrinsic_ballot_find_lsb: case nir_intrinsic_ballot_find_msb: case nir_intrinsic_ballot_bit_count_reduce: - case nir_intrinsic_shuffle: case nir_intrinsic_shuffle_xor: case nir_intrinsic_shuffle_up: case nir_intrinsic_shuffle_down: @@ -247,6 +246,11 @@ visit_intrinsic(bool *divergent, nir_intrinsic_instr *instr, break; } + case nir_intrinsic_shuffle: + is_divergent = divergent[instr->src[0].ssa->index] && + divergent[instr->src[1].ssa->index]; + break; + /* Intrinsics which are always divergent */ case nir_intrinsic_load_color0: case nir_intrinsic_load_color1: