diff options
author | Rhys Perry <[email protected]> | 2019-11-12 15:29:45 +0000 |
---|---|---|
committer | Rhys Perry <[email protected]> | 2019-11-12 17:21:38 +0000 |
commit | c877f4d320b431f64634b8cda057311ea17c9a26 (patch) | |
tree | b7f6b43808f7da2d891ebc7958fa87abec019c27 /src/compiler | |
parent | f97d9334263a4dd8878c4e259fb5afcdc1334904 (diff) |
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 <[email protected]>
Reviewed-by: Daniel Schürmann <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/nir/nir_divergence_analysis.c | 6 |
1 files changed, 5 insertions, 1 deletions
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: |