diff --git a/mlir/test/Target/SPIRV/arithmetic-ops.mlir b/mlir/test/Target/SPIRV/arithmetic-ops.mlir index b80e17f979daa..ec47035d088b7 100644 --- a/mlir/test/Target/SPIRV/arithmetic-ops.mlir +++ b/mlir/test/Target/SPIRV/arithmetic-ops.mlir @@ -1,6 +1,11 @@ // RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip %s | FileCheck %s -spirv.module Logical GLSL450 requires #spirv.vce { +// RUN: %if spirv-tools %{ rm -rf %t %} +// RUN: %if spirv-tools %{ mkdir %t %} +// RUN: %if spirv-tools %{ mlir-translate --no-implicit-module --serialize-spirv --split-input-file --spirv-save-validation-files-with-prefix=%t/module %s %} +// RUN: %if spirv-tools %{ spirv-val %t %} + +spirv.module Logical GLSL450 requires #spirv.vce { spirv.func @fmul(%arg0 : f32, %arg1 : f32) "None" { // CHECK: {{%.*}}= spirv.FMul {{%.*}}, {{%.*}} : f32 %0 = spirv.FMul %arg0, %arg1 : f32 diff --git a/mlir/test/Target/SPIRV/array-two-step-roundtrip.mlir b/mlir/test/Target/SPIRV/array-two-step-roundtrip.mlir index 1a3bc88633d0d..203b8589c9ad5 100644 --- a/mlir/test/Target/SPIRV/array-two-step-roundtrip.mlir +++ b/mlir/test/Target/SPIRV/array-two-step-roundtrip.mlir @@ -1,6 +1,11 @@ // RUN: mlir-translate -no-implicit-module -split-input-file -serialize-spirv -deserialize-spirv %s | FileCheck %s -spirv.module Logical GLSL450 requires #spirv.vce { +// RUN: %if spirv-tools %{ rm -rf %t %} +// RUN: %if spirv-tools %{ mkdir %t %} +// RUN: %if spirv-tools %{ mlir-translate --no-implicit-module --serialize-spirv --split-input-file --spirv-save-validation-files-with-prefix=%t/module %s %} +// RUN: %if spirv-tools %{ spirv-val %t %} + +spirv.module Logical GLSL450 requires #spirv.vce { spirv.func @array_stride(%arg0 : !spirv.ptr, stride=128>, StorageBuffer>, %arg1 : i32, %arg2 : i32) "None" { // CHECK: {{%.*}} = spirv.AccessChain {{%.*}}[{{%.*}}, {{%.*}}] : !spirv.ptr, stride=128>, StorageBuffer>, i32, i32 %2 = spirv.AccessChain %arg0[%arg1, %arg2] : !spirv.ptr, stride=128>, StorageBuffer>, i32, i32 -> !spirv.ptr @@ -10,7 +15,7 @@ spirv.module Logical GLSL450 requires #spirv.vce { // ----- -spirv.module Logical GLSL450 requires #spirv.vce { +spirv.module Logical GLSL450 requires #spirv.vce { // CHECK: spirv.GlobalVariable {{@.*}} : !spirv.ptr, StorageBuffer> spirv.GlobalVariable @var0 : !spirv.ptr, StorageBuffer> // CHECK: spirv.GlobalVariable {{@.*}} : !spirv.ptr>, Input> diff --git a/mlir/test/Target/SPIRV/array.mlir b/mlir/test/Target/SPIRV/array.mlir index 56908e687a914..095f744379e01 100644 --- a/mlir/test/Target/SPIRV/array.mlir +++ b/mlir/test/Target/SPIRV/array.mlir @@ -1,6 +1,11 @@ // RUN: mlir-translate -no-implicit-module -split-input-file -test-spirv-roundtrip %s | FileCheck %s -spirv.module Logical GLSL450 requires #spirv.vce { +// RUN: %if spirv-tools %{ rm -rf %t %} +// RUN: %if spirv-tools %{ mkdir %t %} +// RUN: %if spirv-tools %{ mlir-translate --no-implicit-module --serialize-spirv --split-input-file --spirv-save-validation-files-with-prefix=%t/module %s %} +// RUN: %if spirv-tools %{ spirv-val %t %} + +spirv.module Logical GLSL450 requires #spirv.vce { spirv.func @array_stride(%arg0 : !spirv.ptr, stride=128>, StorageBuffer>, %arg1 : i32, %arg2 : i32) "None" { // CHECK: {{%.*}} = spirv.AccessChain {{%.*}}[{{%.*}}, {{%.*}}] : !spirv.ptr, stride=128>, StorageBuffer>, i32, i32 %2 = spirv.AccessChain %arg0[%arg1, %arg2] : !spirv.ptr, stride=128>, StorageBuffer>, i32, i32 -> !spirv.ptr @@ -10,7 +15,7 @@ spirv.module Logical GLSL450 requires #spirv.vce { // ----- -spirv.module Logical GLSL450 requires #spirv.vce { +spirv.module Logical GLSL450 requires #spirv.vce { // CHECK: spirv.GlobalVariable {{@.*}} : !spirv.ptr, StorageBuffer> spirv.GlobalVariable @var0 : !spirv.ptr, StorageBuffer> // CHECK: spirv.GlobalVariable {{@.*}} : !spirv.ptr>, Input> diff --git a/mlir/test/Target/SPIRV/atomic-ops.mlir b/mlir/test/Target/SPIRV/atomic-ops.mlir index cb7d9626e6c62..3e4908123a345 100644 --- a/mlir/test/Target/SPIRV/atomic-ops.mlir +++ b/mlir/test/Target/SPIRV/atomic-ops.mlir @@ -1,6 +1,11 @@ // RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip -split-input-file %s | FileCheck %s -spirv.module Logical GLSL450 requires #spirv.vce { +// RUN: %if spirv-tools %{ rm -rf %t %} +// RUN: %if spirv-tools %{ mkdir %t %} +// RUN: %if spirv-tools %{ mlir-translate --no-implicit-module --serialize-spirv --split-input-file --spirv-save-validation-files-with-prefix=%t/module %s %} +// RUN: %if spirv-tools %{ spirv-val %t %} + +spirv.module Physical64 OpenCL requires #spirv.vce { // CHECK-LABEL: @test_int_atomics spirv.func @test_int_atomics(%ptr: !spirv.ptr, %value: i32, %comparator: i32) -> i32 "None" { // CHECK: spirv.AtomicCompareExchangeWeak %{{.*}}, %{{.*}}, %{{.*}} : !spirv.ptr diff --git a/mlir/test/Target/SPIRV/barrier-ops.mlir b/mlir/test/Target/SPIRV/barrier-ops.mlir index 56b0661c6105b..a229fccebac8a 100644 --- a/mlir/test/Target/SPIRV/barrier-ops.mlir +++ b/mlir/test/Target/SPIRV/barrier-ops.mlir @@ -1,6 +1,11 @@ // RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip %s | FileCheck %s -spirv.module Logical GLSL450 requires #spirv.vce { +// RUN: %if spirv-tools %{ rm -rf %t %} +// RUN: %if spirv-tools %{ mkdir %t %} +// RUN: %if spirv-tools %{ mlir-translate --no-implicit-module --serialize-spirv --split-input-file --spirv-save-validation-files-with-prefix=%t/module %s %} +// RUN: %if spirv-tools %{ spirv-val %t %} + +spirv.module Logical GLSL450 requires #spirv.vce { spirv.func @memory_barrier_0() -> () "None" { // CHECK: spirv.MemoryBarrier , spirv.MemoryBarrier , diff --git a/mlir/test/Target/SPIRV/bit-ops.mlir b/mlir/test/Target/SPIRV/bit-ops.mlir index 61e863eb9f1c4..3be4091580798 100644 --- a/mlir/test/Target/SPIRV/bit-ops.mlir +++ b/mlir/test/Target/SPIRV/bit-ops.mlir @@ -1,6 +1,11 @@ // RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip -split-input-file %s | FileCheck %s -spirv.module Logical GLSL450 requires #spirv.vce { +// RUN: %if spirv-tools %{ rm -rf %t %} +// RUN: %if spirv-tools %{ mkdir %t %} +// RUN: %if spirv-tools %{ mlir-translate --no-implicit-module --serialize-spirv --split-input-file --spirv-save-validation-files-with-prefix=%t/module %s %} +// RUN: %if spirv-tools %{ spirv-val %t %} + +spirv.module Logical GLSL450 requires #spirv.vce { spirv.func @bitcount(%arg: i32) -> i32 "None" { // CHECK: spirv.BitCount {{%.*}} : i32 %0 = spirv.BitCount %arg : i32 diff --git a/mlir/test/Target/SPIRV/cast-ops.mlir b/mlir/test/Target/SPIRV/cast-ops.mlir index 04a468b39b645..4f29610f928c4 100644 --- a/mlir/test/Target/SPIRV/cast-ops.mlir +++ b/mlir/test/Target/SPIRV/cast-ops.mlir @@ -1,6 +1,11 @@ // RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip -split-input-file %s | FileCheck %s -spirv.module Logical GLSL450 requires #spirv.vce { +// RUN: %if spirv-tools %{ rm -rf %t %} +// RUN: %if spirv-tools %{ mkdir %t %} +// RUN: %if spirv-tools %{ mlir-translate --no-implicit-module --serialize-spirv --split-input-file --spirv-save-validation-files-with-prefix=%t/module %s %} +// RUN: %if spirv-tools %{ spirv-val %t %} + +spirv.module Logical GLSL450 requires #spirv.vce { spirv.func @bit_cast(%arg0 : f32) "None" { // CHECK: {{%.*}} = spirv.Bitcast {{%.*}} : f32 to i32 %0 = spirv.Bitcast %arg0 : f32 to i32 @@ -14,7 +19,7 @@ spirv.module Logical GLSL450 requires #spirv.vce { // ----- -spirv.module Logical GLSL450 requires #spirv.vce { +spirv.module Logical GLSL450 requires #spirv.vce { spirv.func @convert_f_to_s(%arg0 : f32) -> i32 "None" { // CHECK: {{%.*}} = spirv.ConvertFToS {{%.*}} : f32 to i32 %0 = spirv.ConvertFToS %arg0 : f32 to i32 @@ -104,7 +109,7 @@ spirv.module Logical GLSL450 requires #spirv.vce { // ----- -spirv.module Logical GLSL450 requires #spirv.vce { +spirv.module Physical64 OpenCL requires #spirv.vce { spirv.func @ptr_cast_to_generic(%arg0 : !spirv.ptr) "None" { // CHECK: {{%.*}} = spirv.PtrCastToGeneric {{%.*}} : !spirv.ptr to !spirv.ptr %0 = spirv.PtrCastToGeneric %arg0 : !spirv.ptr to !spirv.ptr @@ -124,7 +129,7 @@ spirv.module Logical GLSL450 requires #spirv.vce { // ----- -spirv.module Physical64 OpenCL requires #spirv.vce { +spirv.module Physical64 OpenCL requires #spirv.vce { spirv.func @covert_ptr_to_u(%arg0 : !spirv.ptr) "None" { // CHECK: {{%.*}} = spirv.ConvertPtrToU {{%.*}} : !spirv.ptr to i32 %0 = spirv.ConvertPtrToU %arg0 : !spirv.ptr to i32 @@ -144,7 +149,7 @@ spirv.module Physical64 OpenCL requires #spirv.vce { +spirv.module PhysicalStorageBuffer64 OpenCL requires #spirv.vce { spirv.func @covert_ptr_to_u_PhysicalStorageBuffer(%arg0 : !spirv.ptr { spirv.decoration = #spirv.decoration} ) "None" { // CHECK: {{%.*}} = spirv.ConvertPtrToU {{%.*}} : !spirv.ptr to i32 %0 = spirv.ConvertPtrToU %arg0 : !spirv.ptr to i32 @@ -154,7 +159,7 @@ spirv.module PhysicalStorageBuffer64 OpenCL requires #spirv.vce { +spirv.module Physical64 OpenCL requires #spirv.vce { spirv.func @covert_u_to_ptr(%arg0 : i32) "None" { // CHECK: {{%.*}} = spirv.ConvertUToPtr {{%.*}} : i32 to !spirv.ptr %0 = spirv.ConvertUToPtr %arg0 : i32 to !spirv.ptr @@ -174,7 +179,7 @@ spirv.module Physical64 OpenCL requires #spirv.vce { +spirv.module PhysicalStorageBuffer64 OpenCL requires #spirv.vce { spirv.func @covert_u_to_ptr_PhysicalStorageBuffer(%arg0 : i32) "None" { // CHECK: {{%.*}} = spirv.ConvertUToPtr {{%.*}} : i32 to !spirv.ptr %0 = spirv.ConvertUToPtr %arg0 : i32 to !spirv.ptr diff --git a/mlir/test/Target/SPIRV/composite-op.mlir b/mlir/test/Target/SPIRV/composite-op.mlir index 5f302fd0d38f8..014cca42a1b8f 100644 --- a/mlir/test/Target/SPIRV/composite-op.mlir +++ b/mlir/test/Target/SPIRV/composite-op.mlir @@ -1,6 +1,11 @@ // RUN: mlir-translate -no-implicit-module -split-input-file -test-spirv-roundtrip %s | FileCheck %s -spirv.module Logical GLSL450 requires #spirv.vce { +// RUN: %if spirv-tools %{ rm -rf %t %} +// RUN: %if spirv-tools %{ mkdir %t %} +// RUN: %if spirv-tools %{ mlir-translate --no-implicit-module --serialize-spirv --split-input-file --spirv-save-validation-files-with-prefix=%t/module %s %} +// RUN: %if spirv-tools %{ spirv-val %t %} + +spirv.module Logical GLSL450 requires #spirv.vce { spirv.func @composite_insert(%arg0 : !spirv.struct<(f32, !spirv.struct<(!spirv.array<4xf32>, f32)>)>, %arg1: !spirv.array<4xf32>) -> !spirv.struct<(f32, !spirv.struct<(!spirv.array<4xf32>, f32)>)> "None" { // CHECK: spirv.CompositeInsert {{%.*}}, {{%.*}}[1 : i32, 0 : i32] : !spirv.array<4 x f32> into !spirv.struct<(f32, !spirv.struct<(!spirv.array<4 x f32>, f32)>)> %0 = spirv.CompositeInsert %arg1, %arg0[1 : i32, 0 : i32] : !spirv.array<4xf32> into !spirv.struct<(f32, !spirv.struct<(!spirv.array<4xf32>, f32)>)> diff --git a/mlir/test/Target/SPIRV/gl-ops.mlir b/mlir/test/Target/SPIRV/gl-ops.mlir index 832f7ea2fe314..3c661f88e90d2 100644 --- a/mlir/test/Target/SPIRV/gl-ops.mlir +++ b/mlir/test/Target/SPIRV/gl-ops.mlir @@ -1,6 +1,11 @@ // RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip %s | FileCheck %s -spirv.module Logical GLSL450 requires #spirv.vce { +// RUN: %if spirv-tools %{ rm -rf %t %} +// RUN: %if spirv-tools %{ mkdir %t %} +// RUN: %if spirv-tools %{ mlir-translate --no-implicit-module --serialize-spirv --split-input-file --spirv-save-validation-files-with-prefix=%t/module %s %} +// RUN: %if spirv-tools %{ spirv-val %t %} + +spirv.module Logical GLSL450 requires #spirv.vce { spirv.func @math(%arg0 : f32, %arg1 : f32, %arg2 : i32) "None" { // CHECK: {{%.*}} = spirv.GL.Exp {{%.*}} : f32 %0 = spirv.GL.Exp %arg0 : f32 diff --git a/mlir/test/Target/SPIRV/group-ops.mlir b/mlir/test/Target/SPIRV/group-ops.mlir index 2ba7f23258e7f..cf519cba961c5 100644 --- a/mlir/test/Target/SPIRV/group-ops.mlir +++ b/mlir/test/Target/SPIRV/group-ops.mlir @@ -1,6 +1,11 @@ // RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip -split-input-file %s | FileCheck %s -spirv.module Logical GLSL450 requires #spirv.vce { +// RUN: %if spirv-tools %{ rm -rf %t %} +// RUN: %if spirv-tools %{ mkdir %t %} +// RUN: %if spirv-tools %{ mlir-translate --no-implicit-module --serialize-spirv --split-input-file --spirv-save-validation-files-with-prefix=%t/module %s %} +// RUN: %if spirv-tools %{ spirv-val %t %} + +spirv.module Logical GLSL450 requires #spirv.vce { // CHECK-LABEL: @subgroup_ballot spirv.func @subgroup_ballot(%predicate: i1) -> vector<4xi32> "None" { // CHECK: %{{.*}} = spirv.KHR.SubgroupBallot %{{.*}}: vector<4xi32> diff --git a/mlir/test/Target/SPIRV/image-ops.mlir b/mlir/test/Target/SPIRV/image-ops.mlir index c171265e1623f..3593d9b0e9b38 100644 --- a/mlir/test/Target/SPIRV/image-ops.mlir +++ b/mlir/test/Target/SPIRV/image-ops.mlir @@ -1,5 +1,10 @@ // RUN: mlir-translate --no-implicit-module --split-input-file --test-spirv-roundtrip %s | FileCheck %s +// RUN: %if spirv-tools %{ rm -rf %t %} +// RUN: %if spirv-tools %{ mkdir %t %} +// RUN: %if spirv-tools %{ mlir-translate --no-implicit-module --serialize-spirv --split-input-file --spirv-save-validation-files-with-prefix=%t/module %s %} +// RUN: %if spirv-tools %{ spirv-val %t %} + spirv.module Logical GLSL450 requires #spirv.vce { spirv.func @image(%arg0 : !spirv.sampled_image>, %arg1 : vector<4xf32>, %arg2 : f32) "None" { // CHECK: {{%.*}} = spirv.Image {{%.*}} : !spirv.sampled_image> diff --git a/mlir/test/Target/SPIRV/image.mlir b/mlir/test/Target/SPIRV/image.mlir index 72482292debad..a0c245c6d55dc 100644 --- a/mlir/test/Target/SPIRV/image.mlir +++ b/mlir/test/Target/SPIRV/image.mlir @@ -1,6 +1,11 @@ // RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip %s | FileCheck %s -spirv.module Logical GLSL450 requires #spirv.vce { +// RUN: %if spirv-tools %{ rm -rf %t %} +// RUN: %if spirv-tools %{ mkdir %t %} +// RUN: %if spirv-tools %{ mlir-translate --no-implicit-module --serialize-spirv --split-input-file --spirv-save-validation-files-with-prefix=%t/module %s %} +// RUN: %if spirv-tools %{ spirv-val %t %} + +spirv.module Logical GLSL450 requires #spirv.vce { // CHECK: !spirv.ptr, UniformConstant> spirv.GlobalVariable @var0 bind(0, 1) : !spirv.ptr, UniformConstant> diff --git a/mlir/test/Target/SPIRV/intel-ext-ops.mlir b/mlir/test/Target/SPIRV/intel-ext-ops.mlir index 53cf8bf8fbd62..118bed8be7095 100644 --- a/mlir/test/Target/SPIRV/intel-ext-ops.mlir +++ b/mlir/test/Target/SPIRV/intel-ext-ops.mlir @@ -1,6 +1,11 @@ // RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip -split-input-file %s | FileCheck %s -spirv.module Logical GLSL450 requires #spirv.vce { +// RUN: %if spirv-tools %{ rm -rf %t %} +// RUN: %if spirv-tools %{ mkdir %t %} +// RUN: %if spirv-tools %{ mlir-translate --no-implicit-module --serialize-spirv --split-input-file --spirv-save-validation-files-with-prefix=%t/module %s %} +// RUN: %if spirv-tools %{ spirv-val %t %} + +spirv.module Logical GLSL450 requires #spirv.vce { // CHECK-LABEL: @f32_to_bf16 spirv.func @f32_to_bf16(%arg0 : f32) "None" { // CHECK: {{%.*}} = spirv.INTEL.ConvertFToBF16 {{%.*}} : f32 to i16 @@ -36,7 +41,7 @@ spirv.module Logical GLSL450 requires #spirv.vce { +spirv.module Logical GLSL450 requires #spirv.vce { // CHECK-LABEL: @f32_to_tf32 spirv.func @f32_to_tf32(%arg0 : f32) "None" { // CHECK: {{%.*}} = spirv.INTEL.RoundFToTF32 {{%.*}} : f32 to f32 @@ -58,8 +63,8 @@ spirv.module Logical GLSL450 requires #spirv.vce -spirv.module Logical GLSL450 requires #spirv.vce { +// CHECK: spirv.module Logical GLSL450 requires #spirv.vce +spirv.module Logical GLSL450 requires #spirv.vce { // CHECK-LABEL: @split_barrier spirv.func @split_barrier() "None" { // CHECK: spirv.INTEL.ControlBarrierArrive diff --git a/mlir/test/Target/SPIRV/khr-cooperative-matrix-ops.mlir b/mlir/test/Target/SPIRV/khr-cooperative-matrix-ops.mlir index 77949908e8883..26fa075df3852 100644 --- a/mlir/test/Target/SPIRV/khr-cooperative-matrix-ops.mlir +++ b/mlir/test/Target/SPIRV/khr-cooperative-matrix-ops.mlir @@ -1,8 +1,13 @@ // RUN: mlir-translate --no-implicit-module --test-spirv-roundtrip \ // RUN: --split-input-file %s | FileCheck %s -spirv.module Logical GLSL450 requires - #spirv.vce { // CHECK-LABEL: @cooperative_matrix_length diff --git a/mlir/test/Target/SPIRV/matrix.mlir b/mlir/test/Target/SPIRV/matrix.mlir index 452f8fc16f258..8a0f7f11685a3 100644 --- a/mlir/test/Target/SPIRV/matrix.mlir +++ b/mlir/test/Target/SPIRV/matrix.mlir @@ -1,6 +1,11 @@ // RUN: mlir-translate -no-implicit-module -split-input-file -test-spirv-roundtrip %s | FileCheck %s -spirv.module Logical GLSL450 requires #spirv.vce { +// RUN: %if spirv-tools %{ rm -rf %t %} +// RUN: %if spirv-tools %{ mkdir %t %} +// RUN: %if spirv-tools %{ mlir-translate --no-implicit-module --serialize-spirv --split-input-file --spirv-save-validation-files-with-prefix=%t/module %s %} +// RUN: %if spirv-tools %{ spirv-val %t %} + +spirv.module Physical64 Vulkan requires #spirv.vce { // CHECK-LABEL: @matrix_access_chain spirv.func @matrix_access_chain(%arg0 : !spirv.ptr>, Function>, %arg1 : i32) -> !spirv.ptr, Function> "None" { // CHECK: {{%.*}} = spirv.AccessChain {{%.*}}[{{%.*}}] : !spirv.ptr>, Function> @@ -67,7 +72,7 @@ spirv.module Logical GLSL450 requires #spirv.vce { // ----- -spirv.module Logical GLSL450 requires #spirv.vce { +spirv.module Logical GLSL450 requires #spirv.vce { // CHECK: spirv.GlobalVariable {{@.*}} : !spirv.ptr>, StorageBuffer> spirv.GlobalVariable @var0 : !spirv.ptr>, StorageBuffer> diff --git a/mlir/test/Target/SPIRV/memory-ops.mlir b/mlir/test/Target/SPIRV/memory-ops.mlir index 786d07a218c66..2d18394818611 100644 --- a/mlir/test/Target/SPIRV/memory-ops.mlir +++ b/mlir/test/Target/SPIRV/memory-ops.mlir @@ -1,7 +1,11 @@ // RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip -split-input-file %s | FileCheck %s +// RUN: %if spirv-tools %{ rm -rf %t %} +// RUN: %if spirv-tools %{ mkdir %t %} +// RUN: %if spirv-tools %{ mlir-translate --no-implicit-module --serialize-spirv --split-input-file --spirv-save-validation-files-with-prefix=%t/module %s %} +// RUN: %if spirv-tools %{ spirv-val %t %} -spirv.module Logical GLSL450 requires #spirv.vce { +spirv.module Logical GLSL450 requires #spirv.vce { // CHECK-LABEL: spirv.func @load_store // CHECK-SAME: ([[ARG1:%.*]]: !spirv.ptr, [[ARG2:%.*]]: !spirv.ptr) spirv.func @load_store(%arg0 : !spirv.ptr, %arg1 : !spirv.ptr) "None" { @@ -24,7 +28,7 @@ spirv.module Logical GLSL450 requires #spirv.vce { // ----- -spirv.module Logical GLSL450 requires #spirv.vce { +spirv.module Logical GLSL450 requires #spirv.vce { spirv.func @access_chain(%arg0 : !spirv.ptr>, Function>, %arg1 : i32, %arg2 : i32) "None" { // CHECK: {{%.*}} = spirv.AccessChain {{%.*}}[{{%.*}}] : !spirv.ptr>, Function> // CHECK-NEXT: {{%.*}} = spirv.AccessChain {{%.*}}[{{%.*}}, {{%.*}}] : !spirv.ptr>, Function> @@ -36,7 +40,7 @@ spirv.module Logical GLSL450 requires #spirv.vce { // ----- -spirv.module Logical GLSL450 requires #spirv.vce { +spirv.module Logical GLSL450 requires #spirv.vce { spirv.func @load_store_zero_rank_float(%arg0: !spirv.ptr [0]), Block>, StorageBuffer>, %arg1: !spirv.ptr [0]), Block>, StorageBuffer>) "None" { // CHECK: [[LOAD_PTR:%.*]] = spirv.AccessChain {{%.*}}[{{%.*}}, {{%.*}}] : !spirv.ptr [0]), Block>, StorageBuffer> // CHECK-NEXT: [[VAL:%.*]] = spirv.Load "StorageBuffer" [[LOAD_PTR]] : f32 @@ -70,7 +74,7 @@ spirv.module Logical GLSL450 requires #spirv.vce { // ----- -spirv.module Logical GLSL450 requires #spirv.vce { +spirv.module Logical GLSL450 requires #spirv.vce { spirv.func @copy_memory_simple() "None" { %0 = spirv.Variable : !spirv.ptr %1 = spirv.Variable : !spirv.ptr @@ -82,7 +86,7 @@ spirv.module Logical GLSL450 requires #spirv.vce { // ----- -spirv.module Logical GLSL450 requires #spirv.vce { +spirv.module Logical GLSL450 requires #spirv.vce { spirv.func @copy_memory_different_storage_classes(%in : !spirv.ptr, Input>, %out : !spirv.ptr, Output>) "None" { // CHECK: spirv.CopyMemory "Output" %{{.*}}, "Input" %{{.*}} : !spirv.array<4 x f32> spirv.CopyMemory "Output" %out, "Input" %in : !spirv.array<4xf32> @@ -93,7 +97,7 @@ spirv.module Logical GLSL450 requires #spirv.vce { // ----- -spirv.module Logical GLSL450 requires #spirv.vce { +spirv.module Logical GLSL450 requires #spirv.vce { spirv.func @copy_memory_with_access_operands() "None" { %0 = spirv.Variable : !spirv.ptr %1 = spirv.Variable : !spirv.ptr diff --git a/mlir/test/Target/SPIRV/mesh-ops.mlir b/mlir/test/Target/SPIRV/mesh-ops.mlir index 3b937072de04e..e282f8916d4da 100644 --- a/mlir/test/Target/SPIRV/mesh-ops.mlir +++ b/mlir/test/Target/SPIRV/mesh-ops.mlir @@ -1,5 +1,10 @@ // RUN: mlir-translate --no-implicit-module --split-input-file --test-spirv-roundtrip %s | FileCheck %s +// RUN: %if spirv-tools %{ rm -rf %t %} +// RUN: %if spirv-tools %{ mkdir %t %} +// RUN: %if spirv-tools %{ mlir-translate --no-implicit-module --serialize-spirv --split-input-file --spirv-save-validation-files-with-prefix=%t/module %s %} +// RUN: %if spirv-tools %{ spirv-val %t %} + spirv.module Logical GLSL450 requires #spirv.vce { // CHECK-LABEL: @emit_mesh_tasks spirv.func @emit_mesh_tasks() "None" { diff --git a/mlir/test/Target/SPIRV/non-uniform-ops.mlir b/mlir/test/Target/SPIRV/non-uniform-ops.mlir index f29ebd86a2e03..e7cf0a8905a81 100644 --- a/mlir/test/Target/SPIRV/non-uniform-ops.mlir +++ b/mlir/test/Target/SPIRV/non-uniform-ops.mlir @@ -1,6 +1,11 @@ // RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip -split-input-file %s | FileCheck %s -spirv.module Logical GLSL450 requires #spirv.vce { +// RUN: %if spirv-tools %{ rm -rf %t %} +// RUN: %if spirv-tools %{ mkdir %t %} +// RUN: %if spirv-tools %{ mlir-translate --no-implicit-module --serialize-spirv --split-input-file --spirv-save-validation-files-with-prefix=%t/module %s %} +// RUN: %if spirv-tools %{ spirv-val %t %} + +spirv.module Logical GLSL450 requires #spirv.vce { // CHECK-LABEL: @group_non_uniform_ballot spirv.func @group_non_uniform_ballot(%predicate: i1) -> vector<4xi32> "None" { // CHECK: %{{.*}} = spirv.GroupNonUniformBallot %{{.*}}: vector<4xi32> diff --git a/mlir/test/Target/SPIRV/ocl-ops.mlir b/mlir/test/Target/SPIRV/ocl-ops.mlir index 9a2e4cf62e370..17accd93e8249 100644 --- a/mlir/test/Target/SPIRV/ocl-ops.mlir +++ b/mlir/test/Target/SPIRV/ocl-ops.mlir @@ -1,6 +1,11 @@ // RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip %s | FileCheck %s -spirv.module Physical64 OpenCL requires #spirv.vce { +// RUN: %if spirv-tools %{ rm -rf %t %} +// RUN: %if spirv-tools %{ mkdir %t %} +// RUN: %if spirv-tools %{ mlir-translate --no-implicit-module --serialize-spirv --split-input-file --spirv-save-validation-files-with-prefix=%t/module %s %} +// RUN: %if spirv-tools %{ spirv-val %t %} + +spirv.module Physical64 OpenCL requires #spirv.vce { spirv.func @float_insts(%arg0 : f32) "None" { // CHECK: {{%.*}} = spirv.CL.exp {{%.*}} : f32 %0 = spirv.CL.exp %arg0 : f32 diff --git a/mlir/test/Target/SPIRV/physical-storage-buffer.mlir b/mlir/test/Target/SPIRV/physical-storage-buffer.mlir index 7cbd3f94e55ff..2e724e837d909 100644 --- a/mlir/test/Target/SPIRV/physical-storage-buffer.mlir +++ b/mlir/test/Target/SPIRV/physical-storage-buffer.mlir @@ -1,5 +1,10 @@ // RUN: mlir-translate --no-implicit-module --test-spirv-roundtrip %s | FileCheck %s +// RUN: %if spirv-tools %{ rm -rf %t %} +// RUN: %if spirv-tools %{ mkdir %t %} +// RUN: %if spirv-tools %{ mlir-translate --no-implicit-module --serialize-spirv --split-input-file --spirv-save-validation-files-with-prefix=%t/module %s %} +// RUN: %if spirv-tools %{ spirv-val %t %} + // Test file showing how the Physical Storage Buffer extension works end-2-end. !f32_binding = !spirv.struct [0])> diff --git a/mlir/test/Target/SPIRV/primitive-ops.mlir b/mlir/test/Target/SPIRV/primitive-ops.mlir index 63a0b1e74784a..112acf4d7e4ac 100644 --- a/mlir/test/Target/SPIRV/primitive-ops.mlir +++ b/mlir/test/Target/SPIRV/primitive-ops.mlir @@ -1,5 +1,10 @@ // RUN: mlir-translate --no-implicit-module --test-spirv-roundtrip %s | FileCheck %s +// RUN: %if spirv-tools %{ rm -rf %t %} +// RUN: %if spirv-tools %{ mkdir %t %} +// RUN: %if spirv-tools %{ mlir-translate --no-implicit-module --serialize-spirv --split-input-file --spirv-save-validation-files-with-prefix=%t/module %s %} +// RUN: %if spirv-tools %{ spirv-val %t %} + spirv.module Logical GLSL450 requires #spirv.vce { spirv.GlobalVariable @out : !spirv.ptr, f32, !spirv.array<1 x f32>)>, Output> spirv.func @primitive_ops() "None" { diff --git a/mlir/test/Target/SPIRV/spec-constant.mlir b/mlir/test/Target/SPIRV/spec-constant.mlir index f434956ab34a3..d476c247b2873 100644 --- a/mlir/test/Target/SPIRV/spec-constant.mlir +++ b/mlir/test/Target/SPIRV/spec-constant.mlir @@ -1,6 +1,11 @@ // RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip -split-input-file %s | FileCheck %s -spirv.module Logical GLSL450 requires #spirv.vce { +// RUN: %if spirv-tools %{ rm -rf %t %} +// RUN: %if spirv-tools %{ mkdir %t %} +// RUN: %if spirv-tools %{ mlir-translate --no-implicit-module --serialize-spirv --split-input-file --spirv-save-validation-files-with-prefix=%t/module %s %} +// RUN: %if spirv-tools %{ spirv-val %t %} + +spirv.module Logical GLSL450 requires #spirv.vce { // CHECK: spirv.SpecConstant @sc_true = true spirv.SpecConstant @sc_true = true // CHECK: spirv.SpecConstant @sc_false spec_id(1) = false @@ -48,7 +53,7 @@ spirv.module Logical GLSL450 requires #spirv.vce { // ----- -spirv.module Logical GLSL450 requires #spirv.vce { +spirv.module Logical GLSL450 requires #spirv.vce { spirv.SpecConstant @sc_f32_1 = 1.5 : f32 spirv.SpecConstant @sc_f32_2 = 2.5 : f32 @@ -68,7 +73,7 @@ spirv.module Logical GLSL450 requires #spirv.vce { // ----- -spirv.module Logical GLSL450 requires #spirv.vce { +spirv.module Logical GLSL450 requires #spirv.vce { spirv.SpecConstant @sc_f32_1 = 1.5 : f32 spirv.SpecConstant @sc_f32_2 = 2.5 : f32 @@ -88,7 +93,7 @@ spirv.module Logical GLSL450 requires #spirv.vce { // ----- -spirv.module Logical GLSL450 requires #spirv.vce { +spirv.module Logical GLSL450 requires #spirv.vce { spirv.SpecConstant @sc_i32_1 = 1 : i32 @@ -115,7 +120,7 @@ spirv.module Logical GLSL450 requires #spirv.vce { +spirv.module Logical GLSL450 requires #spirv.vce { spirv.SpecConstant @sc_i32_1 = 1 : i32 diff --git a/mlir/test/Target/SPIRV/tensorARM.mlir b/mlir/test/Target/SPIRV/tensorARM.mlir index 75b648ebfd008..53a41e19f930f 100644 --- a/mlir/test/Target/SPIRV/tensorARM.mlir +++ b/mlir/test/Target/SPIRV/tensorARM.mlir @@ -1,6 +1,11 @@ // RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip %s | FileCheck %s -spirv.module Logical GLSL450 requires #spirv.vce { +// RUN: %if spirv-tools %{ rm -rf %t %} +// RUN: %if spirv-tools %{ mkdir %t %} +// RUN: %if spirv-tools %{ mlir-translate --no-implicit-module --serialize-spirv --spirv-save-validation-files-with-prefix=%t/module %s %} +// RUN: %if spirv-tools %{ spirv-val %t %} + +spirv.module Logical GLSL450 requires #spirv.vce { // CHECK: spirv.func @shaped_int_arm_tensor(%arg0: !spirv.arm.tensor<2xi32>) "None" { spirv.func @shaped_int_arm_tensor(%arg0 : !spirv.arm.tensor<2xi32>) "None" { spirv.Return diff --git a/mlir/test/Target/SPIRV/terminator.mlir b/mlir/test/Target/SPIRV/terminator.mlir index 8338a575681f1..8e5b043800a2c 100644 --- a/mlir/test/Target/SPIRV/terminator.mlir +++ b/mlir/test/Target/SPIRV/terminator.mlir @@ -1,6 +1,11 @@ // RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip %s | FileCheck %s -spirv.module Logical GLSL450 requires #spirv.vce { +// RUN: %if spirv-tools %{ rm -rf %t %} +// RUN: %if spirv-tools %{ mkdir %t %} +// RUN: %if spirv-tools %{ mlir-translate --no-implicit-module --serialize-spirv --split-input-file --spirv-save-validation-files-with-prefix=%t/module %s %} +// RUN: %if spirv-tools %{ spirv-val %t %} + +spirv.module Logical GLSL450 requires #spirv.vce { // CHECK-LABEL: @ret spirv.func @ret() -> () "None" { // CHECK: spirv.Return diff --git a/mlir/test/Target/SPIRV/undef.mlir b/mlir/test/Target/SPIRV/undef.mlir index 8889b80e86f95..08ac1ff45efef 100644 --- a/mlir/test/Target/SPIRV/undef.mlir +++ b/mlir/test/Target/SPIRV/undef.mlir @@ -1,6 +1,11 @@ // RUN: mlir-translate -no-implicit-module -split-input-file -test-spirv-roundtrip %s | FileCheck %s -spirv.module Logical GLSL450 requires #spirv.vce { +// RUN: %if spirv-tools %{ rm -rf %t %} +// RUN: %if spirv-tools %{ mkdir %t %} +// RUN: %if spirv-tools %{ mlir-translate --no-implicit-module --serialize-spirv --split-input-file --spirv-save-validation-files-with-prefix=%t/module %s %} +// RUN: %if spirv-tools %{ spirv-val %t %} + +spirv.module Logical GLSL450 requires #spirv.vce { spirv.func @foo() -> () "None" { // CHECK: {{%.*}} = spirv.Undef : f32 // CHECK-NEXT: {{%.*}} = spirv.Undef : f32 @@ -23,7 +28,7 @@ spirv.module Logical GLSL450 requires #spirv.vce { // ----- -spirv.module Logical GLSL450 requires #spirv.vce { +spirv.module Logical GLSL450 requires #spirv.vce { // CHECK: spirv.func {{@.*}} spirv.func @ignore_unused_undef() -> () "None" { // CHECK-NEXT: spirv.Return