gallivm/nir: fix shuffleup tests.
authorDave Airlie <airlied@redhat.com>
Wed, 7 Jun 2023 01:25:49 +0000 (11:25 +1000)
committerMarge Bot <emma+marge@anholt.net>
Thu, 8 Jun 2023 01:40:45 +0000 (01:40 +0000)
So the shuffleup tests did a shuffle up with const 5,
we'd use invocation id (0..8) shuffle it down by 5,
get (-5..3), then call llvmshufflevector with that
which is totally illegal.

There might be a nicer way to fix this, but I can't see
it straight away, just bail on the fast path.

Fixes:
dEQP-VK.subgroups.shuffle.compute.subgroupshuffleup*

Cc: mesa-stable
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23484>

src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c
src/gallium/frontends/lavapipe/ci/lvp-fails.txt
src/virtio/ci/venus-fails.txt

index 10c74a8..a936681 100644 (file)
@@ -2318,13 +2318,7 @@ static void emit_shuffle(struct lp_build_nir_context *bld_base, LLVMValueRef src
    uint32_t index_bit_size = nir_src_bit_size(instr->src[1]);
    struct lp_build_context *int_bld = get_int_bld(bld_base, true, bit_size);
 
-   bool index_is_constant_data = LLVMIsAConstantAggregateZero(index) || LLVMIsAConstantDataSequential(index) || LLVMIsAUndefValue(index);
-
-   if (index_is_constant_data) {
-      /* freeze `src` in case inactive invocations contain poison */
-      src = LLVMBuildFreeze(builder, src, "");
-      result[0] = LLVMBuildShuffleVector(builder, src, LLVMGetUndef(LLVMTypeOf(src)), index, "");
-   } else if (util_get_cpu_caps()->has_avx2 && bit_size == 32 && index_bit_size == 32 && int_bld->type.length == 8) {
+   if (util_get_cpu_caps()->has_avx2 && bit_size == 32 && index_bit_size == 32 && int_bld->type.length == 8) {
       /* freeze `src` in case inactive invocations contain poison */
       src = LLVMBuildFreeze(builder, src, "");
       result[0] = lp_build_intrinsic_binary(builder, "llvm.x86.avx2.permd", int_bld->vec_type, src, index);
index d2a869a..5e970d8 100644 (file)
@@ -5,5 +5,3 @@ dEQP-VK.rasterization.provoking_vertex.transform_feedback.per_pipeline.triangle_
 
 # New CTS failures in 1.3.5.0
 dEQP-VK.api.info.format_properties.g10x6_b10x6r10x6_2plane_420_unorm_3pack16,Fail
-# since Debian 12 CI uprev
-dEQP-VK.subgroups.shuffle.compute.subgroupshuffleup_double_constant,Crash
index be9f5c6..133cbcc 100644 (file)
@@ -14,5 +14,3 @@ dEQP-VK.pipeline.extended_dynamic_state.between_pipelines.enable_raster,Fail
 dEQP-VK.pipeline.extended_dynamic_state.cmd_buffer_start.enable_raster,Fail
 dEQP-VK.pipeline.extended_dynamic_state.two_draws_dynamic.enable_raster,Fail
 dEQP-VK.memory_model.message_passing.ext.u64.noncoherent.atomic_atomic.atomicwrite.device.payload_local.physbuffer.guard_local.image.comp,Fail
-# since Debian 12 uprev
-dEQP-VK.subgroups.shuffle.graphics.subgroupshuffleup_i64vec4_constant,Crash