forked from google/clspv
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert coherent tests to SPIRVProducer tests
refs google#1292 * Convert Coherent tests from .cl to .ll * No longer tests the whole flow and instead is targeted at the SPIRVProducer only * more robust since it is more specific
- Loading branch information
1 parent
bef237b
commit f741adb
Showing
22 changed files
with
443 additions
and
221 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
; RUN: clspv-opt %s -o %t.ll -producer-out-file %t.spv --passes=spirv-producer | ||
; RUN: spirv-dis %t.spv -o %t.spvasm | ||
; RUN: spirv-val %t.spv --target-env vulkan1.0 | ||
; RUN: FileCheck %s < %t.spvasm | ||
|
||
; CHECK: OpDecorate [[var:%[a-zA-Z0-9_]+]] DescriptorSet 0 | ||
; CHECK: OpDecorate [[var]] Binding 0 | ||
; CHECK: OpDecorate [[var]] Coherent | ||
|
||
target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024" | ||
target triple = "spir-unknown-unknown" | ||
|
||
@__spirv_WorkgroupSize = local_unnamed_addr addrspace(8) global <3 x i32> zeroinitializer | ||
|
||
define dso_local spir_func void @bar() { | ||
entry: | ||
tail call void @_Z8spirv.op.224.jjj(i32 224, i32 2, i32 2, i32 72) | ||
ret void | ||
} | ||
|
||
define dso_local spir_kernel void @foo(ptr addrspace(1) nocapture align 4 %data)!clspv.pod_args_impl !14 { | ||
entry: | ||
%0 = call ptr addrspace(1) @_Z14clspv.resource.0(i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, { [0 x i32] } zeroinitializer) | ||
%1 = getelementptr { [0 x i32] }, ptr addrspace(1) %0, i32 0, i32 0, i32 0 | ||
%2 = load i32, ptr addrspace(1) %1, align 4 | ||
tail call spir_func void @bar() | ||
%3 = getelementptr { [0 x i32] }, ptr addrspace(1) %0, i32 0, i32 0, i32 1 | ||
store i32 %2, ptr addrspace(1) %3, align 4 | ||
ret void | ||
} | ||
|
||
declare void @_Z8spirv.op.224.jjj(i32, i32, i32, i32) | ||
|
||
declare ptr addrspace(1) @_Z14clspv.resource.0(i32, i32, i32, i32, i32, i32, { [0 x i32] }) | ||
|
||
!14 = !{i32 2} | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
; RUN: clspv-opt %s -o %t.ll -producer-out-file %t.spv --passes=spirv-producer | ||
; RUN: spirv-dis %t.spv -o %t.spvasm | ||
; RUN: spirv-val %t.spv --target-env vulkan1.0 | ||
; RUN: FileCheck %s < %t.spvasm | ||
|
||
; CHECK: OpDecorate [[var:%[a-zA-Z0-9_]+]] DescriptorSet 0 | ||
; CHECK: OpDecorate [[var]] Binding 0 | ||
; CHECK: OpDecorate [[var]] Coherent | ||
|
||
target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024" | ||
target triple = "spir-unknown-unknown" | ||
|
||
@__spirv_WorkgroupSize = local_unnamed_addr addrspace(8) global <3 x i32> zeroinitializer | ||
|
||
define dso_local spir_kernel void @foo(ptr addrspace(1) nocapture align 4 %data)!clspv.pod_args_impl !13 { | ||
entry: | ||
%0 = call ptr addrspace(1) @_Z14clspv.resource.0(i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, { [0 x i32] } zeroinitializer) | ||
%1 = getelementptr { [0 x i32] }, ptr addrspace(1) %0, i32 0, i32 0, i32 0 | ||
%2 = load i32, ptr addrspace(1) %1, align 4 | ||
tail call void @_Z8spirv.op.225.jj(i32 225, i32 2, i32 72) | ||
%3 = getelementptr { [0 x i32] }, ptr addrspace(1) %0, i32 0, i32 0, i32 1 | ||
store i32 %2, ptr addrspace(1) %3, align 4 | ||
ret void | ||
} | ||
|
||
declare void @_Z8spirv.op.225.jj(i32, i32, i32) | ||
|
||
declare ptr addrspace(1) @_Z14clspv.resource.0(i32, i32, i32, i32, i32, i32, { [0 x i32] }) | ||
|
||
!13 = !{i32 2} | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
; RUN: clspv-opt %s -o %t.ll -producer-out-file %t.spv --passes=spirv-producer | ||
; RUN: spirv-dis %t.spv -o %t.spvasm | ||
; RUN: spirv-val %t.spv --target-env vulkan1.0 | ||
; RUN: FileCheck %s < %t.spvasm | ||
|
||
; CHECK: OpDecorate [[var:%[a-zA-Z0-9_]+]] DescriptorSet 0 | ||
; CHECK: OpDecorate [[var]] Binding 0 | ||
; CHECK: OpDecorate [[var]] Coherent | ||
; CHECK: OpDecorate [[param1:%[a-zA-Z0-9_]+]] Coherent | ||
; CHECK: OpDecorate [[param2:%[a-zA-Z0-9_]+]] Coherent | ||
; CHECK: [[baz:%[a-zA-Z0-9_]+]] = OpFunction | ||
; CHECK: [[param1]] = OpFunctionParameter | ||
; CHECK: = OpFunction | ||
; CHECK: [[param2]] = OpFunctionParameter | ||
; CHECK: OpFunctionCall {{.*}} [[baz]] [[param2]] | ||
|
||
target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024" | ||
target triple = "spir-unknown-unknown" | ||
|
||
@__spirv_WorkgroupSize = local_unnamed_addr addrspace(8) global <3 x i32> zeroinitializer | ||
|
||
define dso_local spir_func i32 @baz(ptr addrspace(1) nocapture readonly %x) { | ||
entry: | ||
%0 = load i32, ptr addrspace(1) %x, align 4 | ||
ret i32 %0 | ||
} | ||
|
||
define dso_local spir_func i32 @bar(ptr addrspace(1) nocapture readonly %x) { | ||
entry: | ||
%call = tail call spir_func i32 @baz(ptr addrspace(1) %x) | ||
ret i32 %call | ||
} | ||
|
||
define dso_local spir_kernel void @foo(ptr addrspace(1) nocapture align 4 %data) !clspv.pod_args_impl !16 { | ||
entry: | ||
%0 = call ptr addrspace(1) @_Z14clspv.resource.0(i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, { [0 x i32] } zeroinitializer) | ||
%1 = getelementptr { [0 x i32] }, ptr addrspace(1) %0, i32 0, i32 0, i32 0 | ||
%call = tail call spir_func i32 @bar(ptr addrspace(1) %1) | ||
tail call void @_Z8spirv.op.224.jjj(i32 224, i32 2, i32 2, i32 72) | ||
%2 = getelementptr { [0 x i32] }, ptr addrspace(1) %0, i32 0, i32 0, i32 1 | ||
store i32 %call, ptr addrspace(1) %2, align 4 | ||
ret void | ||
} | ||
|
||
declare void @_Z8spirv.op.224.jjj(i32, i32, i32, i32) | ||
|
||
declare ptr addrspace(1) @_Z14clspv.resource.0(i32, i32, i32, i32, i32, i32, { [0 x i32] }) | ||
|
||
!16 = !{i32 2} | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
; RUN: clspv-opt %s -o %t.ll -producer-out-file %t.spv --passes=spirv-producer | ||
; RUN: spirv-dis %t.spv -o %t.spvasm | ||
; RUN: spirv-val %t.spv --target-env vulkan1.0 | ||
; RUN: FileCheck %s < %t.spvasm | ||
|
||
; CHECK: OpDecorate [[var:%[a-zA-Z0-9_]+]] DescriptorSet 0 | ||
; CHECK: OpDecorate [[var]] Binding 0 | ||
; CHECK: OpDecorate [[var]] Coherent | ||
|
||
target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024" | ||
target triple = "spir-unknown-unknown" | ||
|
||
@__spirv_WorkgroupSize = local_unnamed_addr addrspace(8) global <3 x i32> zeroinitializer | ||
|
||
define dso_local spir_kernel void @foo(ptr addrspace(1) nocapture align 4 %data) !clspv.pod_args_impl !13 { | ||
entry: | ||
%0 = call ptr addrspace(1) @_Z14clspv.resource.0(i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, { [0 x i32] } zeroinitializer) | ||
%1 = getelementptr { [0 x i32] }, ptr addrspace(1) %0, i32 0, i32 0, i32 0 | ||
%2 = load i32, ptr addrspace(1) %1, align 4 | ||
tail call void @_Z8spirv.op.224.jjj(i32 224, i32 2, i32 2, i32 72) | ||
%3 = getelementptr { [0 x i32] }, ptr addrspace(1) %0, i32 0, i32 0, i32 1 | ||
store i32 %2, ptr addrspace(1) %3, align 4 | ||
ret void | ||
} | ||
|
||
declare void @_Z8spirv.op.224.jjj(i32, i32, i32, i32) | ||
|
||
declare ptr addrspace(1) @_Z14clspv.resource.0(i32, i32, i32, i32, i32, i32, { [0 x i32] }) | ||
|
||
!13 = !{i32 2} | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
; RUN: clspv-opt %s -o %t.ll -producer-out-file %t.spv --passes=spirv-producer | ||
; RUN: spirv-dis %t.spv -o %t.spvasm | ||
; RUN: spirv-val %t.spv --target-env vulkan1.0 | ||
; RUN: FileCheck %s < %t.spvasm | ||
|
||
; CHECK: OpDecorate [[var:%[a-zA-Z0-9_]+]] DescriptorSet 0 | ||
; CHECK: OpDecorate [[var]] Binding 0 | ||
; CHECK: OpDecorate [[var]] Coherent | ||
; CHECK: OpDecorate [[param:%[a-zA-Z0-9_]+]] Coherent | ||
; CHECK: [[param]] = OpFunctionParameter | ||
|
||
target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024" | ||
target triple = "spir-unknown-unknown" | ||
|
||
@__spirv_WorkgroupSize = local_unnamed_addr addrspace(8) global <3 x i32> zeroinitializer | ||
|
||
define dso_local spir_func i32 @bar(ptr addrspace(1) nocapture readonly %x) { | ||
entry: | ||
%0 = load i32, ptr addrspace(1) %x, align 4 | ||
ret i32 %0 | ||
} | ||
|
||
define dso_local spir_kernel void @foo(ptr addrspace(1) nocapture align 4 %data) !clspv.pod_args_impl !15 { | ||
entry: | ||
%0 = call ptr addrspace(1) @_Z14clspv.resource.0(i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, { [0 x i32] } zeroinitializer) | ||
%1 = getelementptr { [0 x i32] }, ptr addrspace(1) %0, i32 0, i32 0, i32 0 | ||
%call = tail call spir_func i32 @bar(ptr addrspace(1) %1) | ||
tail call void @_Z8spirv.op.224.jjj(i32 224, i32 2, i32 2, i32 72) | ||
%2 = getelementptr { [0 x i32] }, ptr addrspace(1) %0, i32 0, i32 0, i32 1 | ||
store i32 %call, ptr addrspace(1) %2, align 4 | ||
ret void | ||
} | ||
|
||
declare void @_Z8spirv.op.224.jjj(i32, i32, i32, i32) | ||
|
||
declare ptr addrspace(1) @_Z14clspv.resource.0(i32, i32, i32, i32, i32, i32, { [0 x i32] }) | ||
|
||
!15 = !{i32 2} | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
; RUN: clspv-opt %s -o %t.ll -producer-out-file %t.spv --passes=spirv-producer | ||
; RUN: spirv-dis %t.spv -o %t.spvasm | ||
; RUN: spirv-val %t.spv --target-env vulkan1.0 | ||
; RUN: FileCheck %s < %t.spvasm | ||
|
||
; CHECK: OpDecorate [[data:%[a-zA-Z0-9_]+]] DescriptorSet 0 | ||
; CHECK: OpDecorate [[data]] Binding 0 | ||
; CHECK: OpDecorate [[data]] Coherent | ||
; CHECK: OpDecorate [[x:%[a-zA-Z0-9_]+]] DescriptorSet 0 | ||
; CHECK: OpDecorate [[x]] Binding 1 | ||
; CHECK-NOT: OpDecorate [[x]] Coherent | ||
|
||
target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024" | ||
target triple = "spir-unknown-unknown" | ||
|
||
@__spirv_WorkgroupSize = local_unnamed_addr addrspace(8) global <3 x i32> zeroinitializer | ||
|
||
define dso_local spir_kernel void @foo(ptr addrspace(1) nocapture align 4 %data, ptr addrspace(1) nocapture writeonly align 4 %x) !clspv.pod_args_impl !14 { | ||
entry: | ||
%0 = call ptr addrspace(1) @_Z14clspv.resource.0(i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, { [0 x i32] } zeroinitializer) | ||
%1 = call ptr addrspace(1) @_Z14clspv.resource.1(i32 0, i32 1, i32 0, i32 1, i32 1, i32 0, { [0 x float] } zeroinitializer) | ||
%2 = getelementptr { [0 x float] }, ptr addrspace(1) %1, i32 0, i32 0, i32 0 | ||
%3 = getelementptr { [0 x i32] }, ptr addrspace(1) %0, i32 0, i32 0, i32 0 | ||
%4 = load i32, ptr addrspace(1) %3, align 1 | ||
%conv = sitofp i32 %4 to float | ||
tail call void @_Z8spirv.op.224.jjj(i32 224, i32 2, i32 2, i32 72) #3 | ||
%5 = getelementptr { [0 x i32] }, ptr addrspace(1) %0, i32 0, i32 0, i32 1 | ||
%call = tail call spir_func float @_Z5frexpfPU3AS1i(float %conv, ptr addrspace(1) %5) | ||
store float %call, ptr addrspace(1) %2, align 4 | ||
ret void | ||
} | ||
|
||
declare dso_local spir_func float @_Z5frexpfPU3AS1i(float noundef, ptr addrspace(1) nocapture noundef writeonly) | ||
|
||
declare void @_Z8spirv.op.224.jjj(i32, i32, i32, i32) | ||
|
||
declare ptr addrspace(1) @_Z14clspv.resource.0(i32, i32, i32, i32, i32, i32, { [0 x i32] }) | ||
|
||
declare ptr addrspace(1) @_Z14clspv.resource.1(i32, i32, i32, i32, i32, i32, { [0 x float] }) | ||
|
||
!14 = !{i32 2} | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
; RUN: clspv-opt %s -o %t.ll -producer-out-file %t.spv --passes=spirv-producer | ||
; RUN: spirv-dis %t.spv -o %t.spvasm | ||
; RUN: spirv-val %t.spv --target-env vulkan1.0 | ||
; RUN: FileCheck %s < %t.spvasm | ||
|
||
; Lack of barrier means |data| is not coherent. | ||
; CHECK-NOT: OpDecorate {{.*}} Coherent | ||
|
||
target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024" | ||
target triple = "spir-unknown-unknown" | ||
|
||
@__spirv_WorkgroupSize = local_unnamed_addr addrspace(8) global <3 x i32> zeroinitializer | ||
|
||
define dso_local spir_kernel void @foo(ptr addrspace(1) nocapture align 4 %data) !clspv.pod_args_impl !13 { | ||
entry: | ||
%0 = call ptr addrspace(1) @_Z14clspv.resource.0(i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, { [0 x i32] } zeroinitializer) | ||
%1 = getelementptr { [0 x i32] }, ptr addrspace(1) %0, i32 0, i32 0, i32 0 | ||
%2 = load i32, ptr addrspace(1) %1, align 4 | ||
%3 = getelementptr { [0 x i32] }, ptr addrspace(1) %0, i32 0, i32 0, i32 1 | ||
store i32 %2, ptr addrspace(1) %3, align 4 | ||
ret void | ||
} | ||
|
||
declare ptr addrspace(1) @_Z14clspv.resource.0(i32, i32, i32, i32, i32, i32, { [0 x i32] }) | ||
|
||
!13 = !{i32 2} | ||
|
Oops, something went wrong.