File tree Expand file tree Collapse file tree 4 files changed +79
-0
lines changed Expand file tree Collapse file tree 4 files changed +79
-0
lines changed Original file line number Diff line number Diff line change
1
+ ; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s
2
+ ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}
3
+
4
+ ; CHECK: %[[#BoolTy:]] = OpTypeBool
5
+ ; CHECK: %[[#VecTy:]] = OpTypeVector %[[#BoolTy]] 4
6
+ ; CHECK: %[[#False:]] = OpConstantFalse %[[#BoolTy]]
7
+ ; CHECK: %[[#Composite:]] = OpConstantComposite %[[#VecTy]] %[[#False]] %[[#False]] %[[#False]] %[[#False]]
8
+ ; CHECK: OpReturnValue %[[#Composite]]
9
+
10
+ define spir_func <4 x i1 > @f (<4 x float > %0 ) {
11
+ %2 = fcmp false <4 x float > %0 , %0
12
+ ret <4 x i1 > %2
13
+ }
Original file line number Diff line number Diff line change
1
+ ;; This test checks if we generate a single builtin variable for the following
2
+ ;; LLVM IR.
3
+ ;; @__spirv_BuiltInLocalInvocationId - A global variable
4
+ ;; %3 = tail call i64 @_Z12get_local_idj(i32 0) - A function call
5
+
6
+ ; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s
7
+ ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}
8
+
9
+ ; CHECK: OpName %[[#]] "__spirv_BuiltInLocalInvocationId"
10
+ ; CHECK-NOT: OpName %[[#]] "__spirv_BuiltInLocalInvocationId.1"
11
+
12
+ @__spirv_BuiltInLocalInvocationId = external dso_local local_unnamed_addr addrspace (1 ) constant <3 x i64 >, align 32
13
+
14
+ declare spir_func i64 @_Z12get_local_idj (i32 ) local_unnamed_addr
15
+
16
+ define spir_kernel void @test_fn (i32 %a ) {
17
+ entry:
18
+ %3 = tail call i64 @_Z12get_local_idj (i32 0 )
19
+ ret void
20
+ }
Original file line number Diff line number Diff line change
1
+ ; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s
2
+ ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}
3
+
4
+ @.str.1 = private unnamed_addr addrspace (1 ) constant [1 x i8 ] zeroinitializer , align 1
5
+
6
+ define linkonce_odr hidden spir_func void @foo () {
7
+ entry:
8
+ ; CHECK: %[[#MinusOne:]] = OpConstant %[[#]] 18446744073709551615
9
+ ; CHECK: %[[#Ptr:]] = OpConvertUToPtr %[[#]] %[[#MinusOne]]
10
+ ; CHECK: %[[#PtrCast:]] = OpPtrCastToGeneric %[[#]] %[[#]]
11
+ ; CHECK: %[[#]] = OpFunctionCall %[[#]] %[[#]] %[[#PtrCast]] %[[#Ptr]]
12
+
13
+ %0 = bitcast ptr addrspace (4 ) inttoptr (i64 -1 to ptr addrspace (4 )) to ptr addrspace (4 )
14
+ call spir_func void @bar (ptr addrspace (4 ) addrspacecast (ptr addrspace (1 ) @.str.1 to ptr addrspace (4 )), ptr addrspace (4 ) %0 )
15
+ ret void
16
+ }
17
+
18
+ define linkonce_odr hidden spir_func void @bar (ptr addrspace (4 ) %__beg , ptr addrspace (4 ) %__end ) {
19
+ entry:
20
+ ret void
21
+ }
Original file line number Diff line number Diff line change
1
+ ; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s
2
+ ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}
3
+
4
+ ; This test checks that basic blocks are reordered in SPIR-V so that dominators
5
+ ; are emitted ahead of their dominated blocks as required by the SPIR-V
6
+ ; specification.
7
+
8
+ ; CHECK-DAG: OpName %[[#ENTRY:]] "entry"
9
+ ; CHECK-DAG: OpName %[[#FOR_BODY137_LR_PH:]] "for.body137.lr.ph"
10
+ ; CHECK-DAG: OpName %[[#FOR_BODY:]] "for.body"
11
+
12
+ ; CHECK: %[[#ENTRY]] = OpLabel
13
+ ; CHECK: %[[#FOR_BODY]] = OpLabel
14
+ ; CHECK: %[[#FOR_BODY137_LR_PH]] = OpLabel
15
+
16
+ define spir_kernel void @test (ptr addrspace (1 ) %arg , i1 %cond ) {
17
+ entry:
18
+ br label %for.body
19
+
20
+ for.body137.lr.ph: ; preds = %for.body
21
+ ret void
22
+
23
+ for.body: ; preds = %for.body, %entry
24
+ br i1 %cond , label %for.body , label %for.body137.lr.ph
25
+ }
You can’t perform that action at this time.
0 commit comments